public void BeforeSave() { if (changed) { WorkbenchWindow.Document.Editor.Text = AddinAuthoringService.SaveFormattedXml(data.Project.Policies, desc); } }
void Fill(string selection) { state.Save(); store.Clear(); TreeIter selIter = TreeIter.Zero; foreach (RegistryInfo reg in AddinAuthoringService.GetRegistries()) { TreeIter it = store.AppendValues(reg.ApplicationName, reg.Description, reg); if (reg.ApplicationName == selection) { selIter = it; } } state.Load(); if (!selIter.Equals(TreeIter.Zero)) { tree.Selection.SelectIter(selIter); } else { if (!tree.Selection.GetSelected(out selIter) && store.GetIterFirst(out selIter)) { tree.Selection.SelectIter(selIter); } } UpdateButtons(); }
public void UpdateRegistry() { registryNeedsUpdate = false; FilePath addinsPath = TempRegistryPath.Combine("addins"); if (!Directory.Exists(addinsPath)) { Directory.CreateDirectory(addinsPath); } using (StreamWriter sw = new StreamWriter(TempRegistryPath.Combine("dummy.addin.xml"))) { sw.WriteLine("<Addin id=\"__\" version=\"1.0\" namespace=\"__\" isroot=\"true\" name=\"__\"/>"); } FilePath includeFile = addinsPath.Combine("all.addins"); using (StreamWriter sw = new StreamWriter(includeFile)) { XmlTextWriter tw = new XmlTextWriter(sw); tw.Formatting = Formatting.Indented; tw.WriteStartElement("Addins"); foreach (DotNetProject p in solution.GetAllSolutionItems <DotNetProject> ()) { tw.WriteElementString("Directory", p.GetOutputFileName(IdeApp.Workspace.ActiveConfiguration).ParentDirectory); } tw.WriteEndElement(); } Registry.Update(new ConsoleProgressStatus(false)); AddinAuthoringService.NotifyRegistryChanged(Registry); }
public override void Save() { descWidget.Save(); AddinAuthoringService.SaveFormatted(adesc); IsDirty = false; data.NotifyChanged(true); }
public void SaveAddinManifest() { lock (changeLock) { if (manifest != null) { AddinAuthoringService.SaveFormatted(project.Policies, manifest); lastNotifiedTimestamp = File.GetLastWriteTime(manifest.FileName); } } }
protected virtual void OnButtonRemoveClicked(object sender, System.EventArgs e) { string q = AddinManager.CurrentLocalizer.GetString("Are you sure you want to remove this registry reference?"); if (MessageService.Confirm(q, AlertButton.Remove)) { TreeIter it; tree.Selection.GetSelected(out it); RegistryInfo reg = (RegistryInfo)store.GetValue(it, 2); AddinAuthoringService.RemoveCustomRegistry(reg); Fill(null); } }
public override void DeleteItem() { DotNetProject p = CurrentNode.GetParentDataItem(typeof(Project), true) as DotNetProject; AddinData data = AddinData.GetAddinData(p); AddinDependency adep = (AddinDependency)CurrentNode.DataItem; string q = AddinManager.CurrentLocalizer.GetString("Are you sure you want to remove the reference to add-in '{0}'?", Addin.GetIdName(adep.AddinId)); if (MessageService.Confirm(q, AlertButton.Remove)) { AddinAuthoringService.RemoveReferences(data, new string[] { adep.FullAddinId }); } }
public void AddAddinDependency() { DotNetProject p = CurrentNode.GetParentDataItem(typeof(Project), true) as DotNetProject; AddinData data = AddinData.GetAddinData(p); ExtensionSelectorDialog dlg = new ExtensionSelectorDialog(data.AddinRegistry, null, data.CachedAddinManifest.IsRoot, true); if (dlg.Run() == (int)Gtk.ResponseType.Ok) { AddinAuthoringService.AddReferences(data, dlg.GetSelection()); } dlg.Destroy(); }
protected virtual void OnButtonAddClicked(object sender, System.EventArgs e) { NewRegistryDialog dlg = new NewRegistryDialog(null); dlg.TransientFor = this; if (dlg.Run() == (int)Gtk.ResponseType.Ok) { RegistryInfo reg = new RegistryInfo(); reg.ApplicationName = dlg.ApplicationName; reg.ApplicationPath = dlg.ApplicationPath; reg.RegistryPath = dlg.RegistryPath; AddinAuthoringService.AddCustomRegistry(reg); Fill(null); } dlg.Destroy(); }
public override void GetNodeAttributes(ITreeNavigator parentNode, object dataObject, ref NodeAttributes attributes) { if (dataObject is AddinProjectReference) { attributes |= NodeAttributes.Hidden; return; } ProjectReference pr = (ProjectReference)dataObject; DotNetProject parent = pr.OwnerProject as DotNetProject; if (AddinAuthoringService.IsProjectIncludedByAddin(parent, pr)) { attributes |= NodeAttributes.Hidden; } else if (parent.GetAddinData() != null && pr.ReferenceType == ReferenceType.Project) { DotNetProject tp = parent.ParentSolution.FindProjectByName(pr.Reference) as DotNetProject; if (tp != null && tp.GetAddinData() != null) { attributes |= NodeAttributes.Hidden; } } }
internal AddinData() { AddinAuthoringService.Init(); }
protected override void Run() { AddinAuthoringService.ShowExtensionModelBrowser(); }