Пример #1
0
        /// <summary>
        /// Constructs the object with all of the environments primary controls.
        /// </summary>
        /// <param name="qSetExplorer">Primary QSetExplorer.</param>
        /// <param name="qSetMonitor">Primary QSetMonitor.</param>
        /// <param name="propertyGrid">Primary property grid.</param>
        /// <param name="messageViewer">Primary MessageViewer.</param>
        /// <param name="documentContainer">Primary DocumentContainer.</param>
        /// <param name="images">Images component.</param>
        public PrimaryControls(
            Licensing.License license,
            DockPanel dockPanel,
            Images images)
        {
            _qSetExplorerForm  = new QueueSetExplorerForm();
            _qSetMonitorForm   = new QueueSetMonitorForm();
            _propertyGridForm  = new PropertyGridForm();
            _messageViewerForm = new MessageViewerForm(license);
            _dockPanel         = dockPanel;
            _images            = images;

            _messageBrowserCollection          = new MessageBrowserCollection();
            _webServiceClientControlCollection = new WebServiceClientControlCollection();

            _qSetExplorerForm.VisibleChanged  += QSetExplorerForm_VisibleChanged;
            _propertyGridForm.VisibleChanged  += PropertyGridForm_VisibleChanged;
            _messageViewerForm.VisibleChanged += MessageViewerForm_VisibleChanged;
            _qSetMonitorForm.VisibleChanged   += QSetMonitorForm_VisibleChanged;

            _qSetExplorerForm.QSetExplorer.ImageList = this.GetSize16Icons();
            _qSetMonitorForm.QSetMonitor.ImageList   = this.GetSize16Icons();

            ToggleQSetExplorerDisplay(true);
            TogglePropertiesGridDisplay(true);
            ToggleMessageViewerDisplay(true);
            ToggleMonitorDisplay(true);
        }
Пример #2
0
        /// <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();
        }
Пример #3
0
		/// <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();
		}
Пример #4
0
        private void Initialize(Licensing.License license, QueueTaskManager queueTaskManager, QSetQueueItem initialRecipient, System.Messaging.Message[] messages, QSetQueueItem sourceQueueItem)
        {
            _license = license;

            InitializeComponent();

            if (messages != null && messages.Length > 0)
            {
                _mode = Mode.ExistingMessage;
            }
            else
            {
                _mode = Mode.NewMessage;
            }

            _queueTaskManager = queueTaskManager;
            _sourceQueueItem  = sourceQueueItem;

            base.Closing += new CancelEventHandler(NewMessageForm_Closing);
            numberOfCopiesComboBoxItem.ToolTipText            = "Select the number of copies to send to each recipient queue.";
            numberOfCopiesComboBoxItem.ComboBox.SelectedIndex = 0;
            numberOfCopiesComboBoxItem.ComboBox.KeyPress     += new KeyPressEventHandler(ComboBox_KeyPress);
            numberOfCopiesComboBoxItem.ComboBox.MaxLength     = 4;

            _messageViewer = new MessageViewer {
                License = license
            };
            _messageViewer.Dock = DockStyle.Fill;
            _messageViewerHostPanel.Controls.Add(_messageViewer);

            recipientsListView.Items.Clear();
            messagesListView.Items.Clear();

            if (_mode == Mode.NewMessage)
            {
                FormatterComboItem[] formatterItems = new FormatterComboItem[3];
                formatterItems[0] = new FormatterComboItem(_FORMATTER_ACTIVEX, MessageFormatterType.ActiveX);
                formatterItems[1] = new FormatterComboItem(_FORMATTER_BINARY, MessageFormatterType.Binary);
                formatterItems[2] = new FormatterComboItem(_FORMATTER_XML, MessageFormatterType.Xml);
                formatterComboBoxItem.ComboBox.DisplayMember = "Name";
                formatterComboBoxItem.ComboBox.ValueMember   = "FormatterType";
                formatterComboBoxItem.ComboBox.DataSource    = formatterItems;
                formatterComboBoxItem.ComboBox.SelectedIndex = 2;
                formatterComboBoxItem.ComboBox.DropDownStyle = ComboBoxStyle.DropDownList;

                foreach (ToolStripItem item in optionsPriorityMenuItem.DropDownItems)
                {
                    var menuItem = item as ToolStripMenuItem;
                    if (menuItem != null)
                    {
                        menuItem.Checked = false;
                    }
                }
                priorityNormalMenuItem.Checked = true;

                ConfigureMessagePriorityMenuItems();
                SelectMessagePriorityMenuItem(System.Messaging.MessagePriority.Normal);
            }
            else
            {
                if (messages.Length == 1)
                {
                    existingMessagesLabel.Text = "Message:";
                }
                else
                {
                    existingMessagesLabel.Text = "Messages:";
                }

                foreach (System.Messaging.Message message in messages)
                {
                    ListViewItem item = new ListViewItem(message.Label, (int)Resources.Images.IconType.Message);
                    item.Tag = message;
                    messagesListView.Items.Add(item);
                }

                messagesListView.Items[0].Selected = true;
            }

            //TODO when multiple messages are supplied leave all the options blank so that the existing message properties take effect
            //		but let the options be selectable so they can be overridde.  When a single message is passed into the form all
            //		of the options can be defaulted to that messages options
            sendAndKeepOpenButtonItem.Visible = _mode == Mode.NewMessage;
            formatterComboBoxItem.Visible     = _mode == Mode.NewMessage;
            optionsDropDownMenuItem.Visible   = _mode == Mode.NewMessage;
            labelLabel.Visible           = _mode == Mode.NewMessage;
            labelTextBox.Visible         = _mode == Mode.NewMessage;
            newMessagePanel.Visible      = _mode == Mode.NewMessage;
            existingMessagePanel.Visible = _mode == Mode.ExistingMessage;

            ConfigureControls();

            SetupToolTips();

            if (initialRecipient != null)
            {
                AddQueueItemToRecipientsList(initialRecipient);
            }
        }
