SetIsAddedToAllNewProjects Method
Sets the
Favorite.IsAddedToAllNewProjects value to true for the specified item in the favorite collection.
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);
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.