using System;
using System.Xml;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using Core.Mes.ClientFrameWork;
using Core.Mes.IBaseInterface;
//using Core.Mes.ServerFrameWork;

using Infragistics.Win.UltraWinGrid;
using Infragistics.Win.UltraWinTree;

namespace Core.Mes.ClientPurviewManager
{
	/// <summary>
	/// FrmFunction 的摘要说明。
	/// </summary>
	public class FrmFunction : Core.Mes.ClientFrameWork.FrmBase
	{
		private System.Windows.Forms.Panel panel1;
		private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ultraToolbarsManager1;
		private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Left;
		private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Right;
		private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Top;
		private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel1_Toolbars_Dock_Area_Bottom;
		private System.Windows.Forms.Panel panel2;
		private Infragistics.Win.Misc.UltraGroupBox ultraGroupBox1;
		private System.Windows.Forms.Panel panel3;
		private Infragistics.Win.UltraWinToolbars.UltraToolbarsManager ultraToolbarsManager2;
		private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel2_Toolbars_Dock_Area_Left;
		private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel2_Toolbars_Dock_Area_Right;
		private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel2_Toolbars_Dock_Area_Top;
		private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _panel2_Toolbars_Dock_Area_Bottom;
		private Infragistics.Win.UltraWinGrid.UltraGrid ultraGrid1;
		private Infragistics.Win.UltraWinTree.UltraTree trDb;
		private Infragistics.Win.UltraWinTree.UltraTree trFile;
		private Infragistics.Win.Misc.UltraButton ultraButton1;
		private Infragistics.Win.Misc.UltraButton ultraButton2;
		private Infragistics.Win.Misc.UltraButton ultraButton3;
		private Infragistics.Win.Misc.UltraButton ultraButton4;
		private Infragistics.Win.Misc.UltraButton ultraButton5;
		private Infragistics.Win.Misc.UltraButton ultraButton6;
		private Infragistics.Win.Misc.UltraButton ultraButton7;
		private Infragistics.Win.Misc.UltraButton ultraButton8;
		private System.ComponentModel.IContainer components;
		private DataSet _functionData;
		private Infragistics.Win.Misc.UltraExpandableGroupBox ultraExpandableGroupBox1;
		private Infragistics.Win.Misc.UltraExpandableGroupBoxPanel ultraExpandableGroupBoxPanel1;
		private Infragistics.Win.Misc.UltraLabel ultraLabel1;
		private Infragistics.Win.Misc.UltraLabel ultraLabel2;
		private Infragistics.Win.Misc.UltraLabel ultraLabel3;
		private Infragistics.Win.Misc.UltraLabel ultraLabel4;
		private Infragistics.Win.Misc.UltraLabel ultraLabel5;
		private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor1;
		private Infragistics.Win.UltraWinEditors.UltraComboEditor ultraComboEditor1;
		private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor2;
		private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor3;
		private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor4;
		private string _selectFuncSQL;

