www.pudn.com > OA-FlowDefine.rar > MainForm.cs


using System; 
using System.Drawing; 
using System.Collections; 
using System.ComponentModel; 
using System.Windows.Forms; 
using System.Data; 
using MindFusion.FlowChartX; 
 
namespace FlowCharter 
{ 
	///  
	/// Summary description for MainForm. 
	///  
	public class MainForm : System.Windows.Forms.Form 
	{ 
		private class NodeProps 
		{ 
			[Category("Properties")] 
			[Description("The text displayed within the node.")] 
			public string Text 
			{ 
				get { return _text; } 
				set { _text = value; } 
			} 
			[Category("Properties")] 
			[Description("The font of the node's text.")] 
			public Font Font 
			{ 
				get { return _font; } 
				set { _font = value; } 
			} 
			[Category("Properties")] 
			[Description("The interior color of the node.")] 
			public Color FillColor 
			{ 
				get { return _fillColor; } 
				set { _fillColor = value; } 
			} 
 
			private string _text; 
			private Font _font; 
			private Color _fillColor; 
		} 
 
		private class NodeDragItem 
		{ 
			public NodeDragItem(int index) 
			{ 
				this._index = index; 
			} 
			 
			public static System.Type _GetType() 
			{ 
				return new NodeDragItem(0).GetType(); 
			} 
 
			public int Index 
			{ 
				get 
				{ 
					return _index; 
				} 
			} 
 
			private int _index; 
		} 
 
		private class Node 
		{ 
			public Node(AnchorPattern anchor, 
				ShapeTemplate template, string name) 
			{ 
				_anchor = anchor; 
				_template = template; 
				_name = name; 
			} 
 
			public AnchorPattern Anchor 
			{ 
				get { return _anchor; } 
			} 
			public ShapeTemplate Template 
			{ 
				get { return _template; } 
			} 
			public string Name 
			{ 
				get { return _name ; } 
			} 
 
			private AnchorPattern _anchor; 
			private ShapeTemplate _template; 
			private string _name; 
		} 
 
		private class Connector 
		{ 
			public Connector(EArrowHead head, string name) 
			{ 
				_head = head; 
				_name = name; 
			} 
 
			public EArrowHead Head 
			{ 
				get { return _head; } 
			} 
			public string Name 
			{ 
				get { return _name; } 
			} 
 
			private EArrowHead _head; 
			private string _name; 
		} 
 
		// Data 
		private static Node[] _nodes = null; 
		private static Connector[] _connectors = null; 
 
		private NodeProps _selected = null; 
 
		private Color _anchorColor = Color.Red; 
		private EMarkStyle _anchorStyle = EMarkStyle.msCircle; 
 
 
		///  
		/// Required designer variable. 
		///  
		private System.Windows.Forms.MainMenu _mainMenu; 
		private System.Windows.Forms.MenuItem _menuItemFile; 
		private System.Windows.Forms.MenuItem _menuItemNew; 
		private System.Windows.Forms.MenuItem _menuItemOpen; 
		private System.Windows.Forms.MenuItem _menuItemSave; 
		private System.Windows.Forms.MenuItem _menuItemSep1; 
		private System.Windows.Forms.MenuItem _menuItemPreview; 
		private System.Windows.Forms.MenuItem _menuItemPrint; 
		private System.Windows.Forms.MenuItem _menuItemSep2; 
		private System.Windows.Forms.MenuItem _menuItemExit; 
		private System.Windows.Forms.MenuItem _menuItemHelp; 
		private System.Windows.Forms.MenuItem _menuItemAbout; 
		private System.Windows.Forms.MenuItem _menuItemTools; 
		private System.Windows.Forms.MenuItem _menuItemOptions; 
		private System.Windows.Forms.Panel _borderPanel; 
		private MindFusion.FlowChartX.FlowChart _flowChart; 
		private System.ComponentModel.Container components = null; 
		private System.Windows.Forms.Panel _rightPanel; 
		private System.Windows.Forms.TabControl _tab; 
		private System.Windows.Forms.Splitter _splitter2; 
		private System.Windows.Forms.TabPage _tabNodes; 
		private System.Windows.Forms.TabPage _tabConnectors; 
		private System.Windows.Forms.PropertyGrid _propertyGrid; 
		private System.Windows.Forms.ListBox _nodeList; 
		private System.Windows.Forms.ComboBox _connectorTypeCombo; 
		private System.Windows.Forms.ListBox _connectorList; 
		private System.Windows.Forms.OpenFileDialog _openFileDialog; 
		private System.Windows.Forms.SaveFileDialog _saveFileDialog; 
		private System.Windows.Forms.ContextMenu _contextMenu; 
		private System.Windows.Forms.MenuItem _menuItemDelete; 
		private System.Windows.Forms.MenuItem _menuEdit; 
		private System.Windows.Forms.MenuItem _menuUndo; 
		private System.Windows.Forms.MenuItem _menuRedo; 
		private System.Windows.Forms.Panel panel1; 
		private MindFusion.FlowChartX.FlowChart _hidden; 
 
