/// <summary> /// Configures the environment ready for use. /// </summary> private void ConfigureEnvironment() { SetupMenuItemBag(); Licensing.License license = new Licensing.License(); PrimaryMenus primaryMenus = new PrimaryMenus( MenuItemBag.FileMenu, MenuItemBag.ViewMenu, MenuItemBag.QSetMenu, MenuItemBag.QueueMenu, MenuItemBag.MessageMenu, MenuItemBag.ToolsMenu, MenuItemBag.HelpMenu, MenuItemBag.MessageBrowserCtxMenu, MenuItemBag.QSetCtxMenu); PrimaryControls primaryControls = new PrimaryControls( license, this.dockPanel, new Images()); PrimaryForms primaryForms = new PrimaryForms(this, new QueueSearchForm()); UserSettings userSettings = UserSettings.Create(); PrimaryObjects primaryObjects = new PrimaryObjects(new ProcessVisualizer(this), userSettings, license); primaryObjects.ProcessVisualizer.StatusBarPanel = this.workingStatusBarPanel; _environmentCoordinator = new EnvironmentCoordinator(primaryMenus, primaryControls, primaryForms, primaryObjects); _environmentCoordinator.SetUp(); }
public void AddTabbedDocumentMessageBrowser(QSetQueueItem qsetQueueItem, PrimaryObjects primaryObjects) { var messageForm = new MessageBrowserForm(); messageForm.MessageBrowser.UserSettings = primaryObjects.UserSettings; messageForm.MessageBrowser.ImageList = this.GetSize16Icons(); //messageForm.MessageBrowser.MaxRowShow =this.m try { messageForm.Show(_dockPanel, DockState.Document); messageForm.MessageBrowser.QSetQueueItem = qsetQueueItem; MessageBrowserCollection.Add(qsetQueueItem.ID.ToString(), messageForm.MessageBrowser); if (_wireupActionForTabbedDocuments != null) { _wireupActionForTabbedDocuments(messageForm); } messageForm.FormClosed += MessageForm_FormClosed; } catch (Exception exc) { primaryObjects.ProcessVisualizer.SeizeCursor(Cursors.Arrow); MessageBox.Show(exc.Message, Locale.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Warning); primaryObjects.ProcessVisualizer.ReleaseCursor(); messageForm.Close(); } }
/// <summary> /// Constructs the listener. /// </summary> /// <param name="taskManager">Task manager.</param> /// <param name="primaryObjects">Environments PrimaryObjects object.</param> /// <param name="primaryForms">Environments PrimaryForms object.</param> /// <param name="primaryControls">Environments PrimaryControls object.</param> /// <param name="primaryMenus">Environments PrimaryMenus object.</param> public PrimaryMenuListener ( TaskManager taskManager, PrimaryObjects primaryObjects, PrimaryForms primaryForms, PrimaryControls primaryControls, PrimaryMenus primaryMenus ) : base(taskManager, primaryObjects, primaryForms, primaryControls, primaryMenus) { //wire up all event handlers foreach (ToolStripItem item in base.PrimaryMenus.FileMenu.DropDownItems) { var menuItem = item as ToolStripMenuItem; if (menuItem != null && menuItem != MenuItemBag.FileRecentFileList) { menuItem.Click += FileMenuItem_Activate; } } WireUpMenuEvent(base.PrimaryMenus.ViewMenu.DropDownItems, ViewMenuItem_Activate); WireUpMenuEvent(base.PrimaryMenus.QSetMenu.DropDownItems, QSetMenuItem_Activate); WireUpMenuEvent(base.PrimaryMenus.QueueMenu.DropDownItems, QueueMenuItem_Activate); WireUpMenuEvent(base.PrimaryMenus.MessageMenu.DropDownItems, MessageMenuItem_Activate); WireUpMenuEvent(base.PrimaryMenus.ToolsMenu.DropDownItems, ToolsMenuItem_Activate); WireUpMenuEvent(base.PrimaryMenus.HelpMenu.DropDownItems, HelpMenuItem_Activate); WireUpMenuEvent(base.PrimaryMenus.MessageBrowserContextMenu.Items, MessageBrowserContextMenuItem_Activate); WireUpMenuEvent(base.PrimaryMenus.QSetContextMenu.Items, QSetContextMenuItem_Activate); base.PrimaryMenus.RecentFileListChanged += PrimaryMenus_RecentFileListChanged; }
/// <summary> /// Constructs QueueTaskManager. /// </summary> public QueueTaskManager( TaskManager taskManager, PrimaryControls primaryControls, PrimaryObjects primaryObjects, PrimaryForms primaryForms) { _taskManager = taskManager; _primaryObjects = primaryObjects; _primaryControls = primaryControls; _primaryForms = primaryForms; }
/// <summary> /// Constructs the WebTaskManager. /// </summary> public WebTaskManager( TaskManager taskManager, PrimaryControls primaryControls, PrimaryObjects primaryObjects, PrimaryForms primaryForms) { _taskManager = taskManager; _primaryObjects = primaryObjects; _primaryControls = primaryControls; _primaryForms = primaryForms; }
/// <summary> /// Constructs the listener. /// </summary> /// <param name="taskManager">Task manager.</param> /// <param name="primaryObjects">Environments PrimaryObjects object.</param> /// <param name="primaryForms">Environments PrimaryForms object.</param> /// <param name="primaryControls">Environments PrimaryControls object.</param> /// <param name="primaryMenus">Environments PrimaryMenus object.</param> public PrimaryFormsListener ( TaskManager taskManager, PrimaryObjects primaryObjects, PrimaryForms primaryForms, PrimaryControls primaryControls, PrimaryMenus primaryMenus ) : base(taskManager, primaryObjects, primaryForms, primaryControls, primaryMenus) { base.PrimaryForms.QueueSearchForm.OKClicked += new QueueSearchForm.OKClickedEvent(QueueSearchForm_OKClicked); base.PrimaryForms.EnvironmentForm.Load += new EventHandler(EnvironmentForm_Load); }
/// <summary> /// Constructs the object with the minumum requirements. /// </summary> /// <param name="primaryControls"></param> /// <param name="taskManager"></param> /// <param name="primaryObjects"></param> /// <param name="primaryForms"></param> /// <param name="primaryMenus"></param> protected PrimaryControlListenerBase ( TaskManager taskManager, PrimaryObjects primaryObjects, PrimaryForms primaryForms, PrimaryControls primaryControls, PrimaryMenus primaryMenus ) { _taskManager = taskManager; _primaryObjects = primaryObjects; _primaryForms = primaryForms; _primaryControls = primaryControls; _primaryMenus = primaryMenus; }
/// <summary> /// Constructs the object with the minum requirements. /// </summary> /// <param name="primaryMenus">Primary menus.</param> /// <param name="primaryControls">Primary controls.</param> /// <param name="primaryForms">Primary forms.</param> /// <param name="primaryObjects">Primary objects.</param> public TaskManager( PrimaryMenus primaryMenus, PrimaryControls primaryControls, PrimaryForms primaryForms, PrimaryObjects primaryObjects) { _primaryMenus = primaryMenus; _primaryControls = primaryControls; _primaryForms = primaryForms; _primaryObjects = primaryObjects; _menuStateManager = new MenuStateManager(_primaryControls); _queueTaskManager = new QueueTaskManager(this, _primaryControls, _primaryObjects, _primaryForms); _webTaskManager = new WebTaskManager(this, _primaryControls, _primaryObjects, _primaryForms); }
/// <summary> /// Constructs the coordinator. /// </summary> /// <param name="qSetEnvironmentForm">Environment form.</param> /// <param name="primaryControls">Primary controls.</param> /// <param name="primaryMenus">Primary menus.</param> /// <param name="primaryForms">Primary forms.</param> /// <param name="primaryObjects">Primary objects.</param> public EnvironmentCoordinator( PrimaryMenus primaryMenus, PrimaryControls primaryControls, PrimaryForms primaryForms, PrimaryObjects primaryObjects) { _primaryForms = primaryForms; _primaryObjects = primaryObjects; _primaryControls = primaryControls; _taskManager = new TaskManager(primaryMenus, primaryControls, primaryForms, primaryObjects); _primaryMenuListener = new PrimaryMenuListener(_taskManager, _primaryObjects, _primaryForms, _primaryControls, primaryMenus); _primaryControlListener = new PrimaryControlListener(_taskManager, _primaryObjects, _primaryForms, _primaryControls, primaryMenus); _primaryFormListener = new PrimaryFormsListener(_taskManager, _primaryObjects, _primaryForms, _primaryControls, primaryMenus); }
/// <summary> /// Constructs the coordinator. /// </summary> /// <param name="qSetEnvironmentForm">Environment form.</param> /// <param name="primaryControls">Primary controls.</param> /// <param name="primaryMenus">Primary menus.</param> /// <param name="primaryForms">Primary forms.</param> /// <param name="primaryObjects">Primary objects.</param> public EnvironmentCoordinator( QSetEnvironmentForm qSetEnvironmentForm, PrimaryMenus primaryMenus, PrimaryControls primaryControls, PrimaryForms primaryForms, PrimaryObjects primaryObjects) { _primaryForms = primaryForms; _primaryObjects = primaryObjects; _primaryControls = primaryControls; _taskManager = new TaskManager(primaryMenus, primaryControls, primaryForms, primaryObjects); _primaryMenuListener = new PrimaryMenuListener(_taskManager, _primaryObjects, _primaryForms, _primaryControls, primaryMenus); _primaryControlListener = new PrimaryControlListener(_taskManager, _primaryObjects, _primaryForms, _primaryControls, primaryMenus); _primaryFormListener = new PrimaryFormsListener(_taskManager, _primaryObjects, _primaryForms, _primaryControls, primaryMenus); }
/// <summary> /// Constructs the object with the minum requirements. /// </summary> /// <param name="primaryMenus">Primary menus.</param> /// <param name="primaryControls">Primary controls.</param> /// <param name="primaryForms">Primary forms.</param> /// <param name="primaryObjects">Primary objects.</param> public TaskManager( PrimaryMenus primaryMenus, PrimaryControls primaryControls, PrimaryForms primaryForms, PrimaryObjects primaryObjects) { _primaryMenus = primaryMenus; _primaryControls = primaryControls; _primaryForms = primaryForms; _primaryObjects = primaryObjects; _menuStateManager = new MenuStateManager(_primaryControls); _queueTaskManager = new QueueTaskManager(this, _primaryControls, _primaryObjects, _primaryForms); _webTaskManager = new WebTaskManager(this, _primaryControls, _primaryObjects, _primaryForms); primaryControls.QSetExplorer.ImageList = primaryControls.Images.Icon16ImageList; primaryControls.QSetMonitor.ImageList = primaryControls.Images.Icon16ImageList; }
/// <summary> /// Constructs the listener. /// </summary> /// <param name="taskManager">Task manager.</param> /// <param name="primaryObjects">Environments PrimaryObjects object.</param> /// <param name="primaryForms">Environments PrimaryForms object.</param> /// <param name="primaryControls">Environments PrimaryControls object.</param> /// <param name="primaryMenus">Environments PrimaryMenus object.</param> public PrimaryControlListener ( TaskManager taskManager, PrimaryObjects primaryObjects, PrimaryForms primaryForms, PrimaryControls primaryControls, PrimaryMenus primaryMenus ) : base(taskManager, primaryObjects, primaryForms, primaryControls, primaryMenus) { //wire up all event handlers base.PrimaryControls.QSetExplorer.QSetItemDoubleClick += new QSetItemDoubleClickEvent(QSetExplorer_QSetItemDoubleClick); base.PrimaryControls.QSetExplorer.QSetActivated += new QSetActivatedEvent(QSetExplorer_QSetActivated); base.PrimaryControls.QSetExplorer.QSetDeactivated += new QSetDeactivatedEvent(QSetExplorer_QSetDeactivated); base.PrimaryControls.QSetExplorer.BeforeQSetItemActivated += new VisualizableProcessItemAffectedEvent(QSetExplorer_BeforeQSetItemActivated); base.PrimaryControls.QSetExplorer.AfterQSetItemActivated += new VisualizableProcessItemAffectedEvent(QSetExplorer_AfterQSetItemActivated); base.PrimaryControls.QSetExplorer.MessagesDragDrop += new MessagesDragDropEvent(QSetExplorer_MessagesDragDrop); base.PrimaryControls.DocumentContainer.Manager.ActiveTabbedDocumentChanged += DocumentContainer_ActiveDocumentChanged; //TODO JW handle close //base.PrimaryControls.DocumentContainer.DocumentClosing += new TD.SandDock.DocumentClosingEventHandler(DocumentContainer_DocumentClosing); base.PrimaryControls.DocumentContainer.MouseDown += new MouseEventHandler(DocumentContainer_MouseDown); base.PrimaryControls.MessageBrowserCollection.ItemAdded += new MessageBrowserCollection.ItemAddedEvent(MessageBrowserCollection_ItemAdded); base.PrimaryControls.MessageBrowserCollection.ItemRemoved += new MessageBrowserCollection.ItemRemovedEvent(MessageBrowserCollection_ItemRemoved); base.PrimaryControls.WebServiceClientControlCollection.ItemAdded += new WebServiceClientControlCollection.ItemAddedEvent(WebServiceClientControlCollection_ItemAdded); base.PrimaryControls.WebServiceClientControlCollection.ItemRemoved += new WebServiceClientControlCollection.ItemRemovedEvent(WebServiceClientControlCollection_ItemRemoved); base.PrimaryControls.PropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(PropertyGrid_PropertyValueChanged); ((DockControl)base.PrimaryControls.QSetExplorer.Parent).Closed += new EventHandler(DockControl_Closed); ((DockControl)base.PrimaryControls.PropertyGrid.Parent).Closed += new EventHandler(DockControl_Closed); ((DockControl)base.PrimaryControls.MessageViewer.Parent).Closed += new EventHandler(DockControl_Closed); ((DockControl)base.PrimaryControls.QSetMonitor.Parent).Closed += new EventHandler(DockControl_Closed); }
/// <summary> /// Constructs the listener. /// </summary> /// <param name="taskManager">Task manager.</param> /// <param name="primaryObjects">Environments PrimaryObjects object.</param> /// <param name="primaryForms">Environments PrimaryForms object.</param> /// <param name="primaryControls">Environments PrimaryControls object.</param> /// <param name="primaryMenus">Environments PrimaryMenus object.</param> public PrimaryMenuListener ( TaskManager taskManager, PrimaryObjects primaryObjects, PrimaryForms primaryForms, PrimaryControls primaryControls, PrimaryMenus primaryMenus ) : base(taskManager, primaryObjects, primaryForms, primaryControls, primaryMenus) { //wire up all event handlers foreach (MenuItemBase menuItem in base.PrimaryMenus.FileMenu.Items) if (menuItem != MenuItemBag.FileRecentFileList) menuItem.Activate += new EventHandler(FileMenuItem_Activate); foreach (MenuItemBase menuItem in base.PrimaryMenus.ViewMenu.Items) menuItem.Activate += new EventHandler(ViewMenuItem_Activate); foreach (MenuItemBase menuItem in base.PrimaryMenus.QSetMenu.Items) menuItem.Activate += new EventHandler(QSetMenuItem_Activate); foreach (MenuItemBase menuItem in base.PrimaryMenus.QueueMenu.Items) menuItem.Activate += new EventHandler(QueueMenuItem_Activate); foreach (MenuItemBase menuItem in base.PrimaryMenus.MessageMenu.Items) menuItem.Activate += new EventHandler(MessageMenuItem_Activate); foreach (MenuItemBase menuItem in base.PrimaryMenus.ToolsMenu.Items) menuItem.Activate += new EventHandler(ToolsMenuItem_Activate); foreach (MenuItemBase menuItem in base.PrimaryMenus.HelpMenu.Items) menuItem.Activate += new EventHandler(HelpMenuItem_Activate); foreach (MenuItemBase menuItem in base.PrimaryMenus.MessageBrowserContextMenu.Items) menuItem.Activate += new EventHandler(MessageBrowserContextMenuItem_Activate); foreach (MenuItemBase menuItem in base.PrimaryMenus.QSetContextMenu.Items) menuItem.Activate += new EventHandler(QSetContextMenuItem_Activate); base.PrimaryMenus.RecentFileListChanged += new Mulholland.QSet.Application.PrimaryMenus.MenuItemsChangedEvent(PrimaryMenus_RecentFileListChanged); }
/// <summary> /// Constructs the listener. /// </summary> /// <param name="taskManager">Task manager.</param> /// <param name="primaryObjects">Environments PrimaryObjects object.</param> /// <param name="primaryForms">Environments PrimaryForms object.</param> /// <param name="primaryControls">Environments PrimaryControls object.</param> /// <param name="primaryMenus">Environments PrimaryMenus object.</param> public PrimaryControlListener ( TaskManager taskManager, PrimaryObjects primaryObjects, PrimaryForms primaryForms, PrimaryControls primaryControls, PrimaryMenus primaryMenus ) : base(taskManager, primaryObjects, primaryForms, primaryControls, primaryMenus) { base.PrimaryControls.WireupQSetExplorer(qse => { qse.QSetItemDoubleClick += QSetExplorer_QSetItemDoubleClick; qse.QSetActivated += QSetExplorer_QSetActivated; qse.QSetDeactivated += QSetExplorer_QSetDeactivated; qse.BeforeQSetItemActivated += QSetExplorer_BeforeQSetItemActivated; qse.AfterQSetItemActivated += QSetExplorer_AfterQSetItemActivated; qse.MessagesDragDrop += QSetExplorer_MessagesDragDrop; }); base.PrimaryControls.WireupDockPanel(dp => { dp.ActiveDocumentChanged += DocumentContainer_ActiveDocumentChanged; dp.MouseDown += DocumentContainer_MouseDown; }); base.PrimaryControls.WireupNewTabbedDocuments( doc => { var messageBrowser = doc as MessageBrowserForm; if (messageBrowser != null) { messageBrowser.MessageBrowser.MouseDown += DocumentContainer_MouseDown; } }, doc => { var messageBrowser = doc as MessageBrowserForm; if (messageBrowser != null) { messageBrowser.MessageBrowser.MouseDown -= DocumentContainer_MouseDown; } }); base.PrimaryControls.MessageBrowserCollection.ItemAdded += MessageBrowserCollection_ItemAdded; base.PrimaryControls.MessageBrowserCollection.ItemRemoved += MessageBrowserCollection_ItemRemoved; base.PrimaryControls.WebServiceClientControlCollection.ItemAdded += WebServiceClientControlCollection_ItemAdded; base.PrimaryControls.WebServiceClientControlCollection.ItemRemoved += WebServiceClientControlCollection_ItemRemoved; base.PrimaryControls.WireupPropertyGrid(grid => { // This is a fix for an issue with the grid where the property dissappeared after being edited in the grid. // There is nothing wrong with any code, but this solves the issue, causing the grid to refresh itself. grid.PropertyValueChanged += (s, e) => grid.SelectedGridItem = grid.SelectedGridItem; }); base.PrimaryControls.QSetExplorerClosed += (s, e) => base.TaskManager.ToggleQSetExplorer(false); base.PrimaryControls.PropertyGridClosed += (s, e) => base.TaskManager.TogglePropertiesWindow(false); base.PrimaryControls.MessageViewerClosed += (s, e) => base.TaskManager.ToggleMessageViewer(false); base.PrimaryControls.QSetMonitorClosed += (s, e) => base.TaskManager.ToggleQSetMonitor(false); }
/// <summary> /// Configures the environment ready for use. /// </summary> private void ConfigureEnvironment() { SetupMenuItemBag(); Licensing.License license = new Licensing.License(); queueSetExplorer = new Mulholland.QSet.Application.Controls.QSetExplorer(); queueSetExplorer.Dock = DockStyle.Fill; qSetExplorerDock.Controls.Add(queueSetExplorer); defaultMessageViewer = new Mulholland.QSet.Application.Controls.MessageViewer(license); defaultMessageViewer.Dock = DockStyle.Fill; messageViewerDock.Controls.Add(defaultMessageViewer); qSetMonitor = new Mulholland.QSet.Application.Controls.QSetMonitor(); qSetMonitor .Dock = DockStyle.Fill; qSetMonitorDockControl.Controls.Add(qSetMonitor); PrimaryMenus primaryMenus = new PrimaryMenus( MenuItemBag.FileMenu, MenuItemBag.ViewMenu, MenuItemBag.QSetMenu, MenuItemBag.QueueMenu, MenuItemBag.MessageMenu, MenuItemBag.ToolsMenu, MenuItemBag.HelpMenu, MenuItemBag.MessageBrowserCtxMenu, MenuItemBag.QSetCtxMenu); mainDocumentContainer.Manager = new TD.SandDock.SandDockManager(); PrimaryControls primaryControls = new PrimaryControls( queueSetExplorer, qSetMonitor, propertyGrid, defaultMessageViewer, mainDocumentContainer, new Images()); PrimaryForms primaryForms = new PrimaryForms(this, new QueueSearchForm()); UserSettings userSettings = UserSettings.Create(); PrimaryObjects primaryObjects = new PrimaryObjects(new ProcessVisualizer(this), userSettings, license); primaryObjects.ProcessVisualizer.StatusBarPanel = this.workingStatusBarPanel; _environmentCoordinator = new EnvironmentCoordinator(this, primaryMenus, primaryControls, primaryForms, primaryObjects); _environmentCoordinator.SetUp(); }