		public FrmFunction()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            Infragistics.Win.UltraWinTree.UltraTreeColumnSet ultraTreeColumnSet1 = new Infragistics.Win.UltraWinTree.UltraTreeColumnSet();
            Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
            Infragistics.Win.UltraWinGrid.UltraGridBand ultraGridBand1 = new Infragistics.Win.UltraWinGrid.UltraGridBand("Band 0", -1);
            Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("Column 0");
            Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("Column 1");
            Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance10 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance11 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance12 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance13 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance14 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance15 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance16 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance17 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance18 = new Infragistics.Win.Appearance();
            Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar1 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("Toolbar1");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool1 = new Infragistics.Win.UltraWinToolbars.ButtonTool("all");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool2 = new Infragistics.Win.UltraWinToolbars.ButtonTool("add");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool3 = new Infragistics.Win.UltraWinToolbars.ButtonTool("del");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool4 = new Infragistics.Win.UltraWinToolbars.ButtonTool("save");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool5 = new Infragistics.Win.UltraWinToolbars.ButtonTool("edit");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool6 = new Infragistics.Win.UltraWinToolbars.ButtonTool("exit");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool7 = new Infragistics.Win.UltraWinToolbars.ButtonTool("all");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool8 = new Infragistics.Win.UltraWinToolbars.ButtonTool("add");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool9 = new Infragistics.Win.UltraWinToolbars.ButtonTool("del");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool10 = new Infragistics.Win.UltraWinToolbars.ButtonTool("save");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool11 = new Infragistics.Win.UltraWinToolbars.ButtonTool("edit");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool12 = new Infragistics.Win.UltraWinToolbars.ButtonTool("exit");
            Infragistics.Win.UltraWinTree.UltraTreeColumnSet ultraTreeColumnSet2 = new Infragistics.Win.UltraWinTree.UltraTreeColumnSet();
            Infragistics.Win.UltraWinToolbars.UltraToolbar ultraToolbar2 = new Infragistics.Win.UltraWinToolbars.UltraToolbar("Toolbar1");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool13 = new Infragistics.Win.UltraWinToolbars.ButtonTool("open");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool14 = new Infragistics.Win.UltraWinToolbars.ButtonTool("save");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool15 = new Infragistics.Win.UltraWinToolbars.ButtonTool("open");
            Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool16 = new Infragistics.Win.UltraWinToolbars.ButtonTool("save");
            this.trDb = new Infragistics.Win.UltraWinTree.UltraTree();
            this.panel1 = new System.Windows.Forms.Panel();
            this.ultraGrid1 = new Infragistics.Win.UltraWinGrid.UltraGrid();
            this.ultraExpandableGroupBox1 = new Infragistics.Win.Misc.UltraExpandableGroupBox();
            this.ultraExpandableGroupBoxPanel1 = new Infragistics.Win.Misc.UltraExpandableGroupBoxPanel();
            this.ultraTextEditor4 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
            this.ultraTextEditor3 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
            this.ultraTextEditor2 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
            this.ultraComboEditor1 = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
            this.ultraTextEditor1 = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
            this.ultraLabel5 = new Infragistics.Win.Misc.UltraLabel();
            this.ultraLabel4 = new Infragistics.Win.Misc.UltraLabel();
            this.ultraLabel3 = new Infragistics.Win.Misc.UltraLabel();
            this.ultraLabel2 = new Infragistics.Win.Misc.UltraLabel();
            this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel();
            this._panel1_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
            this.ultraToolbarsManager1 = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
            this._panel1_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
            this._panel1_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
            this._panel1_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
            this.panel2 = new System.Windows.Forms.Panel();
            this.trFile = new Infragistics.Win.UltraWinTree.UltraTree();
            this._panel2_Toolbars_Dock_Area_Left = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
            this.ultraToolbarsManager2 = new Infragistics.Win.UltraWinToolbars.UltraToolbarsManager(this.components);
            this._panel2_Toolbars_Dock_Area_Right = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
            this._panel2_Toolbars_Dock_Area_Top = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
            this._panel2_Toolbars_Dock_Area_Bottom = new Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea();
            this.ultraGroupBox1 = new Infragistics.Win.Misc.UltraGroupBox();
            this.ultraButton8 = new Infragistics.Win.Misc.UltraButton();
            this.ultraButton7 = new Infragistics.Win.Misc.UltraButton();
            this.ultraButton6 = new Infragistics.Win.Misc.UltraButton();
            this.ultraButton5 = new Infragistics.Win.Misc.UltraButton();
            this.ultraButton4 = new Infragistics.Win.Misc.UltraButton();
            this.ultraButton3 = new Infragistics.Win.Misc.UltraButton();
            this.ultraButton2 = new Infragistics.Win.Misc.UltraButton();
            this.ultraButton1 = new Infragistics.Win.Misc.UltraButton();
            this.panel3 = new System.Windows.Forms.Panel();
            ((System.ComponentModel.ISupportInitialize)(this.trDb)).BeginInit();
            this.panel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).BeginInit();
            this.ultraExpandableGroupBox1.SuspendLayout();
            this.ultraExpandableGroupBoxPanel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor4)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraComboEditor1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).BeginInit();
            this.panel2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.trFile)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit();
            this.ultraGroupBox1.SuspendLayout();
            this.panel3.SuspendLayout();
            this.SuspendLayout();
            // 
            // trDb
            // 
            this.trDb.ColumnSettings.RootColumnSet = ultraTreeColumnSet1;
            this.trDb.Dock = System.Windows.Forms.DockStyle.Left;
            this.trDb.Location = new System.Drawing.Point(0, 0);
            this.trDb.Name = "trDb";
            this.trDb.Size = new System.Drawing.Size(168, 555);
            this.trDb.TabIndex = 0;
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.ultraGrid1);
            this.panel1.Controls.Add(this.ultraExpandableGroupBox1);
            this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Left);
            this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Right);
            this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Top);
            this.panel1.Controls.Add(this._panel1_Toolbars_Dock_Area_Bottom);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(168, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(584, 320);
            this.panel1.TabIndex = 1;
            // 
            // ultraGrid1
            // 
            appearance1.BackColor = System.Drawing.SystemColors.Window;
            appearance1.BorderColor = System.Drawing.SystemColors.InactiveCaption;
            this.ultraGrid1.DisplayLayout.Appearance = appearance1;
            ultraGridColumn1.Header.VisiblePosition = 0;
            ultraGridColumn2.Header.VisiblePosition = 1;
            ultraGridBand1.Columns.AddRange(new object[] {
            ultraGridColumn1,
            ultraGridColumn2});
            appearance2.BackColor = System.Drawing.Color.LightSteelBlue;
            ultraGridBand1.Override.RowSelectorAppearance = appearance2;
            ultraGridBand1.Override.RowSelectorHeaderStyle = Infragistics.Win.UltraWinGrid.RowSelectorHeaderStyle.SeparateElement;
            ultraGridBand1.Override.RowSelectorNumberStyle = Infragistics.Win.UltraWinGrid.RowSelectorNumberStyle.RowIndex;
            ultraGridBand1.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;
            this.ultraGrid1.DisplayLayout.BandsSerializer.Add(ultraGridBand1);
            this.ultraGrid1.DisplayLayout.CaptionVisible = Infragistics.Win.DefaultableBoolean.False;
            appearance3.BackColor = System.Drawing.SystemColors.ActiveBorder;
            appearance3.BackColor2 = System.Drawing.SystemColors.ControlDark;
            appearance3.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
            appearance3.BorderColor = System.Drawing.SystemColors.Window;
            this.ultraGrid1.DisplayLayout.GroupByBox.Appearance = appearance3;
            appearance4.ForeColor = System.Drawing.SystemColors.GrayText;
            this.ultraGrid1.DisplayLayout.GroupByBox.BandLabelAppearance = appearance4;
            this.ultraGrid1.DisplayLayout.GroupByBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
            this.ultraGrid1.DisplayLayout.GroupByBox.Hidden = true;
            appearance5.BackColor = System.Drawing.SystemColors.ControlLightLight;
            appearance5.BackColor2 = System.Drawing.SystemColors.Control;
            appearance5.BackGradientStyle = Infragistics.Win.GradientStyle.Horizontal;
            appearance5.ForeColor = System.Drawing.SystemColors.GrayText;
            this.ultraGrid1.DisplayLayout.GroupByBox.PromptAppearance = appearance5;
            this.ultraGrid1.DisplayLayout.MaxColScrollRegions = 1;
            this.ultraGrid1.DisplayLayout.MaxRowScrollRegions = 1;
            appearance6.BackColor = System.Drawing.SystemColors.Window;
            appearance6.ForeColor = System.Drawing.SystemColors.ControlText;
            this.ultraGrid1.DisplayLayout.Override.ActiveCellAppearance = appearance6;
            appearance7.BackColor = System.Drawing.SystemColors.Highlight;
            appearance7.ForeColor = System.Drawing.SystemColors.HighlightText;
            this.ultraGrid1.DisplayLayout.Override.ActiveRowAppearance = appearance7;
            this.ultraGrid1.DisplayLayout.Override.BorderStyleCell = Infragistics.Win.UIElementBorderStyle.RaisedSoft;
            this.ultraGrid1.DisplayLayout.Override.BorderStyleRow = Infragistics.Win.UIElementBorderStyle.Dotted;
            appearance8.BackColor = System.Drawing.SystemColors.Window;
            this.ultraGrid1.DisplayLayout.Override.CardAreaAppearance = appearance8;
            appearance9.BorderColor = System.Drawing.Color.Silver;
            appearance9.TextTrimming = Infragistics.Win.TextTrimming.EllipsisCharacter;
            this.ultraGrid1.DisplayLayout.Override.CellAppearance = appearance9;
            this.ultraGrid1.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText;
            this.ultraGrid1.DisplayLayout.Override.CellPadding = 0;
            appearance10.BackColor = System.Drawing.SystemColors.Control;
            appearance10.BackColor2 = System.Drawing.SystemColors.ControlDark;
            appearance10.BackGradientAlignment = Infragistics.Win.GradientAlignment.Element;
            appearance10.BackGradientStyle = Infragistics.Win.GradientStyle.Horizontal;
            appearance10.BorderColor = System.Drawing.SystemColors.Window;
            this.ultraGrid1.DisplayLayout.Override.GroupByRowAppearance = appearance10;
            appearance11.BackColor = System.Drawing.Color.LightSteelBlue;
            appearance11.TextHAlign = Infragistics.Win.HAlign.Center;
            this.ultraGrid1.DisplayLayout.Override.HeaderAppearance = appearance11;
            this.ultraGrid1.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
            this.ultraGrid1.DisplayLayout.Override.HeaderStyle = Infragistics.Win.HeaderStyle.Standard;
            this.ultraGrid1.DisplayLayout.Override.MinRowHeight = 21;
            appearance12.BackColor = System.Drawing.SystemColors.Window;
            appearance12.BorderColor = System.Drawing.Color.Silver;
            this.ultraGrid1.DisplayLayout.Override.RowAppearance = appearance12;
            this.ultraGrid1.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False;
            appearance13.BackColor = System.Drawing.SystemColors.ControlLight;
            this.ultraGrid1.DisplayLayout.Override.TemplateAddRowAppearance = appearance13;
            this.ultraGrid1.DisplayLayout.ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds.ScrollToFill;
            this.ultraGrid1.DisplayLayout.ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate;
            this.ultraGrid1.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy;
            this.ultraGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.ultraGrid1.Location = new System.Drawing.Point(0, 50);
            this.ultraGrid1.Name = "ultraGrid1";
            this.ultraGrid1.Size = new System.Drawing.Size(584, 182);
            this.ultraGrid1.TabIndex = 4;
            this.ultraGrid1.Text = "ultraGrid1";
            this.ultraGrid1.AfterRowActivate += new System.EventHandler(this.ultraGrid1_AfterRowActivate);
            // 
            // ultraExpandableGroupBox1
            // 
            this.ultraExpandableGroupBox1.Controls.Add(this.ultraExpandableGroupBoxPanel1);
            this.ultraExpandableGroupBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.ultraExpandableGroupBox1.ExpandedSize = new System.Drawing.Size(584, 88);
            this.ultraExpandableGroupBox1.Location = new System.Drawing.Point(0, 232);
            this.ultraExpandableGroupBox1.Name = "ultraExpandableGroupBox1";
            this.ultraExpandableGroupBox1.Size = new System.Drawing.Size(584, 88);
            this.ultraExpandableGroupBox1.SupportThemes = false;
            this.ultraExpandableGroupBox1.TabIndex = 9;
            this.ultraExpandableGroupBox1.Text = "编辑区域";
            // 
            // ultraExpandableGroupBoxPanel1
            // 
            this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraTextEditor4);
            this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraTextEditor3);
            this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraTextEditor2);
            this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraComboEditor1);
            this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraTextEditor1);
            this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraLabel5);
            this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraLabel4);
            this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraLabel3);
            this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraLabel2);
            this.ultraExpandableGroupBoxPanel1.Controls.Add(this.ultraLabel1);
            this.ultraExpandableGroupBoxPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.ultraExpandableGroupBoxPanel1.Location = new System.Drawing.Point(3, 19);
            this.ultraExpandableGroupBoxPanel1.Name = "ultraExpandableGroupBoxPanel1";
            this.ultraExpandableGroupBoxPanel1.Size = new System.Drawing.Size(578, 66);
            this.ultraExpandableGroupBoxPanel1.TabIndex = 0;
            // 
            // ultraTextEditor4
            // 
            appearance14.BackColor = System.Drawing.Color.LightCyan;
            this.ultraTextEditor4.Appearance = appearance14;
            this.ultraTextEditor4.AutoSize = true;
            this.ultraTextEditor4.Location = new System.Drawing.Point(432, 40);
            this.ultraTextEditor4.Name = "ultraTextEditor4";
            this.ultraTextEditor4.Size = new System.Drawing.Size(104, 21);
            this.ultraTextEditor4.TabIndex = 10;
            // 
            // ultraTextEditor3
            // 
            appearance15.BackColor = System.Drawing.Color.LightCyan;
            this.ultraTextEditor3.Appearance = appearance15;
            this.ultraTextEditor3.AutoSize = true;
            this.ultraTextEditor3.Location = new System.Drawing.Point(256, 40);
            this.ultraTextEditor3.Name = "ultraTextEditor3";
            this.ultraTextEditor3.Size = new System.Drawing.Size(104, 21);
            this.ultraTextEditor3.TabIndex = 9;
            // 
            // ultraTextEditor2
            // 
            appearance16.BackColor = System.Drawing.Color.LightCyan;
            this.ultraTextEditor2.Appearance = appearance16;
            this.ultraTextEditor2.AutoSize = true;
            this.ultraTextEditor2.Location = new System.Drawing.Point(80, 40);
            this.ultraTextEditor2.Name = "ultraTextEditor2";
            this.ultraTextEditor2.Size = new System.Drawing.Size(96, 21);
            this.ultraTextEditor2.TabIndex = 8;
            // 
            // ultraComboEditor1
            // 
            appearance17.BackColor = System.Drawing.Color.LightCyan;
            this.ultraComboEditor1.Appearance = appearance17;
            this.ultraComboEditor1.AutoSize = true;
            this.ultraComboEditor1.Location = new System.Drawing.Point(256, 8);
            this.ultraComboEditor1.Name = "ultraComboEditor1";
            this.ultraComboEditor1.Size = new System.Drawing.Size(104, 21);
            this.ultraComboEditor1.TabIndex = 7;
            // 
            // ultraTextEditor1
            // 
            appearance18.BackColor = System.Drawing.Color.LightCyan;
            this.ultraTextEditor1.Appearance = appearance18;
            this.ultraTextEditor1.AutoSize = true;
            this.ultraTextEditor1.Location = new System.Drawing.Point(80, 6);
            this.ultraTextEditor1.Name = "ultraTextEditor1";
            this.ultraTextEditor1.Size = new System.Drawing.Size(96, 21);
            this.ultraTextEditor1.TabIndex = 6;
            // 
            // ultraLabel5
            // 
            this.ultraLabel5.Location = new System.Drawing.Point(376, 42);
            this.ultraLabel5.Name = "ultraLabel5";
            this.ultraLabel5.Size = new System.Drawing.Size(56, 16);
            this.ultraLabel5.TabIndex = 4;
            this.ultraLabel5.Text = "图标名称";
            // 
            // ultraLabel4
            // 
            this.ultraLabel4.Location = new System.Drawing.Point(192, 42);
            this.ultraLabel4.Name = "ultraLabel4";
            this.ultraLabel4.Size = new System.Drawing.Size(56, 16);
            this.ultraLabel4.TabIndex = 3;
            this.ultraLabel4.Text = "程序集名";
            // 
            // ultraLabel3
            // 
            this.ultraLabel3.Location = new System.Drawing.Point(32, 40);
            this.ultraLabel3.Name = "ultraLabel3";
            this.ultraLabel3.Size = new System.Drawing.Size(32, 16);
            this.ultraLabel3.TabIndex = 2;
            this.ultraLabel3.Text = "类名";
            // 
            // ultraLabel2
            // 
            this.ultraLabel2.Location = new System.Drawing.Point(192, 16);
            this.ultraLabel2.Name = "ultraLabel2";
            this.ultraLabel2.Size = new System.Drawing.Size(56, 16);
            this.ultraLabel2.TabIndex = 1;
            this.ultraLabel2.Text = "功能名称";
            // 
            // ultraLabel1
            // 
            this.ultraLabel1.Location = new System.Drawing.Point(16, 16);
            this.ultraLabel1.Name = "ultraLabel1";
            this.ultraLabel1.Size = new System.Drawing.Size(56, 16);
            this.ultraLabel1.TabIndex = 0;
            this.ultraLabel1.Text = "功能编码";
            // 
            // _panel1_Toolbars_Dock_Area_Left
            // 
            this._panel1_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
            this._panel1_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control;
            this._panel1_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
            this._panel1_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
            this._panel1_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 50);
            this._panel1_Toolbars_Dock_Area_Left.Name = "_panel1_Toolbars_Dock_Area_Left";
            this._panel1_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 270);
            this._panel1_Toolbars_Dock_Area_Left.ToolbarsManager = this.ultraToolbarsManager1;
            // 
            // ultraToolbarsManager1
            // 
            this.ultraToolbarsManager1.DesignerFlags = 1;
            this.ultraToolbarsManager1.DockWithinContainer = this.panel1;
            this.ultraToolbarsManager1.ShowQuickCustomizeButton = false;
            this.ultraToolbarsManager1.Style = Infragistics.Win.UltraWinToolbars.ToolbarStyle.VisualStudio2005;
            ultraToolbar1.DockedColumn = 0;
            ultraToolbar1.DockedRow = 0;
            ultraToolbar1.Text = "Toolbar1";
            buttonTool1.InstanceProps.IsFirstInGroup = true;
            buttonTool2.InstanceProps.IsFirstInGroup = true;
            buttonTool3.InstanceProps.IsFirstInGroup = true;
            buttonTool4.InstanceProps.IsFirstInGroup = true;
            buttonTool5.InstanceProps.IsFirstInGroup = true;
            buttonTool6.InstanceProps.IsFirstInGroup = true;
            ultraToolbar1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
            buttonTool1,
            buttonTool2,
            buttonTool3,
            buttonTool4,
            buttonTool5,
            buttonTool6});
            this.ultraToolbarsManager1.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] {
            ultraToolbar1});
            buttonTool7.SharedProps.Caption = "全部(&L)";
            buttonTool7.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
            buttonTool7.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlL;
            buttonTool8.SharedProps.Caption = "新增(&A)";
            buttonTool8.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
            buttonTool8.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlA;
            buttonTool9.SharedProps.Caption = "删除(&D)";
            buttonTool9.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
            buttonTool9.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlD;
            buttonTool10.SharedProps.Caption = "保存(&S)";
            buttonTool10.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
            buttonTool10.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlS;
            buttonTool10.SharedProps.Visible = false;
            buttonTool11.SharedProps.Caption = "修改(&U)";
            buttonTool11.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
            buttonTool11.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlU;
            buttonTool12.SharedProps.Caption = "关闭(&E)";
            buttonTool12.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
            buttonTool12.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlE;
            this.ultraToolbarsManager1.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
            buttonTool7,
            buttonTool8,
            buttonTool9,
            buttonTool10,
            buttonTool11,
            buttonTool12});
            this.ultraToolbarsManager1.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.ultraToolbarsManager1_ToolClick);
            // 
            // _panel1_Toolbars_Dock_Area_Right
            // 
            this._panel1_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
            this._panel1_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control;
            this._panel1_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
            this._panel1_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
            this._panel1_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(584, 50);
            this._panel1_Toolbars_Dock_Area_Right.Name = "_panel1_Toolbars_Dock_Area_Right";
            this._panel1_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 270);
            this._panel1_Toolbars_Dock_Area_Right.ToolbarsManager = this.ultraToolbarsManager1;
            // 
            // _panel1_Toolbars_Dock_Area_Top
            // 
            this._panel1_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
            this._panel1_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control;
            this._panel1_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
            this._panel1_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
            this._panel1_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
            this._panel1_Toolbars_Dock_Area_Top.Name = "_panel1_Toolbars_Dock_Area_Top";
            this._panel1_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(584, 50);
            this._panel1_Toolbars_Dock_Area_Top.ToolbarsManager = this.ultraToolbarsManager1;
            // 
            // _panel1_Toolbars_Dock_Area_Bottom
            // 
            this._panel1_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
            this._panel1_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control;
            this._panel1_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
            this._panel1_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
            this._panel1_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 320);
            this._panel1_Toolbars_Dock_Area_Bottom.Name = "_panel1_Toolbars_Dock_Area_Bottom";
            this._panel1_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(584, 0);
            this._panel1_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.ultraToolbarsManager1;
            // 
            // panel2
            // 
            this.panel2.Controls.Add(this.trFile);
            this.panel2.Controls.Add(this._panel2_Toolbars_Dock_Area_Left);
            this.panel2.Controls.Add(this._panel2_Toolbars_Dock_Area_Right);
            this.panel2.Controls.Add(this._panel2_Toolbars_Dock_Area_Top);
            this.panel2.Controls.Add(this._panel2_Toolbars_Dock_Area_Bottom);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel2.Location = new System.Drawing.Point(128, 0);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(456, 235);
            this.panel2.TabIndex = 2;
            // 
            // trFile
            // 
            this.trFile.ColumnSettings.RootColumnSet = ultraTreeColumnSet2;
            this.trFile.Dock = System.Windows.Forms.DockStyle.Fill;
            this.trFile.Location = new System.Drawing.Point(0, 22);
            this.trFile.Name = "trFile";
            this.trFile.Size = new System.Drawing.Size(456, 213);
            this.trFile.TabIndex = 0;
            // 
            // _panel2_Toolbars_Dock_Area_Left
            // 
            this._panel2_Toolbars_Dock_Area_Left.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
            this._panel2_Toolbars_Dock_Area_Left.BackColor = System.Drawing.SystemColors.Control;
            this._panel2_Toolbars_Dock_Area_Left.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Left;
            this._panel2_Toolbars_Dock_Area_Left.ForeColor = System.Drawing.SystemColors.ControlText;
            this._panel2_Toolbars_Dock_Area_Left.Location = new System.Drawing.Point(0, 22);
            this._panel2_Toolbars_Dock_Area_Left.Name = "_panel2_Toolbars_Dock_Area_Left";
            this._panel2_Toolbars_Dock_Area_Left.Size = new System.Drawing.Size(0, 213);
            this._panel2_Toolbars_Dock_Area_Left.ToolbarsManager = this.ultraToolbarsManager2;
            // 
            // ultraToolbarsManager2
            // 
            this.ultraToolbarsManager2.DesignerFlags = 1;
            this.ultraToolbarsManager2.DockWithinContainer = this.panel2;
            this.ultraToolbarsManager2.ShowQuickCustomizeButton = false;
            ultraToolbar2.DockedColumn = 0;
            ultraToolbar2.DockedRow = 0;
            ultraToolbar2.Text = "Toolbar1";
            buttonTool13.InstanceProps.IsFirstInGroup = true;
            buttonTool14.InstanceProps.IsFirstInGroup = true;
            ultraToolbar2.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
            buttonTool13,
            buttonTool14});
            this.ultraToolbarsManager2.Toolbars.AddRange(new Infragistics.Win.UltraWinToolbars.UltraToolbar[] {
            ultraToolbar2});
            buttonTool15.SharedProps.Caption = "打开(&O)";
            buttonTool15.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
            buttonTool15.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlO;
            buttonTool16.SharedProps.Caption = "保存(&S)";
            buttonTool16.SharedProps.DisplayStyle = Infragistics.Win.UltraWinToolbars.ToolDisplayStyle.ImageAndText;
            buttonTool16.SharedProps.Shortcut = System.Windows.Forms.Shortcut.CtrlS;
            this.ultraToolbarsManager2.Tools.AddRange(new Infragistics.Win.UltraWinToolbars.ToolBase[] {
            buttonTool15,
            buttonTool16});
            this.ultraToolbarsManager2.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(this.ultraToolbarsManager2_ToolClick);
            // 
            // _panel2_Toolbars_Dock_Area_Right
            // 
            this._panel2_Toolbars_Dock_Area_Right.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
            this._panel2_Toolbars_Dock_Area_Right.BackColor = System.Drawing.SystemColors.Control;
            this._panel2_Toolbars_Dock_Area_Right.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Right;
            this._panel2_Toolbars_Dock_Area_Right.ForeColor = System.Drawing.SystemColors.ControlText;
            this._panel2_Toolbars_Dock_Area_Right.Location = new System.Drawing.Point(456, 22);
            this._panel2_Toolbars_Dock_Area_Right.Name = "_panel2_Toolbars_Dock_Area_Right";
            this._panel2_Toolbars_Dock_Area_Right.Size = new System.Drawing.Size(0, 213);
            this._panel2_Toolbars_Dock_Area_Right.ToolbarsManager = this.ultraToolbarsManager2;
            // 
            // _panel2_Toolbars_Dock_Area_Top
            // 
            this._panel2_Toolbars_Dock_Area_Top.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
            this._panel2_Toolbars_Dock_Area_Top.BackColor = System.Drawing.SystemColors.Control;
            this._panel2_Toolbars_Dock_Area_Top.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Top;
            this._panel2_Toolbars_Dock_Area_Top.ForeColor = System.Drawing.SystemColors.ControlText;
            this._panel2_Toolbars_Dock_Area_Top.Location = new System.Drawing.Point(0, 0);
            this._panel2_Toolbars_Dock_Area_Top.Name = "_panel2_Toolbars_Dock_Area_Top";
            this._panel2_Toolbars_Dock_Area_Top.Size = new System.Drawing.Size(456, 22);
            this._panel2_Toolbars_Dock_Area_Top.ToolbarsManager = this.ultraToolbarsManager2;
            // 
            // _panel2_Toolbars_Dock_Area_Bottom
            // 
            this._panel2_Toolbars_Dock_Area_Bottom.AccessibleRole = System.Windows.Forms.AccessibleRole.Grouping;
            this._panel2_Toolbars_Dock_Area_Bottom.BackColor = System.Drawing.SystemColors.Control;
            this._panel2_Toolbars_Dock_Area_Bottom.DockedPosition = Infragistics.Win.UltraWinToolbars.DockedPosition.Bottom;
            this._panel2_Toolbars_Dock_Area_Bottom.ForeColor = System.Drawing.SystemColors.ControlText;
            this._panel2_Toolbars_Dock_Area_Bottom.Location = new System.Drawing.Point(0, 235);
            this._panel2_Toolbars_Dock_Area_Bottom.Name = "_panel2_Toolbars_Dock_Area_Bottom";
            this._panel2_Toolbars_Dock_Area_Bottom.Size = new System.Drawing.Size(456, 0);
            this._panel2_Toolbars_Dock_Area_Bottom.ToolbarsManager = this.ultraToolbarsManager2;
            // 
            // ultraGroupBox1
            // 
            this.ultraGroupBox1.Controls.Add(this.ultraButton8);
            this.ultraGroupBox1.Controls.Add(this.ultraButton7);
            this.ultraGroupBox1.Controls.Add(this.ultraButton6);
            this.ultraGroupBox1.Controls.Add(this.ultraButton5);
            this.ultraGroupBox1.Controls.Add(this.ultraButton4);
            this.ultraGroupBox1.Controls.Add(this.ultraButton3);
            this.ultraGroupBox1.Controls.Add(this.ultraButton2);
            this.ultraGroupBox1.Controls.Add(this.ultraButton1);
            this.ultraGroupBox1.Dock = System.Windows.Forms.DockStyle.Left;
            this.ultraGroupBox1.Location = new System.Drawing.Point(0, 0);
            this.ultraGroupBox1.Name = "ultraGroupBox1";
            this.ultraGroupBox1.Size = new System.Drawing.Size(128, 235);
            this.ultraGroupBox1.SupportThemes = false;
            this.ultraGroupBox1.TabIndex = 3;
            this.ultraGroupBox1.Text = "控制区域";
            this.ultraGroupBox1.Click += new System.EventHandler(this.ultraGroupBox1_Click);
            // 
            // ultraButton8
            // 
            this.ultraButton8.Location = new System.Drawing.Point(72, 176);
            this.ultraButton8.Name = "ultraButton8";
            this.ultraButton8.Size = new System.Drawing.Size(40, 23);
            this.ultraButton8.TabIndex = 7;
            this.ultraButton8.Text = "右";
            this.ultraButton8.Click += new System.EventHandler(this.ultraButton8_Click);
            // 
            // ultraButton7
            // 
            this.ultraButton7.Location = new System.Drawing.Point(40, 200);
            this.ultraButton7.Name = "ultraButton7";
            this.ultraButton7.Size = new System.Drawing.Size(40, 23);
            this.ultraButton7.TabIndex = 6;
            this.ultraButton7.Text = "下";
            this.ultraButton7.Click += new System.EventHandler(this.ultraButton7_Click);
            // 
            // ultraButton6
            // 
            this.ultraButton6.Location = new System.Drawing.Point(40, 152);
            this.ultraButton6.Name = "ultraButton6";
            this.ultraButton6.Size = new System.Drawing.Size(40, 23);
            this.ultraButton6.TabIndex = 5;
            this.ultraButton6.Text = "上";
            this.ultraButton6.Click += new System.EventHandler(this.ultraButton6_Click);
            // 
            // ultraButton5
            // 
            this.ultraButton5.Location = new System.Drawing.Point(8, 176);
            this.ultraButton5.Name = "ultraButton5";
            this.ultraButton5.Size = new System.Drawing.Size(40, 23);
            this.ultraButton5.TabIndex = 4;
            this.ultraButton5.Text = "左";
            this.ultraButton5.Click += new System.EventHandler(this.ultraButton5_Click);
            // 
            // ultraButton4
            // 
            this.ultraButton4.Location = new System.Drawing.Point(24, 120);
            this.ultraButton4.Name = "ultraButton4";
            this.ultraButton4.Size = new System.Drawing.Size(75, 23);
            this.ultraButton4.TabIndex = 3;
            this.ultraButton4.Text = "新增子";
            this.ultraButton4.Click += new System.EventHandler(this.ultraButton4_Click);
            // 
            // ultraButton3
            // 
            this.ultraButton3.Location = new System.Drawing.Point(24, 96);
            this.ultraButton3.Name = "ultraButton3";
            this.ultraButton3.Size = new System.Drawing.Size(75, 23);
            this.ultraButton3.TabIndex = 2;
            this.ultraButton3.Text = "新增同";
            this.ultraButton3.Click += new System.EventHandler(this.ultraButton3_Click);
            // 
            // ultraButton2
            // 
            this.ultraButton2.Location = new System.Drawing.Point(24, 72);
            this.ultraButton2.Name = "ultraButton2";
            this.ultraButton2.Size = new System.Drawing.Size(75, 23);
            this.ultraButton2.TabIndex = 1;
            this.ultraButton2.Text = "移除";
            this.ultraButton2.Click += new System.EventHandler(this.ultraButton2_Click);
            // 
            // ultraButton1
            // 
            this.ultraButton1.Location = new System.Drawing.Point(24, 48);
            this.ultraButton1.Name = "ultraButton1";
            this.ultraButton1.Size = new System.Drawing.Size(75, 23);
            this.ultraButton1.TabIndex = 0;
            this.ultraButton1.Text = "选择";
            this.ultraButton1.Click += new System.EventHandler(this.ultraButton1_Click);
            // 
            // panel3
            // 
            this.panel3.Controls.Add(this.panel2);
            this.panel3.Controls.Add(this.ultraGroupBox1);
            this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
            this.panel3.Location = new System.Drawing.Point(168, 320);
            this.panel3.Name = "panel3";
            this.panel3.Size = new System.Drawing.Size(584, 235);
            this.panel3.TabIndex = 4;
            // 
            // FrmFunction
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
            this.ClientSize = new System.Drawing.Size(752, 555);
            this.Controls.Add(this.panel3);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.trDb);
            this.Name = "FrmFunction";
            this.Text = "权限文件维护";
            this.WindowState = System.Windows.Forms.FormWindowState.Normal;
            this.Load += new System.EventHandler(this.FrmFunction_Load);
            ((System.ComponentModel.ISupportInitialize)(this.trDb)).EndInit();
            this.panel1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraExpandableGroupBox1)).EndInit();
            this.ultraExpandableGroupBox1.ResumeLayout(false);
            this.ultraExpandableGroupBoxPanel1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor4)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraComboEditor1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager1)).EndInit();
            this.panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.trFile)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraToolbarsManager2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit();
            this.ultraGroupBox1.ResumeLayout(false);
            this.panel3.ResumeLayout(false);
            this.ResumeLayout(false);

		}
		#endregion

		private void FrmFunction_Load(object sender, System.EventArgs e)
		{
			GetTrDBdata("");
			InCom();
			InitTrDB();
			InitDbGrid();
			this.trDb.AfterSelect += new Infragistics.Win.UltraWinTree.AfterNodeSelectEventHandler(ultraTree1_AfterSelect);
			if (this.trDb.Nodes.Count > 0)
				this.trDb.Nodes[0].Selected = true;
		}
		#region "	InitDbTree	"

		private void InitTrDB()
		{
			try
			{
				if (_functionData != null)
				{
					if (this.trDb.Nodes.Count > 0)
					{
						try
						{
							RemoveAllTreeNode(this.trDb);
						}
						catch
						{
							RemoveAllTreeNode(this.trDb);
						}
					}
					TreeFillData1( _functionData.Tables[0]);
					this.trDb.ExpandAll();
				}
			}
			catch //(Exception ex)
			{
		//		CoreMesLogger.log(this.GetType()).Error(ex.Message);
			}
		}
		private void RemoveAllTreeNode(UltraTree ut)
		{
			int count = ut.Nodes.Count ;
				
			for (int i = count -1; i >= 0 ; i--)
			{
				ut.Nodes[i].Remove();
			}
		}
		//==========================================================
		// 产线类型
		//==========================================================
		private void TreeFillData1(DataTable dt)
		{
			DataRow[] drs = dt.Select("len(FUNCTIONID) = 2");
			
			foreach(DataRow dr in drs)
			{
				UltraTreeNode tn = new UltraTreeNode();
				tn.Text = dr["FUNCTIONNAME"].ToString();
				tn.Key  = dr["FUNCTIONID"].ToString();
				tn.Tag  = dr["IMAGENAME"].ToString();
				TreeFillData2(dt, dr["FUNCTIONID"].ToString(), tn);

				this.trDb.Nodes.Add(tn);
			}
		}
		//==========================================================
		// 产线编号
		//==========================================================
		private void TreeFillData2(DataTable dt, string str, UltraTreeNode tnd)
		{
			DataRow[] drs = dt.Select("len(FUNCTIONID) = 4 and substring(FUNCTIONID,1,2) = '" + str + "'");
			foreach(DataRow dr in drs)
			{
				UltraTreeNode tn = new UltraTreeNode();
				tn.Text = dr["FUNCTIONNAME"].ToString();
				tn.Key  = dr["FUNCTIONID"].ToString();
				tn.Tag  = dr["IMAGENAME"].ToString();
				TreeFillData3(dt, dr["FUNCTIONID"].ToString(), tn);

				tnd.Nodes.Add(tn);
			}
		}
		//==========================================================
		// 车间编码
		//==========================================================
		private void TreeFillData3(DataTable dt, string str, UltraTreeNode tnd)
		{
			DataRow[] drs = dt.Select("len(FUNCTIONID) = 6 and substring(FUNCTIONID,1,4) = '" + str + "'");
			foreach(DataRow dr in drs)
			{
				UltraTreeNode tn = new UltraTreeNode();
				tn.Text = dr["FUNCTIONNAME"].ToString();
				tn.Key  = dr["FUNCTIONID"].ToString();
				tn.Tag  = dr["IMAGENAME"].ToString();
				
				tnd.Nodes.Add(tn);
			}
		}
		private void GetTrDBdata(string str)
		{
			try
			{
				CallingMessage par = new CallingMessage();
				par.ServerName    = "PurviewManager";
				//par.AssemblyName  = "Core.Mes.PurviewManager";
				par.ClassName     = "Core.Mes.PurviewManager.PurviewManager";
				par.MethodName    = "SelectUAM_FUNCTION";
				par.args          = new object[]{str+" order by FUNCTIONID "};
				par.ServerType    = MesServerType.MesSystemBaseServer;
			
				string strOut = "";

				_functionData = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut) as DataSet;

				_selectFuncSQL = strOut;
			}
			catch //(Exception ex)
			{
		//		CoreMesLogger.log(this.GetType()).Error(ex.Message);
			}
		}
		private void ultraTree1_AfterSelect(object sender, Infragistics.Win.UltraWinTree.SelectEventArgs e)
		{
			string rowFilter;
			if (e.NewSelections == null || e.NewSelections.Count == 0) 
				rowFilter = "";
			else
			{
				string id = e.NewSelections[0].Key.ToString();
				int count = id.Length;

				rowFilter = "substring(FUNCTIONID,1," + count.ToString() + ") = '" + id + "' or FUNCTIONID is null or trim(FUNCTIONID) = '' ";
			}
			DataTable dt = this.ultraGrid1.DataSource as DataTable ;
			dt.DefaultView.RowFilter = rowFilter;
		}
		#endregion
		#region "	InitDbGrid	"

		private void InitDbGrid()
		{
			this.ultraGrid1.DataSource = this._functionData.Tables[0];
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Header.Caption = "功能编码";
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Width = 80;
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellAppearance.TextHAlign =  Infragistics.Win.HAlign.Left;
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].CellAppearance.BackColor=Color.LightGoldenrodYellow;

			this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].Header.Caption = "功能名称";
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].Width = 100;
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].CellAppearance.TextHAlign =  Infragistics.Win.HAlign.Left;

			this.ultraGrid1.DisplayLayout.Bands[0].Columns[2].Header.Caption = "类名";
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[2].Width = 200;
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[2].CellAppearance.TextHAlign =  Infragistics.Win.HAlign.Left;
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[2].CellAppearance.BackColor=Color.LightGoldenrodYellow;

			this.ultraGrid1.DisplayLayout.Bands[0].Columns[3].Header.Caption = "程序集名";
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[3].Width = 200;
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[3].CellAppearance.TextHAlign =  Infragistics.Win.HAlign.Left;

			this.ultraGrid1.DisplayLayout.Bands[0].Columns[4].Header.Caption = "图标名称";
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[4].Width = 100;
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[4].CellAppearance.TextHAlign =  Infragistics.Win.HAlign.Left;
			this.ultraGrid1.DisplayLayout.Bands[0].Columns[4].CellAppearance.BackColor=Color.LightGoldenrodYellow;

