public void ApplyFeature(SolutionFolder parentCombine, SolutionItem entry, Widget ed) { AddinFeatureWidget editor = (AddinFeatureWidget)ed; AddinData data = AddinData.EnableAddinAuthoringSupport((DotNetProject)entry); DotNetProject project = (DotNetProject)entry; if (editor.HasRegistryInfo) { project.GetAddinData().ApplicationName = editor.ApplicationName; } AddinDescription desc = data.LoadAddinManifest(); if (editor.AddinId.Length > 0) { desc.LocalId = editor.AddinId; } if (editor.AddinName.Length > 0) { desc.Name = editor.AddinName; } desc.Namespace = editor.AddinNamespace; desc.IsRoot = project.CompileTarget != CompileTarget.Library || editor.IsRoot; desc.Version = "1.0"; desc.Save(); data.NotifyChanged(); }
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(); } } }
public void OnAddExtension() { DotNetProject p = CurrentNode.GetParentDataItem(typeof(Project), true) as DotNetProject; AddinData data = AddinData.GetAddinData(p); AddinDescription desc = data.LoadAddinManifest(); ExtensionSelectorDialog dlg = new ExtensionSelectorDialog(data.AddinRegistry, null, desc.IsRoot, false); if (dlg.Run() == (int)ResponseType.Ok) { foreach (object ob in dlg.GetSelection()) { Console.WriteLine("pp s: " + ob); } } dlg.Destroy(); }
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 (); } }