Пример #5
0
 public NewMessageForm(Licensing.License license, QueueTaskManager queueTaskManager, QSetQueueItem initialRecipient)
 {
     Initialize(license, queueTaskManager, initialRecipient, null, null);
 }
Пример #6
0
 public NewMessageForm(Licensing.License license, QueueTaskManager queueTaskManager, System.Messaging.Message[] messages, QSetQueueItem sourceQueueItem)
 {
     Initialize(license, queueTaskManager, null, messages, sourceQueueItem);
 }
Пример #7
0
 public NewMessageForm(Licensing.License license, QueueTaskManager queueTaskManager)
 {
     Initialize(license, queueTaskManager, null, null, null);
 }
Пример #8
0
		private void Initialize(Licensing.License license, QueueTaskManager queueTaskManager, QSetQueueItem initialRecipient, System.Messaging.Message[] messages, QSetQueueItem sourceQueueItem)
		{		
			_license = license;

			InitializeComponent();

			if (messages != null && messages.Length > 0)
				_mode = Mode.ExistingMessage;
			else
				_mode = Mode.NewMessage;

			_queueTaskManager = queueTaskManager;
			_sourceQueueItem = sourceQueueItem;
			
			base.Closing += new CancelEventHandler(NewMessageForm_Closing);
			numberOfCopiesComboBoxItem.ToolTipText = "Select the number of copies to send to each recipient queue.";
			numberOfCopiesComboBoxItem.ComboBox.SelectedIndex = 0;
			numberOfCopiesComboBoxItem.ComboBox.KeyPress += new KeyPressEventHandler(ComboBox_KeyPress);
			numberOfCopiesComboBoxItem.ComboBox.MaxLength = 4;

			_messageViewer = new MessageViewer(license);
			_messageViewer.Dock = DockStyle.Fill;
			_messageViewerHostPanel.Controls.Add(_messageViewer);

			recipientsListView.Items.Clear();
			messagesListView.Items.Clear();

			if (_mode == Mode.NewMessage)
			{
				FormatterComboItem[] formatterItems = new FormatterComboItem[3]; 
				formatterItems[0] = new FormatterComboItem(_FORMATTER_ACTIVEX, MessageFormatterType.ActiveX);
				formatterItems[1] = new FormatterComboItem(_FORMATTER_BINARY, MessageFormatterType.Binary);
				formatterItems[2] = new FormatterComboItem(_FORMATTER_XML, MessageFormatterType.Xml);
				formatterComboBoxItem.ComboBox.DisplayMember = "Name";
				formatterComboBoxItem.ComboBox.ValueMember = "FormatterType";
				formatterComboBoxItem.ComboBox.DataSource = formatterItems;			
				formatterComboBoxItem.ComboBox.SelectedIndex = 2;
				formatterComboBoxItem.ComboBox.DropDownStyle = ComboBoxStyle.DropDownList;

				foreach (MenuItemBase item in optionsPriorityMenuItem.Items)
					item.Checked = false;
				priorityNormalMenuItem.Checked = true;

				ConfigureMessagePriorityMenuItems();
				SelectMessagePriorityMenuItem(System.Messaging.MessagePriority.Normal);
			}
			else
			{
				if (messages.Length == 1)
					existingMessagesLabel.Text = "Message:";
				else
					existingMessagesLabel.Text = "Messages:";

				foreach (System.Messaging.Message message in messages)
				{
					ListViewItem item = new ListViewItem(message.Label, (int)Resources.Images.IconType.Message);
					item.Tag = message;
					messagesListView.Items.Add(item);
				}
				
				messagesListView.Items[0].Selected = true;				
			}

			//TODO when multiple messages are supplied leave all the options blank so that the existing message properties take effect
			//		but let the options be selectable so they can be overridde.  When a single message is passed into the form all
			//		of the options can be defaulted to that messages options
			sendAndKeepOpenButtonItem.Visible = _mode == Mode.NewMessage;
			formatterComboBoxItem.Visible = _mode == Mode.NewMessage;
			optionsDropDownMenuItem.Visible = _mode == Mode.NewMessage;
			labelLabel.Visible = _mode == Mode.NewMessage;
			labelTextBox.Visible =  _mode == Mode.NewMessage;			
			newMessagePanel.Visible = _mode == Mode.NewMessage;
			existingMessagePanel.Visible = _mode == Mode.ExistingMessage;

			ConfigureControls();

			SetupToolTips();

			if (initialRecipient != null)
				AddQueueItemToRecipientsList(initialRecipient);
		}