		public MainForm() 
		{ 
			// 
			// Required for Windows Form Designer support 
			// 
			InitializeComponent(); 
 
			// _flowChart.UndoManager.UndoEnabled = true; 
			// _flowChart.UndoManager.History.Capacity = 30; 
 
			Color defAnch = Color.Red; 
 
			_nodes = new Node[] 
			{ 
				new Node( 
					new AnchorPattern(new AnchorPoint[] 
					{ 
						new AnchorPoint( 50,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 50, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100, 100, true, true, EMarkStyle.msCircle, defAnch) 
					}), 
					ShapeTemplate.FromId("Alternative"),	// get shape by string id 
					"1三角"), 
				new Node( 
					new AnchorPattern(new AnchorPoint[] 
					{ 
						new AnchorPoint( 30,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 50,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100,  50, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 50, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0,  50, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0,  30, true, true, EMarkStyle.msCircle, defAnch) 
					}), 
					ShapeTemplate.FromId("PunchedCard"), 
					"2三角"), 
				new Node( 
					AnchorPattern.Decision2In2Out, 
					ShapeTemplate.FromId("Decision"), 
					"3三角"), 
				new Node( 
					new AnchorPattern(new AnchorPoint[] 
					{ 
						new AnchorPoint(  0,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 50,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100,  50, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 50, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0,  50, true, true, EMarkStyle.msCircle, defAnch) 
					}), 
					ShapeTemplate.FromId("Delay"), 
					"4三角"), 
				new Node( 
					new AnchorPattern(new AnchorPoint[] 
					{ 
						new AnchorPoint( 15,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 50,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 85,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100,  50, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 85, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 50, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 15, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0,  50, true, true, EMarkStyle.msCircle, defAnch) 
					}), 
					ShapeTemplate.DirectData,	// obsolete, predefined shapes were available as static properties in previous FC.NET versions 
					"5三角"), 
				new Node( 
				new AnchorPattern(new AnchorPoint[] 
					{ 
						new AnchorPoint( 50,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100,  20, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100,  50, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100,  80, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 50, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0,  80, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0,  50, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0,  20, true, true, EMarkStyle.msCircle, defAnch) 
					}), 
					ShapeTemplate.FromId("DiskStorage"), 
					"6三角"), 
				new Node( 
					new AnchorPattern(new AnchorPoint[] 
					{ 
						new AnchorPoint( 40,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 85,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100,  50, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 85, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 40, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0,  50, true, true, EMarkStyle.msCircle, defAnch) 
					}), 
					ShapeTemplate.FromId("Display"), 
					"7三角"), 
				new Node( 
					new AnchorPattern(new AnchorPoint[] 
					{ 
						new AnchorPoint( 50,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100,  50, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 50, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0,  50, true, true, EMarkStyle.msCircle, defAnch) 
					}), 
					ShapeTemplate.FromId("DividedEvent"), 
					"8三角"), 
				new Node( 
					new AnchorPattern(new AnchorPoint[] 
					{ 
						new AnchorPoint(  0,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 50,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100,   0, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100,  50, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(100, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint( 50, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0, 100, true, true, EMarkStyle.msCircle, defAnch), 
						new AnchorPoint(  0,  50, true, true, EMarkStyle.msCircle, defAnch) 
					}), 
					ShapeTemplate.FromId("DividedProcess"), 
					"9三角") 
			}; 
			foreach(Node s in _nodes) 
				_nodeList.Items.Add(s.Name); 
 
			_connectors = new Connector[] 
			{ 
				new Connector( 
					EArrowHead.ahArrow, 
					"Arrow"), 
				new Connector( 
					EArrowHead.ahBackSlash, 
					"Back slash"), 
				new Connector( 
					EArrowHead.ahBowArrow, 
					"Bow arrow"), 
				new Connector( 
					EArrowHead.ahCircle, 
					"Circle"), 
				new Connector( 
					EArrowHead.ahDoubleArrow, 
					"Double arrow"), 
				new Connector( 
					EArrowHead.ahNone, 
					"None"), 
				new Connector( 
					EArrowHead.ahPentagon, 
					"Pentagon"), 
				new Connector( 
					EArrowHead.ahPointerArrow, 
					"Pointer"), 
				new Connector( 
					EArrowHead.ahQuill, 
					"Quill"), 
				new Connector( 
					EArrowHead.ahReversed, 
					"Reversed"), 
				new Connector( 
					EArrowHead.ahRevTriangle, 
					"Reversed triangle"), 
				new Connector( 
					EArrowHead.ahRevWithCirc, 
					"Reversed with Circle"), 
				new Connector( 
					EArrowHead.ahRevWithLine, 
					"Reversed with Line"), 
				new Connector( 
					EArrowHead.ahRhombus, 
					"Rhombus"), 
				new Connector( 
					EArrowHead.ahSlash, 
					"Slash"), 
				new Connector( 
					EArrowHead.ahTetragon, 
					"Tetragon"), 
				new Connector( 
					EArrowHead.ahTriangle, 
					"Triangle") 
			}; 
			foreach(Connector c in _connectors) 
				_connectorList.Items.Add(c.Name); 
 
			_nodeList.SelectedIndex = 0; 
			_connectorList.SelectedIndex = 0; 
			_connectorTypeCombo.SelectedIndex = 0; 
 
			// Set-up the hidden chart 
			_hidden.DocExtents = new RectangleF(0, 0, 50, 50); 
			_hidden.RestrObjsToDoc = ERestrictToDoc.rdNoRestriction; 
 
			// Set-up the flow chart 
			_flowChart.Selection.AllowMultiSel = false; 
			_flowChart.PrpArrowStartOrnt = EOrientation.soAuto; 
		} 
 
		///  
		/// Clean up any resources being used. 
		///  
		protected override void Dispose( bool disposing ) 
		{ 
			if( disposing ) 
			{ 
				if (components != null)  
				{ 
					components.Dispose(); 
				} 
			} 
			base.Dispose( disposing ); 
		} 
 
		#region Windows Form Designer generated code 
		///  
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor. 
		///  
		private void InitializeComponent() 
		{ 
			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._menuItemSave = new System.Windows.Forms.MenuItem(); 
			this._menuItemSep1 = new System.Windows.Forms.MenuItem(); 
			this._menuItemPreview = new System.Windows.Forms.MenuItem(); 
			this._menuItemPrint = new System.Windows.Forms.MenuItem(); 
			this._menuItemSep2 = new System.Windows.Forms.MenuItem(); 
			this._menuItemExit = new System.Windows.Forms.MenuItem(); 
			this._menuEdit = new System.Windows.Forms.MenuItem(); 
			this._menuUndo = new System.Windows.Forms.MenuItem(); 
			this._menuRedo = new System.Windows.Forms.MenuItem(); 
			this._menuItemTools = new System.Windows.Forms.MenuItem(); 
			this._menuItemOptions = new System.Windows.Forms.MenuItem(); 
			this._menuItemHelp = new System.Windows.Forms.MenuItem(); 
			this._menuItemAbout = new System.Windows.Forms.MenuItem(); 
			this._borderPanel = new System.Windows.Forms.Panel(); 
			this._hidden = new MindFusion.FlowChartX.FlowChart(); 
			this._flowChart = new MindFusion.FlowChartX.FlowChart(); 
			this._rightPanel = new System.Windows.Forms.Panel(); 
			this._propertyGrid = new System.Windows.Forms.PropertyGrid(); 
			this._splitter2 = new System.Windows.Forms.Splitter(); 
			this._tab = new System.Windows.Forms.TabControl(); 
			this._tabNodes = new System.Windows.Forms.TabPage(); 
			this._nodeList = new System.Windows.Forms.ListBox(); 
			this._tabConnectors = new System.Windows.Forms.TabPage(); 
			this._connectorList = new System.Windows.Forms.ListBox(); 
			this._connectorTypeCombo = new System.Windows.Forms.ComboBox(); 
			this._openFileDialog = new System.Windows.Forms.OpenFileDialog(); 
			this._saveFileDialog = new System.Windows.Forms.SaveFileDialog(); 
			this._contextMenu = new System.Windows.Forms.ContextMenu(); 
			this._menuItemDelete = new System.Windows.Forms.MenuItem(); 
			this.panel1 = new System.Windows.Forms.Panel(); 
			this._borderPanel.SuspendLayout(); 
			this._rightPanel.SuspendLayout(); 
			this._tab.SuspendLayout(); 
			this._tabNodes.SuspendLayout(); 
			this._tabConnectors.SuspendLayout(); 
			this.panel1.SuspendLayout(); 
			this.SuspendLayout(); 
			//  
			// _mainMenu 
			//  
			this._mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { 
																					  this._menuItemFile, 
																					  this._menuEdit, 
																					  this._menuItemTools, 
																					  this._menuItemHelp}); 
			//  
			// _menuItemFile 
			//  
			this._menuItemFile.Index = 0; 
			this._menuItemFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { 
																						  this._menuItemNew, 
																						  this._menuItemOpen, 
																						  this._menuItemSave, 
																						  this._menuItemSep1, 
																						  this._menuItemPreview, 
																						  this._menuItemPrint, 
																						  this._menuItemSep2, 
																						  this._menuItemExit}); 
			this._menuItemFile.Text = "&File"; 
			//  
			// _menuItemNew 
			//  
			this._menuItemNew.Index = 0; 
			this._menuItemNew.Shortcut = System.Windows.Forms.Shortcut.CtrlN; 
			this._menuItemNew.Text = "&New"; 
			this._menuItemNew.Click += new System.EventHandler(this.OnFileNew); 
			//  
			// _menuItemOpen 
			//  
			this._menuItemOpen.Index = 1; 
			this._menuItemOpen.Shortcut = System.Windows.Forms.Shortcut.CtrlO; 
			this._menuItemOpen.Text = "&Open..."; 
			this._menuItemOpen.Click += new System.EventHandler(this.OnFileOpen); 
			//  
			// _menuItemSave 
			//  
			this._menuItemSave.Index = 2; 
			this._menuItemSave.Shortcut = System.Windows.Forms.Shortcut.CtrlS; 
			this._menuItemSave.Text = "&Save..."; 
			this._menuItemSave.Click += new System.EventHandler(this.OnFileSave); 
			//  
			// _menuItemSep1 
			//  
			this._menuItemSep1.Index = 3; 
			this._menuItemSep1.Text = "-"; 
			//  
			// _menuItemPreview 
			//  
			this._menuItemPreview.Index = 4; 
			this._menuItemPreview.Text = "Print pre&view..."; 
			this._menuItemPreview.Click += new System.EventHandler(this.OnPrintPreview); 
			//  
			// _menuItemPrint 
			//  
			this._menuItemPrint.Index = 5; 
			this._menuItemPrint.Shortcut = System.Windows.Forms.Shortcut.CtrlP; 
			this._menuItemPrint.Text = "&Print..."; 
			this._menuItemPrint.Click += new System.EventHandler(this.OnPrint); 
			//  
			// _menuItemSep2 
			//  
			this._menuItemSep2.Index = 6; 
			this._menuItemSep2.Text = "-"; 
			//  
			// _menuItemExit 
			//  
			this._menuItemExit.Index = 7; 
			this._menuItemExit.Text = "E&xit"; 
			this._menuItemExit.Click += new System.EventHandler(this.OnExit); 
			//  
			// _menuEdit 
			//  
			this._menuEdit.Index = 1; 
			this._menuEdit.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { 
																					  this._menuUndo, 
																					  this._menuRedo}); 
			this._menuEdit.Text = "&Edit"; 
			this._menuEdit.Popup += new System.EventHandler(this.OnEditPopup); 
			//  
			// _menuUndo 
			//  
			this._menuUndo.Index = 0; 
			this._menuUndo.Shortcut = System.Windows.Forms.Shortcut.CtrlZ; 
			this._menuUndo.Text = "&Undo"; 
			this._menuUndo.Click += new System.EventHandler(this.OnUndo); 
			//  
			// _menuRedo 
			//  
			this._menuRedo.Index = 1; 
			this._menuRedo.Shortcut = System.Windows.Forms.Shortcut.CtrlY; 
			this._menuRedo.Text = "&Redo"; 
			this._menuRedo.Click += new System.EventHandler(this.OnRedo); 
			//  
			// _menuItemTools 
			//  
			this._menuItemTools.Index = 2; 
			this._menuItemTools.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { 
																						   this._menuItemOptions}); 
			this._menuItemTools.Text = "&Tools"; 
			//  
			// _menuItemOptions 
			//  
			this._menuItemOptions.Index = 0; 
			this._menuItemOptions.Text = "&Options..."; 
			this._menuItemOptions.Click += new System.EventHandler(this.OnOptions); 
			//  
			// _menuItemHelp 
			//  
			this._menuItemHelp.Index = 3; 
			this._menuItemHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { 
																						  this._menuItemAbout}); 
			this._menuItemHelp.Text = "&Help"; 
			//  
			// _menuItemAbout 
			//  
			this._menuItemAbout.Index = 0; 
			this._menuItemAbout.Text = "&About..."; 
			this._menuItemAbout.Click += new System.EventHandler(this.OnAbout); 
			//  
			// _borderPanel 
			//  
			this._borderPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 
			this._borderPanel.Controls.Add(this.panel1); 
			this._borderPanel.Location = new System.Drawing.Point(0, -16); 
			this._borderPanel.Name = "_borderPanel"; 
			this._borderPanel.Size = new System.Drawing.Size(488, 248); 
			this._borderPanel.TabIndex = 6; 
			//  
			// _hidden 
			//  
			this._hidden.ActiveMnpColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255))); 
			this._hidden.ActiveObject = null; 
			this._hidden.AlignToGrid = true; 
			this._hidden.AllowInplaceEdit = false; 
			this._hidden.AllowLinksRepeat = true; 
			this._hidden.AllowRefLinks = true; 
			this._hidden.AllowUnanchoredArrows = true; 
			this._hidden.AllowUnconnectedArrows = false; 
			this._hidden.AntiAlias = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; 
			this._hidden.ArrowBase = MindFusion.FlowChartX.EArrowHead.ahNone; 
			this._hidden.ArrowBaseSize = 12F; 
			this._hidden.ArrowColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0))); 
			this._hidden.ArrowEndsMovable = true; 
			this._hidden.ArrowFillColor = System.Drawing.Color.FromArgb(((System.Byte)(120)), ((System.Byte)(220)), ((System.Byte)(255))); 
			this._hidden.ArrowHead = MindFusion.FlowChartX.EArrowHead.ahArrow; 
			this._hidden.ArrowHeadSize = 12F; 
			this._hidden.ArrowIntermSize = 12F; 
			this._hidden.ArrowRouteEnd = MindFusion.FlowChartX.EOrientation.soAuto; 
			this._hidden.ArrowRouteStart = MindFusion.FlowChartX.EOrientation.soAuto; 
			this._hidden.ArrowSegments = ((short)(1)); 
			this._hidden.ArrowsRetainForm = false; 
			this._hidden.ArrowsSplittable = false; 
			this._hidden.ArrowStyle = MindFusion.FlowChartX.EArrowStyle.asPolyline; 
			this._hidden.ArrowTextStyle = MindFusion.FlowChartX.EArrowTextStyle.atsCenter; 
			this._hidden.AutoScroll = true; 
			this._hidden.AutoSizeDoc = false; 
			this._hidden.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255))); 
			this._hidden.Behavior = MindFusion.FlowChartX.EBehavior.bhFlowChart; 
			this._hidden.BkgrImagePos = MindFusion.FlowChartX.EImagePos.imgCenter; 
			this._hidden.BoxCustomDraw = MindFusion.FlowChartX.ECustomDraw.cdNone; 
			this._hidden.BoxesExpandable = false; 
			this._hidden.BoxFillColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(191)), ((System.Byte)(255))); 
			this._hidden.BoxFrameColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0))); 
			this._hidden.BoxIncmAnchor = MindFusion.FlowChartX.EArrowAnchor.aaNoAnchor; 
			this._hidden.BoxOutgAnchor = MindFusion.FlowChartX.EArrowAnchor.aaNoAnchor; 
			this._hidden.BoxSelStyle = MindFusion.FlowChartX.ESelStyle.sstSquareHandles; 
			this._hidden.BoxStyle = MindFusion.FlowChartX.EBoxStyle.bsRoundRect; 
			this._hidden.ControlHostsExpandable = false; 
			this._hidden.CurArrowCannotCreate = System.Windows.Forms.Cursors.No; 
			this._hidden.CurArrowEnd = System.Windows.Forms.Cursors.Hand; 
			this._hidden.CurArrowStart = System.Windows.Forms.Cursors.Hand; 
			this._hidden.CurCannotCreate = System.Windows.Forms.Cursors.No; 
			this._hidden.CurHorzResize = System.Windows.Forms.Cursors.SizeWE; 
			this._hidden.CurMainDgnlResize = System.Windows.Forms.Cursors.SizeNWSE; 
			this._hidden.CurModify = System.Windows.Forms.Cursors.SizeAll; 
			this._hidden.CurPointer = System.Windows.Forms.Cursors.Arrow; 
			this._hidden.CurSecDgnlResize = System.Windows.Forms.Cursors.SizeNESW; 
			this._hidden.CurVertResize = System.Windows.Forms.Cursors.SizeNS; 
			this._hidden.DefaultControlType = typeof(System.Windows.Forms.Button); 
			this._hidden.Dirty = true; 
			this._hidden.DisabledMnpColor = System.Drawing.Color.FromArgb(((System.Byte)(200)), ((System.Byte)(0)), ((System.Byte)(0))); 
			this._hidden.DocExtents = ((System.Drawing.RectangleF)(resources.GetObject("_hidden.DocExtents"))); 
			this._hidden.DoubleBuffer = false; 
			this._hidden.DynamicArrows = false; 
			this._hidden.EnableStyledText = false; 
			this._hidden.ExpandBtnPos = MindFusion.FlowChartX.EExpandBtnPos.ebpOuterRight; 
			this._hidden.ExpandOnIncoming = false; 
			this._hidden.GridColor = System.Drawing.Color.FromArgb(((System.Byte)(140)), ((System.Byte)(140)), ((System.Byte)(150))); 
			this._hidden.GridSize = 4F; 
			this._hidden.HighSpeedRouting = false; 
			this._hidden.HitTestPriority = MindFusion.FlowChartX.EHitTestPriority.htpNodesBeforeArrows; 
			this._hidden.HostedCtrlMouseAction = MindFusion.FlowChartX.EHostMouseAction.hmaPassToControl; 
			this._hidden.InplaceEditAcceptOnEnter = false; 
			this._hidden.InplaceEditCancelOnEsc = true; 
			this._hidden.InplaceEditFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204))); 
			this._hidden.IntermArrowHead = MindFusion.FlowChartX.EArrowHead.ahNone; 
			this._hidden.Location = new System.Drawing.Point(56, 112); 
			this._hidden.MeasureUnit = System.Drawing.GraphicsUnit.Pixel; 
			this._hidden.ModificationStart = MindFusion.FlowChartX.EModificationStyle.mdSelectedOnly; 
			this._hidden.Name = "_hidden"; 
			this._hidden.PenDashStyle = System.Drawing.Drawing2D.DashStyle.Solid; 
			this._hidden.PenWidth = 0F; 
			this._hidden.PolyTextLayout = false; 
			this._hidden.PrpArrowStartOrnt = MindFusion.FlowChartX.EOrientation.soAuto; 
			this._hidden.RecursiveExpand = false; 
			this._hidden.RestrObjsToDoc = MindFusion.FlowChartX.ERestrictToDoc.rdIntersection; 
			this._hidden.RouteArrows = false; 
			this._hidden.ScrollX = 0F; 
			this._hidden.ScrollY = 0F; 
			this._hidden.SelectAfterCreate = false; 
			this._hidden.SelHandleSize = 2F; 
			this._hidden.SelMnpColor = System.Drawing.Color.FromArgb(((System.Byte)(170)), ((System.Byte)(170)), ((System.Byte)(170))); 
			this._hidden.ShadowColor = System.Drawing.Color.FromArgb(((System.Byte)(110)), ((System.Byte)(110)), ((System.Byte)(140))); 
			this._hidden.ShadowOffsetX = 1F; 
			this._hidden.ShadowOffsetY = 1F; 
			this._hidden.ShadowsStyle = MindFusion.FlowChartX.EShadowsStyle.shdOneLevel; 
			this._hidden.ShapeRotation = 0F; 
			this._hidden.ShowAnchors = MindFusion.FlowChartX.EShowAnchors.saAuto; 
			this._hidden.ShowDisabledHandles = true; 
			this._hidden.ShowGrid = false; 
			this._hidden.ShowScrollbars = true; 
			this._hidden.ShowToolTips = false; 
			this._hidden.Size = new System.Drawing.Size(96, 78); 
			this._hidden.SnapToAnchor = MindFusion.FlowChartX.ESnapToAnchor.saOnCreate; 
			this._hidden.TabIndex = 8; 
			this._hidden.TableCaption = "Table"; 
			this._hidden.TableCaptionHeight = 5F; 
			this._hidden.TableCellBorders = MindFusion.FlowChartX.ECellBorders.cbSystem3D; 
			this._hidden.TableColumnsCount = 2; 
			this._hidden.TableColWidth = 18F; 
			this._hidden.TableFillColor = System.Drawing.Color.FromArgb(((System.Byte)(180)), ((System.Byte)(160)), ((System.Byte)(160))); 
			this._hidden.TableFrameColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0))); 
			this._hidden.TableLinkStyle = MindFusion.FlowChartX.ETableLinkStyle.tlsRows; 
			this._hidden.TableRowHeight = 6F; 
			this._hidden.TableRowsCount = 4; 
			this._hidden.TableSelStyle = MindFusion.FlowChartX.ESelStyle.sstDashFrame; 
			this._hidden.TablesExpandable = false; 
			this._hidden.TablesScrollable = false; 
			this._hidden.TableStyle = MindFusion.FlowChartX.ETableStyle.tsRect; 
			this._hidden.TextColor = System.Drawing.Color.Black; 
			this._hidden.ToolTip = ""; 
			this._hidden.Visible = false; 
			this._hidden.ZoomFactor = ((short)(100)); 
			this._hidden.BackBrush = MindFusion.FlowChartX.Brush.Deserialize("solid;#FFFFFFFF"); 
			this._hidden.BoxBrush = MindFusion.FlowChartX.Brush.Deserialize("solid;#FF00BFFF"); 
			this._hidden.TableBrush = MindFusion.FlowChartX.Brush.Deserialize("solid;#FFB4A0A0"); 
			this._hidden.ArrowBrush = MindFusion.FlowChartX.Brush.Deserialize("solid;#FF78DCFF"); 
			this._hidden.BoxPen = MindFusion.FlowChartX.Pen.Deserialize("pen;0;#FF000000;0;0;0;"); 
			this._hidden.TablePen = MindFusion.FlowChartX.Pen.Deserialize("pen;0;#FF000000;0;0;0;"); 
			this._hidden.ArrowPen = MindFusion.FlowChartX.Pen.Deserialize("pen;0;#FF000000;0;0;0;"); 
			this._hidden.TextFormat = new System.Drawing.StringFormat(); 
			this._hidden.TextFormat.Alignment = System.Drawing.StringAlignment.Center; 
			this._hidden.TextFormat.LineAlignment = System.Drawing.StringAlignment.Center; 
			//  
			// _flowChart 
			//  
			this._flowChart.ActiveMnpColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255))); 
			this._flowChart.ActiveObject = null; 
			this._flowChart.AlignToGrid = true; 
			this._flowChart.AllowDrop = true; 
			this._flowChart.AllowInplaceEdit = false; 
			this._flowChart.AllowLinksRepeat = true; 
			this._flowChart.AllowRefLinks = true; 
			this._flowChart.AllowUnanchoredArrows = true; 
			this._flowChart.AllowUnconnectedArrows = false; 
			this._flowChart.AntiAlias = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; 
			this._flowChart.ArrowBase = MindFusion.FlowChartX.EArrowHead.ahNone; 
			this._flowChart.ArrowBaseSize = 3F; 
			this._flowChart.ArrowColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0))); 
			this._flowChart.ArrowEndsMovable = true; 
			this._flowChart.ArrowFillColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255))); 
			this._flowChart.ArrowHead = MindFusion.FlowChartX.EArrowHead.ahArrow; 
			this._flowChart.ArrowHeadSize = 3F; 
			this._flowChart.ArrowIntermSize = 3F; 
			this._flowChart.ArrowRouteEnd = MindFusion.FlowChartX.EOrientation.soAuto; 
			this._flowChart.ArrowRouteStart = MindFusion.FlowChartX.EOrientation.soAuto; 
			this._flowChart.ArrowSegments = ((short)(1)); 
			this._flowChart.ArrowsRetainForm = false; 
			this._flowChart.ArrowsSplittable = false; 
			this._flowChart.ArrowStyle = MindFusion.FlowChartX.EArrowStyle.asPolyline; 
			this._flowChart.ArrowTextStyle = MindFusion.FlowChartX.EArrowTextStyle.atsCenter; 
			this._flowChart.AutoScroll = true; 
			this._flowChart.AutoSizeDoc = false; 
			this._flowChart.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(208)), ((System.Byte)(200))); 
			this._flowChart.Behavior = MindFusion.FlowChartX.EBehavior.bhCreateArrow; 
			this._flowChart.BkgrImagePos = MindFusion.FlowChartX.EImagePos.imgCenter; 
			this._flowChart.BoxCustomDraw = MindFusion.FlowChartX.ECustomDraw.cdNone; 
			this._flowChart.BoxesExpandable = false; 
			this._flowChart.BoxFillColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(191)), ((System.Byte)(255))); 
			this._flowChart.BoxFrameColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0))); 
			this._flowChart.BoxIncmAnchor = MindFusion.FlowChartX.EArrowAnchor.aaNoAnchor; 
			this._flowChart.BoxOutgAnchor = MindFusion.FlowChartX.EArrowAnchor.aaNoAnchor; 
			this._flowChart.BoxSelStyle = MindFusion.FlowChartX.ESelStyle.sstSquareHandles; 
			this._flowChart.BoxStyle = MindFusion.FlowChartX.EBoxStyle.bsRoundRect; 
			this._flowChart.ControlHostsExpandable = false; 
			this._flowChart.CurArrowCannotCreate = System.Windows.Forms.Cursors.No; 
			this._flowChart.CurArrowEnd = System.Windows.Forms.Cursors.Hand; 
			this._flowChart.CurArrowStart = System.Windows.Forms.Cursors.Hand; 
			this._flowChart.CurCannotCreate = System.Windows.Forms.Cursors.No; 
			this._flowChart.CurHorzResize = System.Windows.Forms.Cursors.SizeWE; 
			this._flowChart.CurMainDgnlResize = System.Windows.Forms.Cursors.SizeNWSE; 
			this._flowChart.CurModify = System.Windows.Forms.Cursors.SizeAll; 
			this._flowChart.CurPointer = System.Windows.Forms.Cursors.Arrow; 
			this._flowChart.CurSecDgnlResize = System.Windows.Forms.Cursors.SizeNESW; 
			this._flowChart.CurVertResize = System.Windows.Forms.Cursors.SizeNS; 
			this._flowChart.DefaultControlType = typeof(System.Windows.Forms.Button); 
			this._flowChart.Dirty = true; 
			this._flowChart.DisabledMnpColor = System.Drawing.Color.FromArgb(((System.Byte)(200)), ((System.Byte)(0)), ((System.Byte)(0))); 
			this._flowChart.DocExtents = ((System.Drawing.RectangleF)(resources.GetObject("_flowChart.DocExtents"))); 
			this._flowChart.Dock = System.Windows.Forms.DockStyle.Fill; 
			this._flowChart.DoubleBuffer = false; 
			this._flowChart.DynamicArrows = false; 
			this._flowChart.EnableStyledText = false; 
			this._flowChart.ExpandBtnPos = MindFusion.FlowChartX.EExpandBtnPos.ebpOuterRight; 
			this._flowChart.ExpandOnIncoming = false; 
			this._flowChart.GridColor = System.Drawing.Color.Black; 
			this._flowChart.GridSize = 4F; 
			this._flowChart.HighSpeedRouting = false; 
			this._flowChart.HitTestPriority = MindFusion.FlowChartX.EHitTestPriority.htpNodesBeforeArrows; 
			this._flowChart.HostedCtrlMouseAction = MindFusion.FlowChartX.EHostMouseAction.hmaPassToControl; 
			this._flowChart.InplaceEditAcceptOnEnter = false; 
			this._flowChart.InplaceEditCancelOnEsc = true; 
			this._flowChart.InplaceEditFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204))); 
			this._flowChart.IntermArrowHead = MindFusion.FlowChartX.EArrowHead.ahNone; 
			this._flowChart.Location = new System.Drawing.Point(0, 0); 
			this._flowChart.MeasureUnit = System.Drawing.GraphicsUnit.Millimeter; 
			this._flowChart.ModificationStart = MindFusion.FlowChartX.EModificationStyle.mdSelectedOnly; 
			this._flowChart.Name = "_flowChart"; 
			this._flowChart.PenDashStyle = System.Drawing.Drawing2D.DashStyle.Solid; 
			this._flowChart.PenWidth = 0F; 
			this._flowChart.PolyTextLayout = false; 
			this._flowChart.PrpArrowStartOrnt = MindFusion.FlowChartX.EOrientation.soAuto; 
			this._flowChart.RecursiveExpand = false; 
			this._flowChart.RestrObjsToDoc = MindFusion.FlowChartX.ERestrictToDoc.rdIntersection; 
			this._flowChart.RouteArrows = false; 
			this._flowChart.ScrollX = 129F; 
			this._flowChart.ScrollY = 65F; 
			this._flowChart.SelectAfterCreate = true; 
			this._flowChart.SelHandleSize = 2F; 
			this._flowChart.SelMnpColor = System.Drawing.Color.FromArgb(((System.Byte)(170)), ((System.Byte)(170)), ((System.Byte)(170))); 
			this._flowChart.ShadowColor = System.Drawing.Color.FromArgb(((System.Byte)(100)), ((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0))); 
			this._flowChart.ShadowOffsetX = 1F; 
			this._flowChart.ShadowOffsetY = 1F; 
			this._flowChart.ShadowsStyle = MindFusion.FlowChartX.EShadowsStyle.shdOneLevel; 
			this._flowChart.ShapeRotation = 0F; 
			this._flowChart.ShowAnchors = MindFusion.FlowChartX.EShowAnchors.saAuto; 
			this._flowChart.ShowDisabledHandles = true; 
			this._flowChart.ShowGrid = true; 
			this._flowChart.ShowScrollbars = true; 
			this._flowChart.ShowToolTips = false; 
			this._flowChart.Size = new System.Drawing.Size(488, 240); 
			this._flowChart.SnapToAnchor = MindFusion.FlowChartX.ESnapToAnchor.saOnCreateOrModify; 
			this._flowChart.TabIndex = 7; 
			this._flowChart.TableCaption = "Table"; 
			this._flowChart.TableCaptionHeight = 5F; 
			this._flowChart.TableCellBorders = MindFusion.FlowChartX.ECellBorders.cbSystem3D; 
			this._flowChart.TableColumnsCount = 2; 
			this._flowChart.TableColWidth = 18F; 
			this._flowChart.TableFillColor = System.Drawing.Color.FromArgb(((System.Byte)(180)), ((System.Byte)(160)), ((System.Byte)(160))); 
			this._flowChart.TableFrameColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0))); 
			this._flowChart.TableLinkStyle = MindFusion.FlowChartX.ETableLinkStyle.tlsRows; 
			this._flowChart.TableRowHeight = 6F; 
			this._flowChart.TableRowsCount = 4; 
			this._flowChart.TableSelStyle = MindFusion.FlowChartX.ESelStyle.sstDashFrame; 
			this._flowChart.TablesExpandable = false; 
			this._flowChart.TablesScrollable = false; 
			this._flowChart.TableStyle = MindFusion.FlowChartX.ETableStyle.tsRect; 
			this._flowChart.TextColor = System.Drawing.Color.Black; 
			this._flowChart.ToolTip = ""; 
			this._flowChart.ZoomFactor = ((short)(100)); 
			this._flowChart.BoxDeactivated += new MindFusion.FlowChartX.BoxEvent(this.FlowChart_OnBoxDeactivated); 
			this._flowChart.DragDrop += new System.Windows.Forms.DragEventHandler(this.FlowChart_OnDrop); 
			this._flowChart.BoxActivated += new MindFusion.FlowChartX.BoxEvent(this.FlowChart_OnBoxActivated); 
			this._flowChart.DragOver += new System.Windows.Forms.DragEventHandler(this.FlowChart_OnDragOver); 
			this._flowChart.BoxClicked += new MindFusion.FlowChartX.BoxMouseEvent(this.FlowChart_OnBoxClicked); 
			this._flowChart.ArrowClicked += new MindFusion.FlowChartX.ArrowMouseEvent(this.FlowChart_OnArrowClicked); 
			this._flowChart.Click += new System.EventHandler(this._flowChart_Click); 
			this._flowChart.BackBrush = MindFusion.FlowChartX.Brush.Deserialize("solid;#FFD4D0C8"); 
			this._flowChart.BoxBrush = MindFusion.FlowChartX.Brush.Deserialize("solid;#FF00BFFF"); 
			this._flowChart.TableBrush = MindFusion.FlowChartX.Brush.Deserialize("solid;#FFB4A0A0"); 
			this._flowChart.ArrowBrush = MindFusion.FlowChartX.Brush.Deserialize("solid;#FFFFFFFF"); 
			this._flowChart.BoxPen = MindFusion.FlowChartX.Pen.Deserialize("pen;0;#FF000000;0;0;0;"); 
			this._flowChart.TablePen = MindFusion.FlowChartX.Pen.Deserialize("pen;0;#FF000000;0;0;0;"); 
			this._flowChart.ArrowPen = MindFusion.FlowChartX.Pen.Deserialize("pen;0;#FF000000;0;0;0;"); 
			this._flowChart.TextFormat = new System.Drawing.StringFormat(); 
			this._flowChart.TextFormat.Alignment = System.Drawing.StringAlignment.Center; 
			this._flowChart.TextFormat.LineAlignment = System.Drawing.StringAlignment.Center; 
			//  
			// _rightPanel 
			//  
			this._rightPanel.Controls.Add(this._propertyGrid); 
			this._rightPanel.Controls.Add(this._splitter2); 
			this._rightPanel.Controls.Add(this._tab); 
			this._rightPanel.Location = new System.Drawing.Point(0, 240); 
			this._rightPanel.Name = "_rightPanel"; 
			this._rightPanel.Size = new System.Drawing.Size(488, 224); 
			this._rightPanel.TabIndex = 8; 
			this._rightPanel.Paint += new System.Windows.Forms.PaintEventHandler(this._rightPanel_Paint); 
			//  
			// _propertyGrid 
			//  
			this._propertyGrid.CommandsVisibleIfAvailable = true; 
			this._propertyGrid.Cursor = System.Windows.Forms.Cursors.HSplit; 
			this._propertyGrid.LargeButtons = false; 
			this._propertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar; 
			this._propertyGrid.Location = new System.Drawing.Point(240, 8); 
			this._propertyGrid.Name = "_propertyGrid"; 
			this._propertyGrid.Size = new System.Drawing.Size(240, 208); 
			this._propertyGrid.TabIndex = 2; 
			this._propertyGrid.Text = "propertyGrid1"; 
			this._propertyGrid.ViewBackColor = System.Drawing.SystemColors.Window; 
			this._propertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText; 
			this._propertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.OnPropertyValueChanged); 
			//  
			// _splitter2 
			//  
			this._splitter2.Dock = System.Windows.Forms.DockStyle.Top; 
			this._splitter2.Location = new System.Drawing.Point(0, 0); 
			this._splitter2.Name = "_splitter2"; 
			this._splitter2.Size = new System.Drawing.Size(488, 3); 
			this._splitter2.TabIndex = 1; 
			this._splitter2.TabStop = false; 
			//  
			// _tab 
			//  
			this._tab.Appearance = System.Windows.Forms.TabAppearance.FlatButtons; 
			this._tab.Controls.Add(this._tabNodes); 
			this._tab.Controls.Add(this._tabConnectors); 
			this._tab.HotTrack = true; 
			this._tab.Location = new System.Drawing.Point(0, 0); 
			this._tab.Name = "_tab"; 
			this._tab.SelectedIndex = 0; 
			this._tab.Size = new System.Drawing.Size(240, 224); 
			this._tab.TabIndex = 0; 
			//  
			// _tabNodes 
			//  
			this._tabNodes.Controls.Add(this._nodeList); 
			this._tabNodes.Location = new System.Drawing.Point(4, 24); 
			this._tabNodes.Name = "_tabNodes"; 
			this._tabNodes.Size = new System.Drawing.Size(232, 196); 
			this._tabNodes.TabIndex = 0; 
			this._tabNodes.Text = "Nodes"; 
			//  
			// _nodeList 
			//  
			this._nodeList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 
			this._nodeList.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; 
			this._nodeList.ForeColor = System.Drawing.SystemColors.WindowText; 
			this._nodeList.Location = new System.Drawing.Point(0, -8); 
			this._nodeList.Name = "_nodeList"; 
			this._nodeList.Size = new System.Drawing.Size(232, 200); 
			this._nodeList.Sorted = true; 
			this._nodeList.TabIndex = 7; 
			this._nodeList.MouseDown += new System.Windows.Forms.MouseEventHandler(this.NodeList_OnMouseDown); 
			this._nodeList.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.NodeList_OnMeasureItem); 
			this._nodeList.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.NodeList_OnDrawItem); 
			//  
			// _tabConnectors 
			//  
			this._tabConnectors.Controls.Add(this._connectorList); 
			this._tabConnectors.Controls.Add(this._connectorTypeCombo); 
			this._tabConnectors.Location = new System.Drawing.Point(4, 24); 
			this._tabConnectors.Name = "_tabConnectors"; 
			this._tabConnectors.Size = new System.Drawing.Size(232, 196); 
			this._tabConnectors.TabIndex = 1; 
			this._tabConnectors.Text = "Connectors"; 
			//  
			// _connectorList 
			//  
			this._connectorList.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 
			this._connectorList.Dock = System.Windows.Forms.DockStyle.Fill; 
			this._connectorList.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; 
			this._connectorList.Location = new System.Drawing.Point(0, 0); 
			this._connectorList.Name = "_connectorList"; 
			this._connectorList.Size = new System.Drawing.Size(232, 176); 
			this._connectorList.TabIndex = 2; 
			this._connectorList.MeasureItem += new System.Windows.Forms.MeasureItemEventHandler(this.ConnectorList_OnMeasureItem); 
			this._connectorList.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ConnectorList_OnDrawItem); 
			this._connectorList.SelectedIndexChanged += new System.EventHandler(this.ConnectorList_OnSelectionChanged); 
			//  
			// _connectorTypeCombo 
			//  
			this._connectorTypeCombo.Dock = System.Windows.Forms.DockStyle.Bottom; 
			this._connectorTypeCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 
			this._connectorTypeCombo.Items.AddRange(new object[] { 
																	 "Polyline", 
																	 "Bezier", 
																	 "Perpendicular"}); 
			this._connectorTypeCombo.Location = new System.Drawing.Point(0, 176); 
			this._connectorTypeCombo.Name = "_connectorTypeCombo"; 
			this._connectorTypeCombo.Size = new System.Drawing.Size(232, 20); 
			this._connectorTypeCombo.TabIndex = 1; 
			this._connectorTypeCombo.SelectedValueChanged += new System.EventHandler(this.ConnectorTypeCombo_OnSelectedValueChange); 
			//  
			// _openFileDialog 
			//  
			this._openFileDialog.DefaultExt = "fcs"; 
			this._openFileDialog.FileName = "Flowchart"; 
			this._openFileDialog.Filter = "FlowCharter documents|*.fcs|All files|*.*"; 
			this._openFileDialog.Title = "Open document"; 
			//  
			// _saveFileDialog 
			//  
			this._saveFileDialog.DefaultExt = "fcs"; 
			this._saveFileDialog.FileName = "Flowchart"; 
			this._saveFileDialog.Filter = "FlowCharter documents|*.fcs|All files|*.*"; 
			this._saveFileDialog.Title = "Save document"; 
			//  
			// _contextMenu 
			//  
			this._contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { 
																						 this._menuItemDelete}); 
			//  
			// _menuItemDelete 
			//  
			this._menuItemDelete.Index = 0; 
			this._menuItemDelete.Text = "Delete"; 
			this._menuItemDelete.Click += new System.EventHandler(this.OnDelete); 
			//  
			// panel1 
			//  
			this.panel1.Controls.Add(this._hidden); 
			this.panel1.Controls.Add(this._flowChart); 
			this.panel1.Location = new System.Drawing.Point(0, 8); 
			this.panel1.Name = "panel1"; 
			this.panel1.Size = new System.Drawing.Size(488, 240); 
			this.panel1.TabIndex = 9; 
			//  
			// MainForm 
			//  
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); 
			this.ClientSize = new System.Drawing.Size(592, 505); 
			this.Controls.Add(this._borderPanel); 
			this.Controls.Add(this._rightPanel); 
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 
			this.Menu = this._mainMenu; 
			this.Name = "MainForm"; 
			this.Text = "FlowCharter"; 
			this._borderPanel.ResumeLayout(false); 
			this._rightPanel.ResumeLayout(false); 
			this._tab.ResumeLayout(false); 
			this._tabNodes.ResumeLayout(false); 
			this._tabConnectors.ResumeLayout(false); 
			this.panel1.ResumeLayout(false); 
			this.ResumeLayout(false); 
 
		} 
		#endregion 
 
		///  
		/// The main entry point for the application. 
		///  
		[STAThread] 
		static void Main()  
		{ 
			Application.Run(new MainForm()); 
		} 
 
 
		#region hidden 
		private void ListBox_DrawItem(ListBox lb, System.Windows.Forms.DrawItemEventArgs e) 
		{ 
			Rectangle rcc; 
			RectangleF rc; 
 
			System.Drawing.SolidBrush brush; 
			System.Drawing.Pen selPen; 
			System.Drawing.SolidBrush selBrush; 
			StringFormat sf; 
 
			rcc = e.Bounds; 
			rcc.Inflate(-1, -1); 
			rc = new RectangleF((float)e.Bounds.Left + 32, 
				(float)e.Bounds.Top, (float)e.Bounds.Width - 32, 
				(float)e.Bounds.Height); 
 
			brush = new System.Drawing.SolidBrush(Color.Black); 
			selPen = new System.Drawing.Pen(Color.Goldenrod); 
			selBrush = new System.Drawing.SolidBrush(Color.LightYellow); 
 
			sf = StringFormat.GenericDefault; 
			sf.LineAlignment = StringAlignment.Center; 
 
			// Draw the selection if any 
			if((e.State & DrawItemState.Selected) > 0) 
			{ 
				e.Graphics.FillRectangle(selBrush, rcc); 
				e.Graphics.DrawRectangle(selPen, rcc); 
			} 
			else 
			{ 
				System.Drawing.SolidBrush tb = new 
					System.Drawing.SolidBrush(Color.White); 
				e.Graphics.FillRectangle(tb, e.Bounds); 
				tb.Dispose(); 
			} 
 
			e.Graphics.DrawString((string)lb.Items[e.Index], 
				_nodeList.Font, brush, rc, sf); 
 
			brush.Dispose(); 
			selPen.Dispose(); 
			selBrush.Dispose(); 
		} 
 
		private void NodeList_OnMeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e) 
		{ 
			e.ItemHeight = 32; 
		} 
 
		private void NodeList_OnDrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) 
		{ 
			if(e.Index < 0) 
				return; 
 
			// Draw the item 
			ListBox_DrawItem(_nodeList, e); 
 
			if((e.State & DrawItemState.Selected) > 0) 
				_hidden.BackColor = Color.LightYellow; 
			else 
				_hidden.BackColor = Color.White; 
 
			// Draw the node 
			Box b; 
			_hidden.ClearAll(); 
			b = _hidden.CreateBox(1, 1, 24, 24); 
			b.ShapeTemplate = _nodes[e.Index].Template; 
			b.Style = EBoxStyle.bsComplex; 
 
			Bitmap bmp = _hidden.CreateBmpFromChart(); 
			Rectangle rci = new Rectangle(e.Bounds.Left + 3, 
				e.Bounds.Top + 4, 24, 24); 
			e.Graphics.DrawImage(bmp, rci, 1, 1, 26, 26, 
				GraphicsUnit.Pixel); 
			bmp.Dispose(); 
		} 
 
		private void ConnectorList_OnMeasureItem(object sender, System.Windows.Forms.MeasureItemEventArgs e) 
		{ 
			e.ItemHeight = 32; 
		} 
 
		private void ConnectorList_OnDrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) 
		{ 
			if(e.Index < 0) 
				return; 
 
			// Draw the item 
			ListBox_DrawItem(_connectorList, e); 
 
			if((e.State & DrawItemState.Selected) > 0) 
				_hidden.BackColor = Color.LightYellow; 
			else 
				_hidden.BackColor = Color.White; 
 
			// Draw the node 
			Box b1, b2; 
			Arrow a; 
			_hidden.ClearAll(); 
			b1 = _hidden.CreateBox(-4, 1, 5, 24); 
			b2 = _hidden.CreateBox(18, 1, 5, 24); 
			a = _hidden.CreateArrow(b1, b2); 
			b1.Visible = false; 
			b2.Visible = false; 
			a.ArrowHead = _connectors[e.Index].Head; 
 
			Bitmap bmp = _hidden.CreateBmpFromChart(); 
			Rectangle rci = new Rectangle(e.Bounds.Left + 3, 
				e.Bounds.Top + 4, 24, 24); 
			e.Graphics.DrawImage(bmp, rci, 1, 1, 26, 26, 
				GraphicsUnit.Pixel); 
			bmp.Dispose(); 
		} 
 
		private void ConnectorList_OnSelectionChanged(object sender, System.EventArgs e) 
		{ 
			int si = _connectorList.SelectedIndex; 
			if(si < 0 || si >= _connectors.Length) 
				return; 
 
			_flowChart.ArrowHead = _connectors[si].Head; 
		} 
 
		private void NodeList_OnMouseDown(object sender, System.Windows.Forms.MouseEventArgs e) 
		{ 
			DoDragDrop(new NodeDragItem(_nodeList.SelectedIndex), 
				DragDropEffects.Copy); 
		} 
 
		private void FlowChart_OnDragOver(object sender, System.Windows.Forms.DragEventArgs e) 
		{ 
			if(e.Data.GetDataPresent(NodeDragItem._GetType())) 
			{ 
				e.Effect = DragDropEffects.Copy; 
			} 
			else 
			{ 
				e.Effect = DragDropEffects.None; 
			} 
		} 
 
		private void FlowChart_OnDrop(object sender, System.Windows.Forms.DragEventArgs e) 
		{ 
			if(e.Data.GetDataPresent(NodeDragItem._GetType())) 
			{ 
				NodeDragItem sdi = (NodeDragItem)e.Data.GetData(NodeDragItem._GetType()); 
 
				if(sdi.Index >= 0 && sdi.Index < _nodes.Length) 
				{ 
					Point p = _flowChart.PointToClient(new Point(e.X, e.Y)); 
					PointF pt = _flowChart.ClientToDoc(new Point(p.X, p.Y)); 
 
					AnchorPattern ap = _nodes[sdi.Index].Anchor; 
					foreach(AnchorPoint point in ap.Points) 
					{ 
						point.MarkStyle = _anchorStyle; 
						point.Color = _anchorColor; 
					} 
 
					Box b = _flowChart.CreateBox(pt.X, pt.Y, 20, 20); 
					b.Style = EBoxStyle.bsComplex; 
					b.ShapeTemplate = _nodes[sdi.Index].Template; 
					b.AssignAnchorPattern(ap); 
					b.SelStyle = ESelStyle.sstDashFrame; 
				} 
			} 
		} 
 
		private void FlowChart_OnBoxActivated(object sender, MindFusion.FlowChartX.BoxEventArgs e) 
		{ 
			_selected = new NodeProps(); 
			_selected.Text = e.box.Text; 
			_selected.Font = e.box.Font; 
			_selected.FillColor = e.box.FillColor; 
 
			_propertyGrid.SelectedObject = _selected; 
		} 
 
		private void FlowChart_OnBoxDeactivated(object sender, MindFusion.FlowChartX.BoxEventArgs e) 
		{ 
			_propertyGrid.SelectedObject = null; 
			_selected = null; 
		} 
 
		private void FlowChart_OnBoxClicked(object sender, MindFusion.FlowChartX.BoxMouseArgs e) 
		{ 
			if(e.button != MouseButtons.Right) 
				return; 
 
			Point pt = _flowChart.DocToClient( 
				new PointF(e.x + e.box.BoundingRect.Left, 
				e.y + e.box.BoundingRect.Top)); 
 
            _contextMenu.Show(_flowChart, pt); 
		} 
 
		private void FlowChart_OnArrowClicked(object sender, MindFusion.FlowChartX.ArrowMouseArgs e) 
		{ 
			if(e.button != MouseButtons.Right) 
				return; 
 
			Point pt = _flowChart.DocToClient( 
				new PointF(e.x + e.arrow.BoundingRect.Left, 
				e.y + e.arrow.BoundingRect.Top)); 
 
			_contextMenu.Show(_flowChart, pt); 
		} 
 
		private void OnPropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e) 
		{ 
			if(_flowChart.Selection.Boxes.Count == 0) 
				return; 
 
			Box b = _flowChart.Selection.Boxes[0]; 
			if(b == null) 
				return; 
 
			// Create undo record 
			MindFusion.FlowChartX.Commands.ChangeItemCmd cmd =  
				new MindFusion.FlowChartX.Commands.ChangeItemCmd(b, "Property change"); 
 
			b.Text = _selected.Text; 
			b.Font = _selected.Font; 
			b.FillColor = _selected.FillColor; 
 
			cmd.Execute(); 
		} 
 
		private void OnFileNew(object sender, System.EventArgs e) 
		{ 
			_flowChart.ClearAll(); 
		} 
 
		private void OnFileOpen(object sender, System.EventArgs e) 
		{ 
			if(_openFileDialog.ShowDialog(this) == DialogResult.OK) 
			{ 
				try 
				{ 
					_flowChart.LoadFromFile(_openFileDialog.FileName); 
				} 
				catch 
				{ 
					MessageBox.Show(this, "Failed to open document!"); 
				} 
			} 
		} 
 
		private void OnFileSave(object sender, System.EventArgs e) 
		{ 
			if(_saveFileDialog.ShowDialog(this) == DialogResult.OK) 
			{ 
				_flowChart.SaveToFile(_saveFileDialog.FileName, true); 
			} 
		} 
 
		private void OnPrintPreview(object sender, System.EventArgs e) 
		{ 
			_flowChart.PrintOptions.DocumentName = "Flowchart"; 
			_flowChart.PrintOptions.EnableImages = false; 
			_flowChart.PrintOptions.EnableInterior = true; 
			_flowChart.PrintOptions.EnableShadows = true; 
			_flowChart.PrintOptions.Scale = 100; 
			_flowChart.PrintPreview(); 
		} 
 
		private void OnPrint(object sender, System.EventArgs e) 
		{ 
			_flowChart.PrintOptions.DocumentName = "Flowchart"; 
			_flowChart.PrintOptions.EnableImages = false; 
			_flowChart.PrintOptions.EnableInterior = true; 
			_flowChart.PrintOptions.EnableShadows = true; 
			_flowChart.PrintOptions.Scale = 100; 
			_flowChart.Print(); 
		} 
 
		private void OnExit(object sender, System.EventArgs e) 
		{ 
			this.Close(); 
		} 
 
		private void OnAbout(object sender, System.EventArgs e) 
		{ 
			AboutDialog dlg = new AboutDialog(); 
 
			dlg.ShowDialog(this); 
		} 
 
		private void ConnectorTypeCombo_OnSelectedValueChange(object sender, System.EventArgs e) 
		{ 
			EArrowStyle ast = EArrowStyle.asPolyline; 
			short segments = 1; 
 
			switch(_connectorTypeCombo.SelectedIndex) 
			{ 
				case 0: 
					ast = EArrowStyle.asPolyline; 
					break; 
				case 1: 
					ast = EArrowStyle.asBezier; 
					break; 
				case 2: 
					ast = EArrowStyle.asPerpendicular; 
					segments = 3; 
					break; 
			} 
 
			_flowChart.ArrowStyle = ast; 
			_flowChart.ArrowSegments = segments; 
		} 
		private void OnDelete(object sender, System.EventArgs e) 
		{ 
			if(_flowChart.Selection.Boxes.Count > 0) 
				_flowChart.DeleteObject(_flowChart.Selection.Boxes[0]); 
			if(_flowChart.Selection.Arrows.Count > 0) 
				_flowChart.DeleteObject(_flowChart.Selection.Arrows[0]); 
		} 
		#endregion 
 
 
 
	 
		 
		private void OnOptions(object sender, System.EventArgs e) 
		{ 
			OptionsDialog dlg = new OptionsDialog(); 
 
			dlg.ShowGrid = _flowChart.ShowGrid; 
			dlg.BackgroundColor = _flowChart.BackColor; 
			dlg.NodeColor = _flowChart.BoxFillColor; 
			dlg.ConnectorColor = _flowChart.ArrowFillColor; 
			dlg.AnchorColor = _anchorColor; 
 
			dlg.ShowAnchors = _flowChart.ShowAnchors != EShowAnchors.saNever; 
			switch(_anchorStyle) 
			{ 
				case EMarkStyle.msCircle: 
					dlg.AnchorStyle = 0; 
					break; 
				case EMarkStyle.msRect: 
					dlg.AnchorStyle = 1; 
					break; 
				case EMarkStyle.msX: 
					dlg.AnchorStyle = 2; 
					break; 
				default: 
					dlg.AnchorStyle = 0; 
					break; 
			} 
 
			if(dlg.ShowDialog(this) == DialogResult.OK) 
			{ 
				_flowChart.ShowGrid = dlg.ShowGrid; 
				_flowChart.BackColor = dlg.BackgroundColor; 
				_flowChart.BoxFillColor = dlg.NodeColor; 
				_flowChart.ArrowFillColor = dlg.ConnectorColor; 
				_anchorColor = dlg.AnchorColor; 
 
				_flowChart.ShowAnchors = dlg.ShowAnchors ? 
					EShowAnchors.saAuto : EShowAnchors.saNever; 
				switch(dlg.AnchorStyle) 
				{ 
					case 0: 
						_anchorStyle = EMarkStyle.msCircle; 
						break; 
					case 1: 
						_anchorStyle = EMarkStyle.msRect; 
						break; 
					case 2: 
						_anchorStyle = EMarkStyle.msX; 
						break; 
					default: 
						_anchorStyle = EMarkStyle.msCircle; 
						break; 
				} 
			} 
		} 
 
		private void OnEditPopup(object sender, System.EventArgs e) 
		{ 
			if (_flowChart.UndoManager.History.NextUndo != null) 
			{ 
				_menuUndo.Enabled = true; 
				_menuUndo.Text = "Undo " + _flowChart.UndoManager.History.NextUndo.Title; 
			} 
			else 
			{ 
				_menuUndo.Enabled = false; 
				_menuUndo.Text = "Undo"; 
			} 
			if (_flowChart.UndoManager.History.NextRedo != null) 
			{ 
				_menuRedo.Enabled = true; 
				_menuRedo.Text = "Redo " + _flowChart.UndoManager.History.NextRedo.Title; 
			} 
			else 
			{ 
				_menuRedo.Enabled = false; 
				_menuRedo.Text = "Redo"; 
			} 
		} 
 
		private void OnUndo(object sender, System.EventArgs e) 
		{ 
			_flowChart.UndoManager.Undo(); 
		} 
 
		private void OnRedo(object sender, System.EventArgs e) 
		{ 
			_flowChart.UndoManager.Redo(); 
		} 
 
		private void _rightPanel_Paint(object sender, System.Windows.Forms.PaintEventArgs e) 
		{ 
		 
		} 
 
		private void _flowChart_Click(object sender, System.EventArgs e) 
		{ 
		 
		} 
 
	} 
}