mainform.cs

来自「SharpDevelop2.0.0 c#开发免费工具」· CS 代码 · 共 856 行 · 第 1/3 页

CS
856
字号
// *****************************************************************************
// 
//  Copyright 2003, Weifen Luo
//  All rights reserved. The software and associated documentation 
//  supplied hereunder are the proprietary information of Weifen Luo
//  and are supplied subject to licence terms.
// 
//  DockSample Application 1.0
// *****************************************************************************

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Reflection;
using System.Windows.Forms;
using System.Data;
using System.IO;
using WeifenLuo.WinFormsUI;

namespace DockSample
{
	/// <summary>
	/// Summary description for MainForm.
	/// </summary>
	public class MainForm : System.Windows.Forms.Form
	{
		private DeserializeDockContent m_deserializeDockContent;
		private DummySolutionExplorer m_solutionExplorer = new DummySolutionExplorer();
		private DummyPropertyWindow m_propertyWindow = new DummyPropertyWindow();
		private DummyToolbox m_toolbox = new DummyToolbox();
		private DummyOutputWindow m_outputWindow = new DummyOutputWindow();
		private DummyTaskList m_taskList = new DummyTaskList();
		private Options m_options = new Options();
		private System.Windows.Forms.MainMenu mainMenu;
		private System.Windows.Forms.MenuItem menuItem4;
		private System.Windows.Forms.MenuItem menuItemFile;
		private System.Windows.Forms.MenuItem menuItemExit;
		private System.Windows.Forms.MenuItem menuItemView;
		private System.Windows.Forms.MenuItem menuItemSolutionExplorer;
		private System.Windows.Forms.MenuItem menuItemPropertyWindow;
		private System.Windows.Forms.MenuItem menuItemOutputWindow;
		private System.Windows.Forms.MenuItem menuItemTaskList;
		private System.Windows.Forms.MenuItem menuItemToolbox;
		private System.Windows.Forms.MenuItem menuItemWindow;
		private System.Windows.Forms.MenuItem menuItemHelp;
		private System.Windows.Forms.MenuItem menuItemAbout;
		private System.Windows.Forms.MenuItem menuItemNew;
		private System.Windows.Forms.MenuItem menuItemOpen;
		private System.Windows.Forms.MenuItem menuItemClose;
		private System.Windows.Forms.MenuItem menuItemCloseAll;
		private System.Windows.Forms.MenuItem menuItemTools;
		private System.Windows.Forms.MenuItem menuItemOptions;
		private System.Windows.Forms.StatusBar statusBar;
		private System.Windows.Forms.ImageList imageList;
		private System.Windows.Forms.ToolBarButton toolBarButtonNew;
		private System.Windows.Forms.ToolBarButton toolBarButtonOpen;
		private System.Windows.Forms.ToolBarButton toolBarButtonSolutionExplorer;
		private System.Windows.Forms.ToolBarButton toolBarButtonPropertyWindow;
		private System.Windows.Forms.ToolBarButton toolBarButtonToolbox;
		private System.Windows.Forms.ToolBarButton toolBarButtonOutputWindow;
		private System.Windows.Forms.ToolBarButton toolBarButtonTaskList;
		private System.Windows.Forms.MenuItem menuItem1;
		private System.Windows.Forms.MenuItem menuItemToolBar;
		private System.Windows.Forms.MenuItem menuItemStatusBar;
		private System.Windows.Forms.ToolBar toolBar;
		private System.Windows.Forms.MenuItem menuItemNewWindow;
		private WeifenLuo.WinFormsUI.DockPanel dockPanel;
		private System.Windows.Forms.MenuItem menuItemLockLayout;
		private System.Windows.Forms.MenuItem menuItem2;
		private System.Windows.Forms.ToolBarButton toolBarButtonSeparator1;
		private System.Windows.Forms.ToolBarButton toolBarButtonSeparator2;
		private System.Windows.Forms.MenuItem menuItemLayoutByCode;
		private System.Windows.Forms.ToolBarButton toolBarButtonLayoutByCode;
		private System.Windows.Forms.MenuItem menuItemLayoutByXml;
		private System.Windows.Forms.ToolBarButton toolBarButtonLayoutByXml;
		private System.Windows.Forms.MenuItem menuItemSchemaDefault;
		private System.Windows.Forms.MenuItem menuItemSchemaOverride;
		private System.Windows.Forms.MenuItem menuItemSchemaFromBase;
		private System.Windows.Forms.MenuItem menuItem3;
		private System.Windows.Forms.MenuItem menuItem5;
		private System.ComponentModel.IContainer components;

