internal PluginManager( ToolStripMenuItem toolmenu, ToolStrip tootoolbar, TD.SandDock.TabControl dc, LoadedPackage lp, SteepValley.Windows.Forms.ThemedControls.XPTaskBox defaultactiontaskbox, ContextMenuStrip defaultactionmenu, SteepValley.Windows.Forms.ThemedControls.XPTaskBox toolactiontaskbox, SteepValley.Windows.Forms.ThemedControls.XPTaskBox extactiontaskbox, ToolStrip actiontoolbar, Ambertation.Windows.Forms.DockContainer docktooldc, ToolStripMenuItem helpmenu, SimPe.Windows.Forms.ResourceListViewExt lv ) : base(true) { Splash.Screen.SetMessage("Loading Type Registry"); SimPe.PackedFiles.TypeRegistry tr = new SimPe.PackedFiles.TypeRegistry(); FileTable.ProviderRegistry = tr; FileTable.ToolRegistry = tr; FileTable.WrapperRegistry = tr; FileTable.CommandLineRegistry = tr; FileTable.HelpTopicRegistry = tr; FileTable.SettingsRegistry = tr; wloader = new LoadFileWrappersExt(); this.LoadDynamicWrappers(); this.LoadStaticWrappers(); this.LoadMenuItems(toolmenu, tootoolbar); Splash.Screen.SetMessage("Loading Listeners"); wloader.AddListeners(ref ChangedGuiResourceEvent); //dc.ActiveDocumentChanged += new TD.SandDock.ActiveDocumentEventHandler(wloader.ActiveDocumentChanged); //lp.AfterFileLoad += new SimPe.Events.PackageFileLoadedEvent(wloader.ChangedPackage); Splash.Screen.SetMessage("Loading Default Actions"); LoadActionTools(defaultactiontaskbox, actiontoolbar, defaultactionmenu, GetDefaultActions(lv)); Splash.Screen.SetMessage("Loading External Tools"); LoadActionTools(toolactiontaskbox, actiontoolbar, defaultactionmenu, LoadExternalTools()); Splash.Screen.SetMessage("Loading Default Tools"); LoadActionTools(extactiontaskbox, actiontoolbar, null, null); Splash.Screen.SetMessage("Loading Docks"); LoadDocks(docktooldc, lp); Splash.Screen.SetMessage("Loading Help Topics"); lht = new LoadHelpTopics(helpmenu); Splash.Screen.SetMessage("Loaded Help Topics"); }
/// <summary> /// Load all available Action Tools /// </summary> void LoadActionTools( SteepValley.Windows.Forms.ThemedControls.XPTaskBox taskbox, ToolStrip tb, ContextMenuStrip mi, SimPe.Interfaces.IToolAction[] tools) { if (tools == null) { tools = FileTable.ToolRegistry.Actions; } int top = 4 + taskbox.DockPadding.Top; if (taskbox.Tag != null) { top = (int)taskbox.Tag; } bool tfirst = true; bool mfirst = true; foreach (SimPe.Interfaces.IToolAction tool in tools) { ActionToolDescriptor atd = new ActionToolDescriptor(tool); ChangedGuiResourceEvent += new SimPe.Events.ChangedResourceEvent(atd.ChangeEnabledStateEventHandler); if (taskbox != null) { atd.LinkLabel.Top = top; atd.LinkLabel.Left = 12; top += atd.LinkLabel.Height; atd.LinkLabel.Parent = taskbox; atd.LinkLabel.Visible = taskbox.IsExpanded; atd.LinkLabel.AutoSize = true; } if (mi != null) { bool beggrp = (mfirst && mi.Items.Count != 0); if (beggrp) { mi.Items.Add("-"); } mi.Items.Add(atd.MenuButton); mfirst = false; } if (tb != null && atd.ToolBarButton != null) { ////RECHECK //atd.ToolBarButton.BeginGroup = (tfirst && tb.Items.Count!=0); if (tfirst && tb.Items.Count != 0) { tb.Items.Add(new ToolStripSeparator()); } tb.Items.Add(atd.ToolBarButton); tfirst = false; } } taskbox.Height = top + 4; taskbox.Tag = top; }