ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Core Namespace / FavoritesManager Class / ClearIsAddedToAllNewProjects Method
The item to be updated in the favorites collection.
Example

In This Topic
    ClearIsAddedToAllNewProjects Method
    In This Topic
    Sets the Favorite.IsAddedToAllNewProjects value to false for the specified item in the favorite collection.
    Syntax
    public void ClearIsAddedToAllNewProjects( 
       Item item
    )
    Public Sub ClearIsAddedToAllNewProjects( _
       ByVal item As Item _
    ) 

    Parameters

    item
    The item to be updated in the favorites collection.
    Example
    Toggle the flag IsAddedToAllNewProjects for a favorite
    var itemFolder = ItemFactory.Instance.Create(@"d:\data");
    
    // is the folder item already a favorite?
    var fav = FavoritesManager.Current.GetFavorite(itemFolder);
    if (fav != null)
    {
      if (fav.IsAddedToAllNewProjects)
        FavoritesManager.Current.ClearIsAddedToAllNewProjects(fav.Item);
      else
        FavoritesManager.Current.SetIsAddedToAllNewProjects(fav.Item);
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also