public Form1() { InitializeComponent(); //Code to fetch the German resources at run time. Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de-DE"); //Load a diagram. diagram1.Model.RenderingStyle.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; SymbolPalette palette = new SymbolPalette(); #if !NETCORE palette = palette.FromFile(@"..\..\..\..\..\..\common\Data\Diagram\edp\Flowchart Symbols.edp"); #else palette = palette.FromFile(@"..\..\..\..\..\..\..\common\Data\Diagram\edp\Flowchart Symbols.edp"); #endif Node start = palette.Nodes["On-page reference"]; start.PinPoint = new PointF(70, 70); start.Size = new SizeF(80, 80); ((PathNode)start).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(start, "Start")); diagram1.Model.AppendChild(start); Node decision = palette.Nodes["Decision"]; decision.PinPoint = new PointF(270, 70); decision.Size = new SizeF(100, 100); ((PathNode)decision).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(decision, "Decision")); diagram1.Model.AppendChild(decision); Node document = palette.Nodes["Document"]; document.PinPoint = new PointF(470, 70); document.Size = new SizeF(120, 80); ((PathNode)document).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(document, "Document")); diagram1.Model.AppendChild(document); Node process = palette.Nodes["Process"]; process.PinPoint = new PointF(270, 200); process.Size = new SizeF(100, 80); ((PathNode)process).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(process, "Process")); diagram1.Model.AppendChild(process); Node end = palette.Nodes["On-page reference"].Clone() as Node; end.PinPoint = new PointF(270, 320); end.Size = new SizeF(80, 80); ((PathNode)end).Labels.Clear(); ((PathNode)end).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(end, "End")); diagram1.Model.AppendChild(end); ConnectNodes(start, decision, false); ConnectNodes(decision, document, false); ConnectNodes(document, process, true); ConnectNodes(decision, process, false); ConnectNodes(process, end, false); diagram1.Model.BackgroundStyle.Color = Color.White; foreach (Node node in diagram1.Model.Nodes) { node.EditStyle.AllowSelect = false; } diagram1.View.Grid.Visible = false; diagram1.View.SelectionList.Clear(); }
private void Form1_Load(object sender, EventArgs e) { SymbolPalette palette = new SymbolPalette(); #if !NETCORE palette = palette.FromFile(@"..\..\..\..\..\..\..\Common\Data\Diagram\edp\Flowchart Symbols.edp"); #else palette = palette.FromFile(@"..\..\..\..\..\..\..\..\Common\Data\Diagram\edp\Flowchart Symbols.edp"); #endif Node start = palette.Nodes["On-page reference"]; start.PinPoint = new PointF(70, 100); start.Size = new SizeF(80, 80); ((PathNode)start).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(start, "Start")); diagram1.Model.AppendChild(start); Node decision = palette.Nodes["Decision"]; decision.PinPoint = new PointF(270, 100); decision.Size = new SizeF(100, 100); ((PathNode)decision).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(decision, "Decision")); diagram1.Model.AppendChild(decision); Node document = palette.Nodes["Document"]; document.PinPoint = new PointF(470, 100); document.Size = new SizeF(120, 80); ((PathNode)document).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(document, "Document")); diagram1.Model.AppendChild(document); Node process = palette.Nodes["Process"]; process.PinPoint = new PointF(270, 230); process.Size = new SizeF(100, 80); ((PathNode)process).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(process, "Process")); diagram1.Model.AppendChild(process); Node end = palette.Nodes["On-page reference"].Clone() as Node; end.PinPoint = new PointF(270, 350); end.Size = new SizeF(80, 80); ((PathNode)end).Labels.Clear(); ((PathNode)end).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(end, "End")); diagram1.Model.AppendChild(end); ConnectNodes(start, decision, false); ConnectNodes(decision, document, false); ConnectNodes(document, process, true); ConnectNodes(decision, process, false); ConnectNodes(process, end, false); DiagramAppearance(); this.colorPickerButton1.BackColor = this.diagram1.View.HandleRenderer.HandleOutlineColor; this.colorPickerButton2.BackColor = this.diagram1.View.HandleRenderer.HandleColor; }
private void InitializeDiagramNodes() { SymbolPalette palette = new SymbolPalette(); #if !NETCORE palette = palette.FromFile(@"..\..\..\..\..\..\common\Data\Diagram\edp\Flowchart Symbols.edp"); #else palette = palette.FromFile(@"..\..\..\..\..\..\..\common\Data\Diagram\edp\Flowchart Symbols.edp"); #endif Node start = palette.Nodes["On-page reference"]; start.PinPoint = new PointF(70, 100); start.Size = new SizeF(80, 80); ((PathNode)start).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(start, "Start")); diagram1.Model.AppendChild(start); Node decision = palette.Nodes["Decision"]; decision.PinPoint = new PointF(270, 100); decision.Size = new SizeF(100, 100); ((PathNode)decision).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(decision, "Decision")); diagram1.Model.AppendChild(decision); Node document = palette.Nodes["Document"]; document.PinPoint = new PointF(470, 100); document.Size = new SizeF(120, 80); ((PathNode)document).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(document, "Document")); diagram1.Model.AppendChild(document); Node process = palette.Nodes["Process"]; process.PinPoint = new PointF(270, 230); process.Size = new SizeF(100, 80); ((PathNode)process).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(process, "Process")); diagram1.Model.AppendChild(process); Node end = palette.Nodes["On-page reference"].Clone() as Node; end.PinPoint = new PointF(270, 350); end.Size = new SizeF(80, 80); ((PathNode)end).Labels.Clear(); ((PathNode)end).Labels.Add(new Syncfusion.Windows.Forms.Diagram.Label(end, "End")); diagram1.Model.AppendChild(end); ConnectNodes(start, decision, false); ConnectNodes(decision, document, false); ConnectNodes(document, process, true); ConnectNodes(decision, process, false); ConnectNodes(process, end, false); DiagramAppearance(); }