		public MainForm()
		{
			m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MainForm));
			this.mainMenu = new System.Windows.Forms.MainMenu();
			this.menuItemFile = new System.Windows.Forms.MenuItem();
			this.menuItemNew = new System.Windows.Forms.MenuItem();
			this.menuItemOpen = new System.Windows.Forms.MenuItem();
			this.menuItemClose = new System.Windows.Forms.MenuItem();
			this.menuItemCloseAll = new System.Windows.Forms.MenuItem();
			this.menuItem4 = new System.Windows.Forms.MenuItem();
			this.menuItemExit = new System.Windows.Forms.MenuItem();
			this.menuItemView = new System.Windows.Forms.MenuItem();
			this.menuItemSolutionExplorer = new System.Windows.Forms.MenuItem();
			this.menuItemPropertyWindow = new System.Windows.Forms.MenuItem();
			this.menuItemToolbox = new System.Windows.Forms.MenuItem();
			this.menuItemOutputWindow = new System.Windows.Forms.MenuItem();
			this.menuItemTaskList = new System.Windows.Forms.MenuItem();
			this.menuItem1 = new System.Windows.Forms.MenuItem();
			this.menuItemToolBar = new System.Windows.Forms.MenuItem();
			this.menuItemStatusBar = new System.Windows.Forms.MenuItem();
			this.menuItem2 = new System.Windows.Forms.MenuItem();
			this.menuItemLayoutByCode = new System.Windows.Forms.MenuItem();
			this.menuItemLayoutByXml = new System.Windows.Forms.MenuItem();
			this.menuItemTools = new System.Windows.Forms.MenuItem();
			this.menuItemLockLayout = new System.Windows.Forms.MenuItem();
			this.menuItem3 = new System.Windows.Forms.MenuItem();
			this.menuItemSchemaDefault = new System.Windows.Forms.MenuItem();
			this.menuItemSchemaOverride = new System.Windows.Forms.MenuItem();
			this.menuItemSchemaFromBase = new System.Windows.Forms.MenuItem();
			this.menuItem5 = new System.Windows.Forms.MenuItem();
			this.menuItemOptions = new System.Windows.Forms.MenuItem();
			this.menuItemWindow = new System.Windows.Forms.MenuItem();
			this.menuItemNewWindow = new System.Windows.Forms.MenuItem();
			this.menuItemHelp = new System.Windows.Forms.MenuItem();
			this.menuItemAbout = new System.Windows.Forms.MenuItem();
			this.dockPanel = new WeifenLuo.WinFormsUI.DockPanel();
			this.statusBar = new System.Windows.Forms.StatusBar();
			this.imageList = new System.Windows.Forms.ImageList(this.components);
			this.toolBar = new System.Windows.Forms.ToolBar();
			this.toolBarButtonNew = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonOpen = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonSeparator1 = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonSolutionExplorer = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonPropertyWindow = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonToolbox = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonOutputWindow = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonTaskList = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonSeparator2 = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonLayoutByCode = new System.Windows.Forms.ToolBarButton();
			this.toolBarButtonLayoutByXml = new System.Windows.Forms.ToolBarButton();
			this.SuspendLayout();
			// 
			// mainMenu
			// 
			this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																					 this.menuItemFile,
																					 this.menuItemView,
																					 this.menuItemTools,
																					 this.menuItemWindow,
																					 this.menuItemHelp});
			// 
			// menuItemFile
			// 
			this.menuItemFile.Index = 0;
			this.menuItemFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																						 this.menuItemNew,
																						 this.menuItemOpen,
																						 this.menuItemClose,
																						 this.menuItemCloseAll,
																						 this.menuItem4,
																						 this.menuItemExit});
			this.menuItemFile.Text = "&File";
			this.menuItemFile.Popup += new System.EventHandler(this.menuItemFile_Popup);
			// 
			// menuItemNew
			// 
			this.menuItemNew.Index = 0;
			this.menuItemNew.Text = "&New";
			this.menuItemNew.Click += new System.EventHandler(this.menuItemNew_Click);
			// 
			// menuItemOpen
			// 
			this.menuItemOpen.Index = 1;
			this.menuItemOpen.Text = "&Open...";
			this.menuItemOpen.Click += new System.EventHandler(this.menuItemOpen_Click);
			// 
			// menuItemClose
			// 
			this.menuItemClose.Index = 2;
			this.menuItemClose.Text = "&Close";
			this.menuItemClose.Click += new System.EventHandler(this.menuItemClose_Click);
			// 
			// menuItemCloseAll
			// 
			this.menuItemCloseAll.Index = 3;
			this.menuItemCloseAll.Text = "Close &All";
			this.menuItemCloseAll.Click += new System.EventHandler(this.menuItemCloseAll_Click);
			// 
			// menuItem4
			// 
			this.menuItem4.Index = 4;
			this.menuItem4.Text = "-";
			// 
			// menuItemExit
			// 
			this.menuItemExit.Index = 5;
			this.menuItemExit.Text = "&Exit";
			this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click);
			// 
			// menuItemView
			// 
			this.menuItemView.Index = 1;
			this.menuItemView.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																						 this.menuItemSolutionExplorer,
																						 this.menuItemPropertyWindow,
																						 this.menuItemToolbox,
																						 this.menuItemOutputWindow,
																						 this.menuItemTaskList,
																						 this.menuItem1,
																						 this.menuItemToolBar,
																						 this.menuItemStatusBar,
																						 this.menuItem2,
																						 this.menuItemLayoutByCode,
																						 this.menuItemLayoutByXml});
			this.menuItemView.MergeOrder = 1;
			this.menuItemView.Text = "&View";
			// 
			// menuItemSolutionExplorer
			// 
			this.menuItemSolutionExplorer.Index = 0;
			this.menuItemSolutionExplorer.Text = "&Solution Explorer";
			this.menuItemSolutionExplorer.Click += new System.EventHandler(this.menuItemSolutionExplorer_Click);
			// 
			// menuItemPropertyWindow
			// 
			this.menuItemPropertyWindow.Index = 1;
			this.menuItemPropertyWindow.Shortcut = System.Windows.Forms.Shortcut.F4;
			this.menuItemPropertyWindow.Text = "&Property Window";
			this.menuItemPropertyWindow.Click += new System.EventHandler(this.menuItemPropertyWindow_Click);
			// 
			// menuItemToolbox
			// 
			this.menuItemToolbox.Index = 2;
			this.menuItemToolbox.Text = "&Toolbox";
			this.menuItemToolbox.Click += new System.EventHandler(this.menuItemToolbox_Click);
			// 
			// menuItemOutputWindow
			// 
			this.menuItemOutputWindow.Index = 3;
			this.menuItemOutputWindow.Text = "&Output Window";
			this.menuItemOutputWindow.Click += new System.EventHandler(this.menuItemOutputWindow_Click);
			// 
			// menuItemTaskList
			// 
			this.menuItemTaskList.Index = 4;
			this.menuItemTaskList.Text = "Task &List";
			this.menuItemTaskList.Click += new System.EventHandler(this.menuItemTaskList_Click);
			// 
			// menuItem1
			// 
			this.menuItem1.Index = 5;
			this.menuItem1.Text = "-";
			// 
			// menuItemToolBar
			// 
			this.menuItemToolBar.Checked = true;
			this.menuItemToolBar.Index = 6;
			this.menuItemToolBar.Text = "Tool &Bar";
			this.menuItemToolBar.Click += new System.EventHandler(this.menuItemToolBar_Click);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?