public GuiBuilderView(IViewContent content, GuiBuilderWindow window) : base(content) { rootName = window.Name; designerPage = new DesignerPage(); designerPage.Show(); AddButton(GettextCatalog.GetString("Designer"), designerPage); actionsPage = new ActionGroupPage(); actionsPage.Show(); AttachWindow(window); }
public GuiBuilderView (IViewContent content, GuiBuilderWindow window): base (content) { rootName = window.Name; designerPage = new DesignerPage (window.Project); designerPage.Show (); AddButton (GettextCatalog.GetString ("Designer"), designerPage); actionsPage = new ActionGroupPage (); actionsPage.Show (); AttachWindow (window); }
protected override async Task <DocumentView> OnInitializeView() { designerPage = new DesignerPage(window.Project); actionsPage = new ActionGroupPage(); designerPage.Show(); actionsPage.Show(); var view = await base.OnInitializeView(); AddButton(GettextCatalog.GetString("Designer"), designerPage); AttachWindow(window); return(view); }
public IEnumerable <ItemToolboxNode> GetDynamicItems(IToolboxConsumer consumer) { DesignerPage view = consumer as DesignerPage; if (view == null) { return(null); } ComponentType[] types = view.GetComponentTypes(); if (types == null) { return(null); } Hashtable refs = new Hashtable(); Hashtable projects = new Hashtable(); string of = FileService.GetFullPath(view.Project.GetOutputFileName(IdeApp.Workspace.ActiveConfiguration)); projects [of] = view.Project.Name; foreach (ProjectReference pr in ((DotNetProject)view.Project).References) { foreach (string f in pr.GetReferencedFileNames(IdeApp.Workspace.ActiveConfiguration)) { if (pr.ReferenceType == ReferenceType.Project) { projects[FileService.GetFullPath(f)] = pr.Reference; } else { refs[FileService.GetFullPath(f)] = f; } } } List <ItemToolboxNode> list = new List <ItemToolboxNode> (); foreach (ComponentType type in types) { if (type.Category == "window") { continue; } string fullName = null; if (!String.IsNullOrEmpty(type.Library)) { fullName = FileService.GetFullPath(type.Library); } if (type.ClassName == "Gtk.Action" || (fullName != null && refs.Contains(fullName))) { ComponentToolboxNode node = new ComponentToolboxNode(type); list.Add(node); } else if (fullName != null && projects.Contains(fullName)) { ComponentToolboxNode node = new ComponentToolboxNode(type); node.Category = (string)projects [fullName]; list.Add(node); } } list.Sort(); return(list); }