this.ultraGrid1.DisplayLayout.Bands[0].Columns[5].Hidden=true;
		//	this.ultraGrid1.DisplayLayout.Bands[0].Columns[5].Header.Caption = "备注";
//			this.ultraGrid1.DisplayLayout.Bands[0].Columns[5].Width = 100;
//			this.ultraGrid1.DisplayLayout.Bands[0].Columns[5].CellAppearance.TextHAlign =  Infragistics.Win.HAlign.Left;
		}
		private void InCom()
		{
			if (_functionData != null && _functionData.Tables.Count >0)
			{
				foreach(DataRow arow in (_functionData).Tables[0].Rows)
					this.ultraComboEditor1.Items.Add(arow[1]);
				if(!this.ultraComboEditor1.Items.Contains(System.DBNull.Value)) this.ultraComboEditor1.Items.Add(System.DBNull.Value);
			}
		}
		#endregion
		#region "工具栏1"
		private void ultraToolbarsManager1_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
		{
			switch(e.Tool .Key )
			{
				case "all":
                    this.trDb.SelectedNodes.Clear();
					break;
				case "add":
                    Add();
					break;
				case "del":
                    Delete();
					break;
				case "edit":
                   Edit();
					break;
				case "exit":
					this.Close();
					break;

			}
		}
		private void Delete()
		{
			
			int i = 0;
			UltraGridRow ugr = this.ultraGrid1.ActiveRow;
			if (ugr == null)
			{
				MessageBox.Show("请选择要删除的功能名!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information );
				return;
			}
			if (MessageBox.Show("是否确认删除选中的功能?","提示",MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
			{
				return;
			}
			try
			{
				i = ugr.Index;
				string strWhere = " where FUNCTIONID = '" + ugr.Cells[0].Value.ToString() + "'";
				
				CallingMessage par = new CallingMessage();
				par.ServerName    = "PurviewManager";
				//par.AssemblyName  = "Core.Mes.PurviewManager";
				par.ClassName     = "Core.Mes.PurviewManager.PurviewManager";
				par.MethodName    = "DeleteUAM_FUNCTION";
				par.args          = new object[]{strWhere};
				par.ServerType    = MesServerType.MesSystemBaseServer;
			
				string strOut = "";

				object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);

				if (strOut != "") 
				{
					MessageBox.Show("删除失败! \n" + strOut);
					return;
				}
				else
				{
					if ((int)obj != 1)
					{
						MessageBox.Show("删除失败!");
						return;
					}
				}
			}
			catch //(Exception ex)
			{
		//		CoreMesLogger.log(this.GetType()).Error(ex.Message);
				return;
			}
			
			ultraGrid1.ActiveRow.Delete(false);
			ultraGrid1.UpdateData();
			InCom();
			InitTrDB();			
			try
			{
				ultraGrid1.Rows[i].Activate();
			}
			catch
			{
				int count = ultraGrid1.Rows.Count;
				if ( count > 0)
					ultraGrid1.Rows[count -1].Activate();
			}
		}

		private void Add()
		{
			if (this.ultraTextEditor1.Text.Trim() == "")
			{
				MessageBox.Show("请录入功能编码！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
				return;
			}
			if (this.ultraTextEditor2.Text.Trim() == "")
			{
				MessageBox.Show("请录入类名！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
				return;
			}
			if (this.ultraTextEditor3.Text.Trim() == "")
			{
				MessageBox.Show("请录入程序集名！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
				return;
			}
			if (this.ultraComboEditor1.Text.Trim() == null)
			{
				MessageBox.Show("请录入功能名称！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
				return;
			}
			ArrayList al = new ArrayList();
			
			al.Add(this.ultraTextEditor1.Text.Trim());
			
			al.Add(this.ultraComboEditor1.Text.Trim());
			al.Add(this.ultraTextEditor2.Text.Trim());
			al.Add(this.ultraTextEditor3.Text.Trim());
			al.Add(this.ultraTextEditor4.Text.Trim());
//			al.Add(this.ultraTextEditor5.Text.Trim());
			
			try
			{
				CallingMessage par = new CallingMessage();
				par.ServerName    = "PurviewManager";
				//par.AssemblyName  = "Core.Mes.PurviewManager";
				par.ClassName     = "Core.Mes.PurviewManager.PurviewManager";
				par.MethodName    = "InsertUAM_FUNCTION";
				par.args          = new object[]{al};
				par.ServerType    = MesServerType.MesSystemBaseServer;
			
				string strOut = "";

				object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);

				if (strOut != "") 
				{
					MessageBox.Show("新增失败! \n" + strOut);
					return;
				}
				else
				{
					if ((int)obj != 1)
					{
						MessageBox.Show("新增失败!");
						return;
					}
				}
			}
			catch //(Exception ex)
			{
	//			CoreMesLogger.log(this.GetType()).Error(ex.Message);
				return;
			}
			GetTrDBdata("");
			UltraGridRow ugr = this.ultraGrid1.DisplayLayout.Bands[0].AddNew();
			ugr.Cells[0].Value = al[0];
			ugr.Cells[1].Value = al[1];
			ugr.Cells[2].Value = al[2];
			ugr.Cells[3].Value = al[3];
			ugr.Cells[4].Value = al[4];
			ugr.Cells[5].Value = al[5];
			
			this.ultraGrid1.UpdateData();
			InCom();
			InitTrDB();
		}

		private void Edit()
		{
			UltraGridRow ugr = this.ultraGrid1.ActiveRow;
			if (ugr == null)
			{
				MessageBox.Show("请选择要修改的功能编码!");
				return;
			}
			
			if (this.ultraComboEditor1.Value == null)
			{
				MessageBox.Show("请选择要修改的功能名称！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
				return;
			}
			if (this.ultraTextEditor2.Text.Trim() == "")
			{
				MessageBox.Show("请选择要修改的类名称！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
				return;
			}
			if (this.ultraTextEditor3.Text.Trim() == "")
			{
				MessageBox.Show("请选择要修改的程序集名称！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
				return;
			}
			
			ArrayList al = new ArrayList();
			
			al.Add(this.ultraTextEditor1.Text.Trim());
            al.Add(this.ultraComboEditor1.Text.Trim());
			al.Add(this.ultraTextEditor2.Text.Trim());
			
			al.Add(this.ultraTextEditor3.Text.Trim());

			al.Add(this.ultraTextEditor4.Text.Trim());
//            al.Add(this.ultraTextEditor5.Text.Trim());
			try
			{
				CallingMessage par = new CallingMessage();
				par.ServerName    = "PurviewManager";
				//par.AssemblyName  = "Core.Mes.PurviewManager";
				par.ClassName     = "Core.Mes.PurviewManager.PurviewManager";
				par.MethodName    = "UpdateUAM_FUNCTION";
				par.args          = new object[]{al};
				par.ServerType    = MesServerType.MesSystemBaseServer;
			
				string strOut = "";

				object obj = Core.Mes.ClientFrameWork.ClientCommon._RemotingHelp.ExecuteMethod(par, out strOut);

				if (strOut != "") 
				{
					MessageBox.Show("修改失败 \n" + strOut);
					return;
				}
				else
				{
					int i = (int)obj;
					if (i != 1)
					{
						MessageBox.Show("修改失败");
						return;
					}
				}
			}
			catch //(Exception ex)
			{
		//		CoreMesLogger.log(this.GetType()).Error(ex.Message);
				return;
			}
			ugr.Cells[0].Value = al[0];
			ugr.Cells[1].Value = al[1];
			ugr.Cells[2].Value = al[2];
			ugr.Cells[3].Value = al[3];
			ugr.Cells[4].Value = al[4];
			ugr.Cells[5].Value = al[5];
			
			ultraGrid1.UpdateData();
			InCom();
			InitTrDB();
		}

		private void ultraGrid1_AfterRowActivate(object sender, System.EventArgs e)
		{
			try
			{				
				if (this.ultraGrid1.ActiveRow == null) return;
				UltraGridRow ugr = this.ultraGrid1.ActiveRow;

				this.ultraTextEditor1.Text = ugr.Cells[0].Value.ToString();
				this.ultraComboEditor1.Text= ugr.Cells[1].Value.ToString();
				this.ultraTextEditor2.Text = ugr.Cells[2].Value.ToString();	
				this.ultraTextEditor3.Text = ugr.Cells[3].Value.ToString();
	            this.ultraTextEditor4.Text = ugr.Cells[4].Value.ToString();
//				this.ultraTextEditor5.Text = ugr.Cells[5].Value.ToString();
			}
			catch (Exception ex)
			{
				Console.WriteLine(ex.Message);
			}
		}
		#endregion
		#region "工具栏2"
		private void ultraToolbarsManager2_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
		{
			switch (e.Tool.Key)
			{
				case "open" :
					openFile();
					break;
				case "save" :
					saveFile();
					break;
			}
		}
		#region "	save	"
		private void saveFile()
		{
			DialogResult rs = MessageBox.Show("保存到本地?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

			switch (rs)
			{
				
				case DialogResult.OK :
					saveLocalFile();
					break;
				case DialogResult.Cancel :
					break;
			}
		}
		private void saveLocalFile()
		{
			System.Windows.Forms.SaveFileDialog sfd = new SaveFileDialog();
			
			sfd.FileName = "*.xml";
			sfd.Filter = "xml文件(*.xml)|*.xml|所有文件(*.*)|*.*";
			DialogResult rs = sfd.ShowDialog(this);

			switch (rs)
			{
				case DialogResult.OK :
					try
					{
						string fileName = sfd.FileName;
						//this.trFile.SaveAsXml(fileName);
						SaveAsXml(fileName);
					}
					catch (Exception ex)
					{
						Console.WriteLine(ex.Message);
						MessageBox.Show("文件保存错误!");
					}
					break;
				default :
					break;
			}
		}
		private void SaveAsXml(string fileName)
		{
			XmlTextWriter xtw = new XmlTextWriter(fileName,System.Text.Encoding.UTF8);

			try
			{
				xtw.Formatting = Formatting.Indented ;
				xtw.WriteStartDocument();
				xtw.WriteStartElement("MainMenu");
			
				foreach (UltraTreeNode utn in this.trFile.Nodes)
				{
					xtw.WriteStartElement("Group");
					xtw.WriteAttributeString("GroupName", utn.Key);
				
					if (utn.Nodes.Count > 0 )
					{
						if (utn.GetNodeCount(true) != utn.GetNodeCount(false))
							xtw.WriteAttributeString("flag", "Tree");
						else
							xtw.WriteAttributeString("flag", "Default");
						
						SetChildElement(xtw, utn.Nodes);
					}
									
					xtw.WriteEndElement();
				}
			
				xtw.WriteEndElement();
				xtw.WriteEndDocument();

				XmlDocument doc = new XmlDocument();
				
				xtw.Flush();
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);			
			}
			xtw.Close();
		}
		private void SetChildElement(XmlTextWriter xtw, TreeNodesCollection tnc)
		{
			
			foreach(UltraTreeNode utn in tnc)
			{
				xtw.WriteStartElement("Item");
				xtw.WriteAttributeString("ItemID", utn.Key);
				xtw.WriteAttributeString("Image", utn.Tag.ToString());

				if (utn.Nodes.Count > 0)
				{
					SetChildElement(xtw, utn.Nodes);
				}
				xtw.WriteEndElement();
			}
		}
		
		#endregion
		#region "	open	"
		private void openFile()
		{
			DialogResult rs = MessageBox.Show("打开本地文件?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

			switch (rs)
			{
				
				case DialogResult.OK :
					openLocalFile();
					break;
				case DialogResult.Cancel :
					break;
			}
		}
		private void openLocalFile()
		{
			System.Windows.Forms.OpenFileDialog ofd = new OpenFileDialog();
			
			ofd.FileName = "*.xml";
			ofd.Filter = "xml文件(*.xml)|*.xml|所有文件(*.*)|*.*";
			DialogResult rs = ofd.ShowDialog(this);

			switch (rs)
			{
				case DialogResult.OK :
					try
					{
						string fileName = ofd.FileName;
						this.RemoveAllTreeNode(this.trFile);
						LoadFromXml(fileName);
					}
					catch (Exception ex)
					{						
						MessageBox.Show(ex.Message);
					}
					break;
				default :
					break;
			}
		}
		private void LoadFromXml(string fileName)
		{
			XmlDocument doc = new XmlDocument();
			
			doc.Load(fileName);

			XmlNodeList xnl = doc.ChildNodes[1].ChildNodes;

			foreach (XmlNode xn in xnl)
			{
				UltraTreeNode utn = new UltraTreeNode();
				string strKey = xn.Attributes[0].Value.ToString();
				UltraTreeNode tn = this.trDb.GetNodeByKey(strKey);
				
				if (this.trDb.GetNodeByKey(strKey) != null)
				{
					utn.Key = tn.Key;
					utn.Text = tn.Text;
					utn.Tag = tn.Tag;
				}
				else
				{
					utn.Key = strKey;
					utn.Text = strKey;
					utn.Tag = "";
				}
				if (xn.ChildNodes.Count >0)
				{
					SetChildNode(utn, xn.ChildNodes);
				}
				this.trFile.Nodes.Add(utn);
			}
		}
		private void SetChildNode(UltraTreeNode utn, XmlNodeList xnl)
		{
			foreach (XmlNode xn in xnl)
			{
				UltraTreeNode tn = new UltraTreeNode();
				string strKey = xn.Attributes[0].Value.ToString();
				UltraTreeNode tntmp = this.trDb.GetNodeByKey(strKey);
				
				if (this.trDb.GetNodeByKey(strKey) != null)
				{
					tn.Key = tntmp.Key;
					tn.Text = tntmp.Text;
					tn.Tag = tntmp.Tag;
				}
				else
				{
					tn.Key = strKey;
					tn.Text = strKey;
					tn.Tag = "";
				}

				if (xn.ChildNodes.Count >0)
				{
					SetChildNode(tn, xn.ChildNodes);
				}
				utn.Nodes.Add(tn);			
			}
		}
		#endregion
	#endregion
		private void ultraButton1_Click(object sender, System.EventArgs e)
		{
			if (this.trDb.SelectedNodes == null) return;
			
			SelectedNodesCollection utn = this.trDb.SelectedNodes;
			
			foreach(UltraTreeNode tn in utn)
			{
				CopyTreeNode(tn, this.trFile.Nodes);
			}
		}
		private void CopyTreeNode(UltraTreeNode tn, TreeNodesCollection tnc)
		{
			if (this.trFile.GetNodeByKey(tn.Key) == null)
			{
				UltraTreeNode ftn = new UltraTreeNode(tn.Key, tn.Text);
				ftn.Tag = tn.Tag;
				tnc.Add(ftn);
			}
			if (tn.Nodes.Count > 0)
			{
				foreach (UltraTreeNode utn in tn.Nodes)
				{
					CopyTreeNode(utn,this.trFile.GetNodeByKey(tn.Key).Nodes);
				}
			}
		}

		private void ultraButton2_Click(object sender, System.EventArgs e)
		{
			if ( this.trFile.ActiveNode == null) return;
			
			DialogResult rs = MessageBox.Show("是否确认移除?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question);


			switch (rs)
			{
				case DialogResult.Yes :
					this.trFile.ActiveNode.Remove();
					break;
				case DialogResult.No :
					break;
			}
		}

		private void ultraButton6_Click(object sender, System.EventArgs e)
		{
			try
			{	
				if ( this.trFile.SelectedNodes == null) return;

				UltraTreeNode tn= this.trFile.ActiveNode;
				int i = tn.Index ;
				if (i == 0) return;

				if (tn.Level == 0)

					tn.Reposition(this.trFile.Nodes, i - 1);
				else
					tn.Reposition(tn.Parent.Nodes, i - 1);
			}
			catch
			{}
		}

		private void ultraButton7_Click(object sender, System.EventArgs e)
		{
			try
			{	
				if ( this.trFile.SelectedNodes == null) return;

				UltraTreeNode tn= this.trFile.ActiveNode;
				int i = tn.Index ;
					
				if (tn.Level == 0)
				{
					if (i == this.trFile.Nodes.Count-1) return;
					tn.Reposition(this.trFile.Nodes, i + 1);
				}
				else
				{
					if (i == tn.Parent.Nodes.Count-1) return;
					tn.Reposition(tn.Parent.Nodes, i + 1);
				}
			}
			catch {}
		}

		private void ultraButton5_Click(object sender, System.EventArgs e)
		{
			try
			{
				if ( this.trFile.SelectedNodes == null) return;

				UltraTreeNode tn= this.trFile.ActiveNode;
			
				if (tn.Level == 0 ) 
					return;
				else if (tn.Level == 1 ) 
					tn.Reposition(this.trFile.Nodes);
				else
				{
					UltraTreeNode utn = tn.Parent.Parent;
					tn.Reposition(utn.Nodes);
				}
			}
			catch {}
		}

		private void ultraButton8_Click(object sender, System.EventArgs e)
		{
			try
			{
				if ( this.trFile.SelectedNodes == null) return;

				UltraTreeNode tn= this.trFile.ActiveNode;

				int i = tn.Index;
			
				if (i == 0) return;
			
				UltraTreeNode utn;
				if (tn.Level == 0)
					utn = this.trFile.Nodes[i -1];
				else
					utn = tn.Parent.Nodes[i -1];
			
				tn.Reposition(utn.Nodes);

				utn.ExpandAll();
			}
			catch {}
		}

		private void ultraButton3_Click(object sender, System.EventArgs e)
		{
			try
			{
				if ( this.trFile.SelectedNodes == null) return;

				UltraTreeNode tn= this.trFile.ActiveNode;

				if (tn.Level == 0)
				{
					UltraTreeNode utn = new UltraTreeNode();
					this.trFile.Nodes.Add(utn);
					utn.BeginEdit();
				}
				else
				{
					UltraTreeNode utn = new UltraTreeNode();
					tn.Parent.Nodes.Add(utn);
					utn.BeginEdit();
				}
			}
			catch {}
		}

		private void ultraButton4_Click(object sender, System.EventArgs e)
		{
		
		}

		private void ultraGroupBox1_Click(object sender, System.EventArgs e)
		{
		
		}


	

	
	}
}
