コード例 #1
0
        internal static void RemoveReferences(AddinData data, string[] fullIds)
        {
            AddinDescription     desc = data.LoadAddinManifest();
            AddinDescriptionView view = FindLoadedDescription(data);

            foreach (string ad in fullIds)
            {
                RemoveReference(desc, ad);
                if (view != null)
                {
                    RemoveReference(view.AddinDescription, ad);
                }
            }
            if (view != null)
            {
                view.Update();
                view.BeginInternalUpdate();
            }

            try {
                desc.Save();
                data.NotifyChanged(true);
            } finally {
                if (view != null)
                {
                    view.EndInternalUpdate();
                }
            }
        }
コード例 #2
0
 static AddinDescriptionView FindLoadedDescription(AddinData data)
 {
     foreach (Document doc in IdeApp.Workbench.Documents)
     {
         AddinDescriptionView view = doc.GetContent <AddinDescriptionView> ();
         if (view != null && view.Data == data)
         {
             return(view);
         }
     }
     return(null);
 }
コード例 #3
0
        public override void ActivateItem()
        {
            AddinData data = (AddinData)CurrentNode.GetParentDataItem(typeof(AddinData), false);
            Document  doc  = IdeApp.Workbench.OpenDocument(data.AddinManifestFileName);

            if (doc != null)
            {
                AddinDescriptionView view = doc.GetContent <AddinDescriptionView> ();
                if (view != null)
                {
                    view.ShowExtensions();
                }
            }
        }
コード例 #4
0
 public override void ActivateItem()
 {
     if (CurrentNode.DataItem is AddinData)
     {
         AddinData data = (AddinData)CurrentNode.DataItem;
         foreach (Document doc in IdeApp.Workbench.Documents)
         {
             AddinDescriptionView view = doc.GetContent <AddinDescriptionView> ();
             if (view != null && view.Data == data)
             {
                 doc.Select();
                 return;
             }
         }
         IdeApp.Workbench.OpenDocument(new AddinDescriptionView(data), true);
     }
 }