public void ToggleFavorite()
 {
     SetFavorite(!isFavorite);
     if (!isFavorite)
     {
         if (parent != null && !parent.HasAnyFavoriteChild())
         {
             CompleteContextMenu.RemoveFavorite(parent.fullPath);
         }
     }
 }
示例#2
0
            void SetFavorite(bool fav)
            {
                if (fav == true)
                {
                    if (!isFavorite)
                    {
                        CompleteContextMenu.AddFavorite(fullPath);
                    }
                }

                if (fav == false)
                {
                    if (isFavorite)
                    {
                        CompleteContextMenu.RemoveFavorite(fullPath);
                    }
                }
            }
            void SetFavorite(bool fav)
            {
                isFavorite = fav;
                if (fav == true)
                {
                    CompleteContextMenu.AddFavorite(fullPath);
                    foreach (var child in children.Values)
                    {
                        child.SetFavorite(fav);
                    }
                }

                if (fav == false)
                {
                    CompleteContextMenu.RemoveFavorite(fullPath);
                    foreach (var child in children.Values)
                    {
                        child.SetFavorite(fav);
                    }
                }
            }