public override async void ActivateItem() { GuiBuilderWindow w = (GuiBuilderWindow)CurrentNode.GetParentDataItem(typeof(GuiBuilderWindow), false); if (w != null) { if (w.SourceCodeFile == FilePath.Null && !w.BindToClass()) { return; } Document doc = await IdeApp.Workbench.OpenDocument(w.SourceCodeFile, null, true); if (doc != null) { GuiBuilderView view = doc.GetContent <GuiBuilderView> (); if (view != null) { view.ShowActionDesignerView(((Stetic.ActionGroupInfo)CurrentNode.DataItem).Name); } } } else { Project project = (Project)CurrentNode.GetParentDataItem(typeof(Project), false); Stetic.ActionGroupInfo group = (Stetic.ActionGroupInfo)CurrentNode.DataItem; await GuiBuilderService.OpenActionGroup(project, group); } }
protected void OnReloadDesigner() { ProjectFile pf = CurrentNode.DataItem as ProjectFile; Project project = CurrentNode.GetParentDataItem(typeof(Project), true) as Project; GtkDesignInfo info = GtkDesignInfo.FromProject(project); GuiBuilderProject gproject = info.GuiBuilderProject; Document doc = IdeApp.Workbench.GetDocument(pf.FilePath); if (doc != null) { gproject.ReloadFile(pf.FilePath); GuiBuilderView view = doc.ActiveView as GuiBuilderView; if (view != null) { view.ReloadDesigner(project); } } }
public override async void ActivateItem() { GuiBuilderWindow w = (GuiBuilderWindow)CurrentNode.DataItem; if (w.SourceCodeFile == FilePath.Null && !w.BindToClass()) { return; } Document doc = await IdeApp.Workbench.OpenDocument(w.SourceCodeFile, true); if (doc != null) { GuiBuilderView view = doc.GetContent <GuiBuilderView> (); if (view != null) { view.ShowDesignerView(); } } }