コード例 #1
0
ファイル: TaskManager.cs プロジェクト: modulexcite/QSet
		/// <summary>
		/// Loads anew MessageBrowser, and displays in the main document window.
		/// </summary>
		/// <param name="qsetQueueItem">QSetQueueItem to display.</param>
		/// <returns>The added DockControl hosting the MessageBrowser if successful, else false.</returns>
		private DockControl LoadNewMessageBrowser(QSetQueueItem qsetQueueItem)
		{									
			DockControl newDockControl = null;

			//set up a new message browser, and create adock for it
			MessageBrowser messageBrowser = new MessageBrowser();
			messageBrowser.UserSettings = _primaryObjects.UserSettings;
			_primaryControls.MessageBrowserCollection.Add(qsetQueueItem.ID.ToString(), messageBrowser);
            newDockControl = new TabbedDocument(_primaryControls.DocumentContainer.Manager, messageBrowser, qsetQueueItem.Name);
            newDockControl.Open();		
			messageBrowser.ImageList = _primaryControls.Images.Icon16ImageList;
			
			//pass the qsetitem to the message browser to load the queue
			try
			{
				messageBrowser.QSetQueueItem = qsetQueueItem;
				newDockControl.Activate();
			}
			catch (Exception exc)
			{
				_primaryObjects.ProcessVisualizer.SeizeCursor(Cursors.Arrow);
				MessageBox.Show(exc.Message, Locale.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
				_primaryObjects.ProcessVisualizer.ReleaseCursor();
				newDockControl.Close();
				newDockControl = null;
			}
					
			return newDockControl;
		}