public void Convert(string guiFolderName, bool makeBackup) { GtkDesignInfo info = GtkDesignInfo.FromProject(project); Stetic.Project gproject = GuiBuilderService.SteticApp.CreateProject(info); //Stetic.Project does not implement IDisposable try { string newGuiFolderName = project.BaseDirectory.Combine(guiFolderName); gproject.ConvertProject(info.SteticFile, newGuiFolderName); info.ConvertGtkFolder(guiFolderName, makeBackup); info.UpdateGtkFolder(); folderName = newGuiFolderName; IProgressMonitor monitor = IdeApp.Workbench.ProgressMonitors.GetBuildProgressMonitor(); try { ConfigurationSelector configuration = IdeApp.Workspace.ActiveConfiguration; Generator generator = new Generator(); generator.Run(monitor, project, configuration); monitor.ReportSuccess("Converting was succesfull"); } finally { monitor.Dispose(); } } finally { gproject.Dispose(); } }
void Unload() { if (gproject == null) { return; } Counters.SteticProjectsLoaded--; if (Unloaded != null) { Unloaded(this, EventArgs.Empty); } if (formInfos != null) { foreach (GuiBuilderWindow win in formInfos) { win.Dispose(); } formInfos = null; } if (gproject != null) { gproject.WidgetAdded -= OnAddWidget; gproject.WidgetRemoved -= OnRemoveWidget; gproject.ActionGroupsChanged -= OnGroupsChanged; gproject.Dispose(); gproject = null; } if (project != null) { project.FileAddedToProject -= OnFileAdded; project.FileRemovedFromProject -= OnFileRemoved; project.ReferenceAddedToProject -= OnReferenceAdded; project.ReferenceRemovedFromProject -= OnReferenceRemoved; } needsUpdate = true; hasError = false; librariesUpdated = false; if (watcher != null) { watcher.Dispose(); watcher = null; } NotifyChanged(); }