{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "diagram-org-chart-layout",
  "framework": "winforms",
  "type": "registry:component",
  "component": "Diagram",
  "variant": "org-chart-layout",
  "dependencies": [
    "Syncfusion.Diagram.Windows"
  ],
  "description": "Diagram that renders an organization chart with hierarchical node positioning, parent child connectors and per role styling.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/winforms/llms.txt",
    "skillPack": "syncfusion/winforms-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/winforms/diagram-org-chart-layout.md"
  },
  "files": [
    {
      "target": "src/components/diagram-org-chart-layout/diagram.Designer.cs",
      "content": "namespace OrgChartLayout\n{\n    public partial class Form1\n    {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing)\n        {\n            if (disposing && (components != null))\n            {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Windows Form Designer generated code\n\n        /// <summary>\n        /// Required method for Designer support - do not modify\n        /// the contents of this method with the code editor.\n        /// </summary>\n        private void InitializeComponent()\n        {\n            this.components = new System.ComponentModel.Container();\n            this.panel2 = new System.Windows.Forms.Panel();\n            this.expanderPanel2 = new System.Windows.Forms.Panel();\n            this.bShape = new System.Windows.Forms.Label();\n            this.expSymShapeLbl = new System.Windows.Forms.Label();\n            this.comboBShape = new System.Windows.Forms.ComboBox();\n            this.comboExpSymbol = new System.Windows.Forms.ComboBox();\n            this.expanderPanel1 = new System.Windows.Forms.Panel();\n            this.label1 = new System.Windows.Forms.Label();\n            this.vSpacing = new System.Windows.Forms.Label();\n            this.hSpacing = new System.Windows.Forms.Label();\n            this.apply = new System.Windows.Forms.Button();\n            this.txtHSpacing = new System.Windows.Forms.TextBox();\n            this.chkAutoLayout = new System.Windows.Forms.CheckBox();\n            this.txtVSpacing = new System.Windows.Forms.TextBox();\n            this.txtTMarigin = new System.Windows.Forms.TextBox();\n            this.lMarigin = new System.Windows.Forms.Label();\n            this.tMarigin = new System.Windows.Forms.Label();\n            this.txtLMarigin = new System.Windows.Forms.TextBox();\n            this.lytTypLbl = new System.Windows.Forms.Label();\n            this.comboLytType = new System.Windows.Forms.ComboBox();\n            this.diagram1 = new Syncfusion.Windows.Forms.Diagram.Controls.Diagram(this.components);\n            this.model1 = new Syncfusion.Windows.Forms.Diagram.Model(this.components);\n            this.lytProp = new System.Windows.Forms.Label();\n            this.label2 = new System.Windows.Forms.Label();\n            this.panel2.SuspendLayout();\n            this.expanderPanel2.SuspendLayout();\n            this.expanderPanel1.SuspendLayout();\n            ((System.ComponentModel.ISupportInitialize)(this.diagram1)).BeginInit();\n            ((System.ComponentModel.ISupportInitialize)(this.model1)).BeginInit();\n            this.SuspendLayout();\n            // \n            // panel2\n            // \n            this.panel2.Controls.Add(this.expanderPanel2);\n            this.panel2.Controls.Add(this.expanderPanel1);\n            this.panel2.Dock = System.Windows.Forms.DockStyle.Right;\n            this.panel2.Location = new System.Drawing.Point(751, 2);\n            this.panel2.Name = \"panel2\";\n            this.panel2.Size = new System.Drawing.Size(279, 607);\n            this.panel2.TabIndex = 2;\n            // \n            // expanderPanel2\n            // \n            this.expanderPanel2.BackColor = System.Drawing.Color.White;\n            this.expanderPanel2.Controls.Add(this.label2);\n            this.expanderPanel2.Controls.Add(this.bShape);\n            this.expanderPanel2.Controls.Add(this.expSymShapeLbl);\n            this.expanderPanel2.Controls.Add(this.comboBShape);\n            this.expanderPanel2.Controls.Add(this.comboExpSymbol);\n            this.expanderPanel2.Dock = System.Windows.Forms.DockStyle.Fill;\n            this.expanderPanel2.Location = new System.Drawing.Point(0, 344);\n            this.expanderPanel2.Name = \"expanderPanel2\";\n            this.expanderPanel2.Padding = new System.Windows.Forms.Padding(10, 10, 10, 10);\n            this.expanderPanel2.Size = new System.Drawing.Size(279, 263);\n            this.expanderPanel2.TabIndex = 1;\n            // \n            // bShape\n            // \n            this.bShape.AutoSize = true;\n            this.bShape.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.bShape.Location = new System.Drawing.Point(13, 55);\n            this.bShape.Name = \"bShape\";\n            this.bShape.Size = new System.Drawing.Size(106, 15);\n            this.bShape.TabIndex = 3;\n            this.bShape.Text = \"Background Shape\";\n            // \n            // expSymShapeLbl\n            // \n            this.expSymShapeLbl.AutoSize = true;\n            this.expSymShapeLbl.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.expSymShapeLbl.Location = new System.Drawing.Point(13, 91);\n            this.expSymShapeLbl.Name = \"expSymShapeLbl\";\n            this.expSymShapeLbl.Size = new System.Drawing.Size(82, 15);\n            this.expSymShapeLbl.TabIndex = 5;\n            this.expSymShapeLbl.Text = \"Symbol Shape\";\n            // \n            // comboBShape\n            // \n            this.comboBShape.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\n            this.comboBShape.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.comboBShape.FormattingEnabled = true;\n            this.comboBShape.Items.AddRange(new object[] {\n            \"Rectangle\",\n            \"Ellipse\"});\n            this.comboBShape.Location = new System.Drawing.Point(151, 52);\n            this.comboBShape.Name = \"comboBShape\";\n            this.comboBShape.Size = new System.Drawing.Size(104, 23);\n            this.comboBShape.TabIndex = 2;\n            // \n            // comboExpSymbol\n            // \n            this.comboExpSymbol.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\n            this.comboExpSymbol.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.comboExpSymbol.FormattingEnabled = true;\n            this.comboExpSymbol.Items.AddRange(new object[] {\n            \"Triangle\",\n            \"PlusMinus\"});\n            this.comboExpSymbol.Location = new System.Drawing.Point(151, 88);\n            this.comboExpSymbol.Name = \"comboExpSymbol\";\n            this.comboExpSymbol.Size = new System.Drawing.Size(104, 23);\n            this.comboExpSymbol.TabIndex = 4;\n            // \n            // expanderPanel1\n            // \n            this.expanderPanel1.BackColor = System.Drawing.Color.White;\n            this.expanderPanel1.Controls.Add(this.lytProp);\n            this.expanderPanel1.Controls.Add(this.label1);\n            this.expanderPanel1.Controls.Add(this.vSpacing);\n            this.expanderPanel1.Controls.Add(this.hSpacing);\n            this.expanderPanel1.Controls.Add(this.apply);\n            this.expanderPanel1.Controls.Add(this.txtHSpacing);\n            this.expanderPanel1.Controls.Add(this.chkAutoLayout);\n            this.expanderPanel1.Controls.Add(this.txtVSpacing);\n            this.expanderPanel1.Controls.Add(this.txtTMarigin);\n            this.expanderPanel1.Controls.Add(this.lMarigin);\n            this.expanderPanel1.Controls.Add(this.tMarigin);\n            this.expanderPanel1.Controls.Add(this.txtLMarigin);\n            this.expanderPanel1.Controls.Add(this.lytTypLbl);\n            this.expanderPanel1.Controls.Add(this.comboLytType);\n            this.expanderPanel1.Dock = System.Windows.Forms.DockStyle.Top;\n            this.expanderPanel1.Location = new System.Drawing.Point(0, 0);\n            this.expanderPanel1.Name = \"expanderPanel1\";\n            this.expanderPanel1.Padding = new System.Windows.Forms.Padding(10, 10, 10, 10);\n            this.expanderPanel1.Size = new System.Drawing.Size(279, 344);\n            this.expanderPanel1.TabIndex = 0;\n            // \n            // label1\n            // \n            this.label1.AutoSize = true;\n            this.label1.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.label1.Location = new System.Drawing.Point(13, 253);\n            this.label1.Name = \"label1\";\n            this.label1.Size = new System.Drawing.Size(72, 15);\n            this.label1.TabIndex = 45;\n            this.label1.Text = \"Auto Layout\";\n            // \n            // vSpacing\n            // \n            this.vSpacing.AutoSize = true;\n            this.vSpacing.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.vSpacing.Location = new System.Drawing.Point(13, 133);\n            this.vSpacing.Name = \"vSpacing\";\n            this.vSpacing.Size = new System.Drawing.Size(91, 15);\n            this.vSpacing.TabIndex = 37;\n            this.vSpacing.Text = \"Vertical Spacing\";\n            // \n            // hSpacing\n            // \n            this.hSpacing.AutoSize = true;\n            this.hSpacing.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.hSpacing.Location = new System.Drawing.Point(13, 93);\n            this.hSpacing.Name = \"hSpacing\";\n            this.hSpacing.Size = new System.Drawing.Size(107, 15);\n            this.hSpacing.TabIndex = 36;\n            this.hSpacing.Text = \"Horizontal Spacing\";\n            // \n            // apply\n            // \n            this.apply.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(163)))), ((int)(((byte)(0)))));\n            this.apply.FlatAppearance.BorderSize = 0;\n            this.apply.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\n            this.apply.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.apply.ForeColor = System.Drawing.Color.White;\n            this.apply.Location = new System.Drawing.Point(109, 293);\n            this.apply.Name = \"apply\";\n            this.apply.Size = new System.Drawing.Size(80, 30);\n            this.apply.TabIndex = 46;\n            this.apply.Text = \"Apply\";\n            this.apply.UseVisualStyleBackColor = false;\n            // \n            // txtHSpacing\n            // \n            this.txtHSpacing.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.txtHSpacing.Location = new System.Drawing.Point(144, 91);\n            this.txtHSpacing.MaxLength = 3;\n            this.txtHSpacing.Name = \"txtHSpacing\";\n            this.txtHSpacing.Size = new System.Drawing.Size(110, 23);\n            this.txtHSpacing.TabIndex = 38;\n            // \n            // chkAutoLayout\n            // \n            this.chkAutoLayout.AutoSize = true;\n            this.chkAutoLayout.FlatAppearance.BorderSize = 0;\n            this.chkAutoLayout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\n            this.chkAutoLayout.Font = new System.Drawing.Font(\"Arial\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.chkAutoLayout.Location = new System.Drawing.Point(144, 255);\n            this.chkAutoLayout.Name = \"chkAutoLayout\";\n            this.chkAutoLayout.Size = new System.Drawing.Size(12, 11);\n            this.chkAutoLayout.TabIndex = 44;\n            this.chkAutoLayout.UseVisualStyleBackColor = true;\n            // \n            // txtVSpacing\n            // \n            this.txtVSpacing.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.txtVSpacing.Location = new System.Drawing.Point(144, 131);\n            this.txtVSpacing.MaxLength = 3;\n            this.txtVSpacing.Name = \"txtVSpacing\";\n            this.txtVSpacing.Size = new System.Drawing.Size(110, 23);\n            this.txtVSpacing.TabIndex = 39;\n            // \n            // txtTMarigin\n            // \n            this.txtTMarigin.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.txtTMarigin.Location = new System.Drawing.Point(144, 211);\n            this.txtTMarigin.MaxLength = 3;\n            this.txtTMarigin.Name = \"txtTMarigin\";\n            this.txtTMarigin.Size = new System.Drawing.Size(110, 23);\n            this.txtTMarigin.TabIndex = 43;\n            // \n            // lMarigin\n            // \n            this.lMarigin.AutoSize = true;\n            this.lMarigin.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.lMarigin.Location = new System.Drawing.Point(13, 173);\n            this.lMarigin.Name = \"lMarigin\";\n            this.lMarigin.Size = new System.Drawing.Size(71, 15);\n            this.lMarigin.TabIndex = 40;\n            this.lMarigin.Text = \"Left Marigin\";\n            // \n            // tMarigin\n            // \n            this.tMarigin.AutoSize = true;\n            this.tMarigin.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.tMarigin.Location = new System.Drawing.Point(13, 213);\n            this.tMarigin.Name = \"tMarigin\";\n            this.tMarigin.Size = new System.Drawing.Size(72, 15);\n            this.tMarigin.TabIndex = 41;\n            this.tMarigin.Text = \"Top Marigin\";\n            // \n            // txtLMarigin\n            // \n            this.txtLMarigin.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.txtLMarigin.Location = new System.Drawing.Point(144, 171);\n            this.txtLMarigin.MaxLength = 3;\n            this.txtLMarigin.Name = \"txtLMarigin\";\n            this.txtLMarigin.Size = new System.Drawing.Size(110, 23);\n            this.txtLMarigin.TabIndex = 42;\n            // \n            // lytTypLbl\n            // \n            this.lytTypLbl.AutoSize = true;\n            this.lytTypLbl.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.lytTypLbl.Location = new System.Drawing.Point(13, 53);\n            this.lytTypLbl.Name = \"lytTypLbl\";\n            this.lytTypLbl.Size = new System.Drawing.Size(72, 15);\n            this.lytTypLbl.TabIndex = 35;\n            this.lytTypLbl.Text = \"Layout Type\";\n            // \n            // comboLytType\n            // \n            this.comboLytType.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\n            this.comboLytType.Font = new System.Drawing.Font(\"Segoe UI\", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.comboLytType.FormattingEnabled = true;\n            this.comboLytType.Items.AddRange(new object[] {\n            \"WaterFall\",\n            \"Horizontal\"});\n            this.comboLytType.Location = new System.Drawing.Point(144, 51);\n            this.comboLytType.Name = \"comboLytType\";\n            this.comboLytType.Size = new System.Drawing.Size(110, 23);\n            this.comboLytType.TabIndex = 34;\n            // \n            // diagram1\n            // \n            this.diagram1.Controller.PasteOffset = new System.Drawing.SizeF(10F, 10F);\n            this.diagram1.Dock = System.Windows.Forms.DockStyle.Fill;\n            this.diagram1.HScroll = true;\n            this.diagram1.LayoutManager = null;\n            this.diagram1.Location = new System.Drawing.Point(2, 2);\n            this.diagram1.MetroScrollBars = true;\n            this.diagram1.Model = this.model1;\n            this.diagram1.Name = \"diagram1\";\n            this.diagram1.ScrollVirtualBounds = new System.Drawing.RectangleF(0, 0, 0, 0);\n            this.diagram1.Size = new System.Drawing.Size(749, 607);\n            this.diagram1.SmartSizeBox = false;\n            this.diagram1.TabIndex = 2;\n            this.diagram1.Text = \"diagram1\";\n            this.diagram1.Model.LineBridgingEnabled = true;\n            // \n            // \n            // \n            this.diagram1.View.ClientRectangle = new System.Drawing.Rectangle(0, 0, 0, 0);\n            this.diagram1.View.Controller = this.diagram1.Controller;\n            this.diagram1.View.Grid.MinPixelSpacing = 4F;\n            this.diagram1.View.Grid.Visible = false;\n            this.diagram1.View.ScrollVirtualBounds = new System.Drawing.RectangleF(0, 0, 0, 0);\n            this.diagram1.View.ZoomType = Syncfusion.Windows.Forms.Diagram.ZoomType.Center;\n            this.diagram1.VScroll = true;\n            // \n            // model1\n            // \n            this.model1.BackgroundStyle.PathBrushStyle = Syncfusion.Windows.Forms.Diagram.PathGradientBrushStyle.RectangleCenter;\n            this.model1.DocumentScale.DisplayName = \"No Scale\";\n            this.model1.DocumentScale.Height = 1F;\n            this.model1.DocumentScale.Width = 1F;\n            this.model1.DocumentSize.Height = 1169F;\n            this.model1.DocumentSize.Width = 1227F;\n            this.model1.LineStyle.DashPattern = null;\n            this.model1.LineStyle.LineColor = System.Drawing.Color.Black;\n            this.model1.LineStyle.LineWidth = 0F;\n            this.model1.LogicalSize = new System.Drawing.SizeF(1227F, 1169F);\n            this.model1.ShadowStyle.Color = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(105)))), ((int)(((byte)(105)))), ((int)(((byte)(105)))));\n            this.model1.ShadowStyle.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(105)))), ((int)(((byte)(105)))), ((int)(((byte)(105)))));\n            // \n            // lytProp\n            // \n            this.lytProp.AutoEllipsis = true;\n            this.lytProp.BackColor = System.Drawing.Color.White;\n            this.lytProp.Font = new System.Drawing.Font(\"Arial\", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.lytProp.Location = new System.Drawing.Point(13, 20);\n            this.lytProp.Name = \"lytProp\";\n            this.lytProp.Size = new System.Drawing.Size(99, 20);\n            this.lytProp.TabIndex = 47;\n            this.lytProp.Text = \"Properties\";\n            // \n            // label2\n            // \n            this.label2.AutoEllipsis = true;\n            this.label2.BackColor = System.Drawing.Color.White;\n            this.label2.Font = new System.Drawing.Font(\"Arial\", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\n            this.label2.Location = new System.Drawing.Point(13, 19);\n            this.label2.Name = \"label2\";\n            this.label2.Size = new System.Drawing.Size(99, 20);\n            this.label2.TabIndex = 39;\n            this.label2.Text = \"Expander\";\n            // \n            // Form1\n            // \n            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n            this.ClientSize = new System.Drawing.Size(1032, 611);\n            this.Controls.Add(this.diagram1);\n            this.Controls.Add(this.panel2);\n            this.Name = \"Form1\";\n            this.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);\n            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\n            this.Text = \"OrgChartLayout\";\n            this.Load += new System.EventHandler(this.Form1_Load);\n            this.panel2.ResumeLayout(false);\n            this.expanderPanel2.ResumeLayout(false);\n            this.expanderPanel2.PerformLayout();\n            this.expanderPanel1.ResumeLayout(false);\n            this.expanderPanel1.PerformLayout();\n            ((System.ComponentModel.ISupportInitialize)(this.diagram1)).EndInit();\n            ((System.ComponentModel.ISupportInitialize)(this.model1)).EndInit();\n            this.ResumeLayout(false);\n\n        }\n\n        #endregion\n\n       \n        private System.Windows.Forms.Panel panel2;\n        private System.Windows.Forms.Panel expanderPanel2;\n        private System.Windows.Forms.Label expSymShapeLbl;\n        private System.Windows.Forms.ComboBox comboBShape;\n        private System.Windows.Forms.Label bShape;\n        private System.Windows.Forms.ComboBox comboExpSymbol;\n        private System.Windows.Forms.Panel expanderPanel1;\n        private Syncfusion.Windows.Forms.Diagram.Controls.Diagram diagram1;\n        private Syncfusion.Windows.Forms.Diagram.Model model1;\n        private System.Windows.Forms.Label label1;\n        private System.Windows.Forms.Label vSpacing;\n        private System.Windows.Forms.Label hSpacing;\n        private System.Windows.Forms.Button apply;\n        private System.Windows.Forms.TextBox txtHSpacing;\n        private System.Windows.Forms.CheckBox chkAutoLayout;\n        private System.Windows.Forms.TextBox txtVSpacing;\n        private System.Windows.Forms.TextBox txtTMarigin;\n        private System.Windows.Forms.Label lMarigin;\n        private System.Windows.Forms.Label tMarigin;\n        private System.Windows.Forms.TextBox txtLMarigin;\n        private System.Windows.Forms.Label lytTypLbl;\n        private System.Windows.Forms.ComboBox comboLytType;\n        private System.Windows.Forms.Label label2;\n        private System.Windows.Forms.Label lytProp;\n\n    }\n}\n\n"
    },
    {
      "target": "src/components/diagram-org-chart-layout/diagram.cs",
      "content": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nusing System.Text;\nusing System.Windows.Forms;\nusing Syncfusion.Windows.Forms.Diagram;\nusing System.Drawing.Imaging;\nusing Syncfusion.Windows.Forms.Tools;\nusing Syncfusion.Windows.Forms.Diagram.Controls;\nusing System.Drawing.Drawing2D;\nusing Syncfusion.Windows.Forms;\nusing System.IO;\nusing System.Drawing.Printing;\nusing Syncfusion.SVG.IO;\nusing System.Collections;\nusing System.Xml;\n\nnamespace OrgChartLayout\n{\n    public partial class Form1 : MetroForm\n    {\n        #region Members\n        protected OrgChartLayoutManager dtLayoutMgr;\n        #endregion\n\n        #region Form Initialize\n        public Form1()\n        {\n            InitializeComponent();\n        }\n\n        private void Form1_Load(object sender, EventArgs e)\n        {            \n            diagram1.BeginUpdate();\n            this.diagram1.Controller.InPlaceEditing = false;\n            this.dtLayoutMgr = new OrgChartLayoutManager(this.diagram1.Model, RotateDirection.TopToBottom, 40, 50, LayoutType.Waterfall, 1);\n            dtLayoutMgr.LeftMargin = 10;\n            dtLayoutMgr.TopMargin = 10;\n            dtLayoutMgr.VerticalSpacing = 50;\n            diagram1.LayoutManager = dtLayoutMgr;\n            DiagramAppearance();\n            InitializeDiagramFromXMLData();\n            this.diagram1.View.SelectionList.Clear();\n\n            txtHSpacing.Text = dtLayoutMgr.HorizontalSpacing.ToString();\n            txtVSpacing.Text = dtLayoutMgr.VerticalSpacing.ToString();\n            txtLMarigin.Text = dtLayoutMgr.LeftMargin.ToString();\n            txtTMarigin.Text = dtLayoutMgr.TopMargin.ToString();\n            chkAutoLayout.Checked = dtLayoutMgr.AutoLayout;\n\n            comboLytType.SelectedIndex = 0;\n            comboBShape.SelectedIndex = 1;\n            comboExpSymbol.SelectedIndex = 0;\n\n            diagram1.EndUpdate();\n            comboBShape.SelectedIndexChanged += new EventHandler(comboBShape_SelectedIndexChanged);\n            comboExpSymbol.SelectedIndexChanged += new EventHandler(comboExpSymbol_SelectedIndexChanged);\n            apply.Click += new EventHandler(apply_Click);\n            diagram1.MouseMove += new MouseEventHandler(diagram1_MouseMove);\n            diagram1.EventSink.NodeMouseEnter += new Syncfusion.Windows.Forms.Diagram.NodeMouseEventHandler(EventSink_NodeMouseEnter);\n            this.dtLayoutMgr.UpdateLayout(this);\n        }\n        #endregion\n\n        #region Private Methods\n        /// <summary>\n        /// Change's the appearance of Diagram\n        /// </summary>\n        private void DiagramAppearance()\n        {\n            //this.diagram1.MetroScrollBars = true;            \n            this.diagram1.View.HandleRenderer.HandleColor = Color.AliceBlue;\n            this.diagram1.View.HandleRenderer.HandleOutlineColor = Color.SkyBlue;\n            this.diagram1.Model.RenderingStyle.SmoothingMode = SmoothingMode.HighQuality;\n            this.diagram1.View.BackgroundColor = Color.White;            \n            this.diagram1.Model.SizeToContent = true;\n\n        }\n        #endregion\n\n        #region Initialize Diagram\n\n        /// <summary>\n        /// Initialize the diagram from XML file.\n        /// </summary>\n        protected void InitializeDiagramFromXMLData()\n        {\n#if !NETCORE\n            string datasrcpath = @\"..\\..\\..\\..\\..\\..\\common\\Data\\Diagram\\xml\\OrgLayout.xml\";\n#else\n            string datasrcpath = OrgChartLayoutDataSource.GetXmlPath() ?? string.Empty;\n            if (string.IsNullOrEmpty(datasrcpath)) return;\n#endif\n\n            // Read data from the XML data file and populate a Hashtable using the employee ID as the key\n            Hashtable lstEmployees = this.ReadEmployeeDataFromXMLFile(datasrcpath);\n\n            // Create a manager-employee nested list with top-level employees forming the root nodes\n            ArrayList sortedlist = this.GetSortedEmployeesList(lstEmployees);\n\n            foreach (Employee emply in sortedlist)\n            {\n                this.IterUpdateSubEmployeeCount(emply);\n            }\n\n            // Create diagram symbol nodes for each employee and initialize the diagram\n            this.CreateOrgDiagramFromList(sortedlist);\n            lstEmployees.Clear();\n            sortedlist.Clear();\n        }\n\n        /// <summary>\n        /// Read the data from the XML file\n        /// </summary>\n        /// <param name=\"datasrc\">Path of the XML File</param>\n        /// <returns>returns the employee table</returns>\n        protected Hashtable ReadEmployeeDataFromXMLFile(string datasrc)\n        {\n            Hashtable lstEmployee = new Hashtable();  \n\n            // Use the XML DOM to read data from the employees XML data file\n            XmlDocument xmldoc = new XmlDocument();\n#if SyncfusionFramework4_0\n            xmldoc.XmlResolver = null;\n#endif\n            xmldoc.Load(datasrc);\n            if (xmldoc.DocumentElement.HasChildNodes)\n            {\n                XmlNodeList employeelist = xmldoc.DocumentElement.ChildNodes;\n                for (int i = 0; i < employeelist.Count; i++)\n                {\n                    // Create an Employee instance to represent each employee\n                    Employee emply = new Employee();\n\n                    XmlNode employeenode = employeelist[i];\n                    XmlNodeList employeedatalist = employeenode.ChildNodes;\n                    IEnumerator employeedata = employeedatalist.GetEnumerator();\n                    employeedata.Reset();\n                    while (employeedata.MoveNext())\n                    {\n                        XmlNode dataelement = employeedata.Current as XmlNode;\n                        switch (dataelement.Name)\n                        {\n                            case \"Name\":\n                                emply.EmployeeName = \"Name :\" + dataelement.InnerText;\n                                break;\n                            case \"EmployeeID\":\n                                emply.EmployeeID = dataelement.InnerText;\n                                emply.EmployeeName += System.Environment.NewLine + \"Emp ID :\" + dataelement.InnerText;\n                                break;\n                            case \"Designation\":\n                                emply.Designation = dataelement.InnerText;\n                                emply.EmployeeName += System.Environment.NewLine + \"Des :\" + dataelement.InnerText;\n                                break;\n                            case \"DOJ\":\n                                emply.DOJ = dataelement.InnerText;\n                                emply.EmployeeName += System.Environment.NewLine + \"DOJ :\" + dataelement.InnerText;\n                                break;\n                            case \"ImageNo\":\n                                emply.ImageName = dataelement.InnerText;\n                                break;\n                            case \"ManagerID\":\n                                emply.ManagerID = dataelement.InnerText;\n                                break;\n                        }\n                    }\n                    lstEmployee.Add(emply.EmployeeID,emply);\n                }\n            }\n\n            return lstEmployee;\n        }\n\n        /// <summary>\n        ///  Rearrange the employees collection as a manager-subemployee nested tree\n        /// </summary>\n        /// <param name=\"htemployees\">Employee table</param>\n        /// <returns>returns the sorted list</returns>\n        protected ArrayList GetSortedEmployeesList(Hashtable htemployees)\n        {           \n            ICollection employees = htemployees.Values;\n            ArrayList sortedlist = new ArrayList();\n            foreach (Employee emply in employees)\n            {\n                if (emply.ManagerID == string.Empty)\n                {\n                    // Employees without a ManagerID are top-level nodes in the org tree\n                    sortedlist.Add(emply);\n                }\n                else\n                {\n                    // Find the employee instance associated with the managerID and add this object as \n                    // a subemployee of the manager node.\n                    Employee manager = (Employee)htemployees[emply.ManagerID];\n                    if (manager != null)\n                        manager.SubEmployees.Add(emply);\n                }\n            }\n\n            return sortedlist;            \n        }\n\n        /// <summary>\n        /// generates the sub employees count\n        /// </summary>\n        /// <param name=\"empl\">Employee business object</param>\n        protected void IterUpdateSubEmployeeCount(Employee empl)\n        {\n            empl.RecSubEmployeeCount = empl.SubEmployees.Count;\n            foreach (Employee subempl in empl.SubEmployees)\n            {\n                this.IterUpdateSubEmployeeCount(subempl);\n                empl.RecSubEmployeeCount += subempl.RecSubEmployeeCount;\n            }\n        }       \n        \n        /// <summary>\n        /// Create diagram symbol nodes for each employee in the organization and add these symbols to the diagram\n        /// Create links between manager and sub-employees to depict the org structure\n        /// </summary>\n        /// <param name=\"alemployees\"> Employees list</param>\n        protected void CreateOrgDiagramFromList(ArrayList alemployees)\n        {\n            // Temporarily suspend the Diagram Model redrawing\n            this.diagram1.Model.BeginUpdate();\n\n            foreach (Employee emply in alemployees)\n            {\n                string fileName = OrgChartLayoutDataSource.GetEmployeeImagePath(emply.ImageName);\n                EmpSymbol emplysymbol = new EmpSymbol(fileName);\n                emplysymbol.LineStyle.LineColor = Color.LightSkyBlue;\n                emplysymbol.EmployeeName = emply.EmployeeName;\n                this.diagram1.Model.AppendChild(emplysymbol);\n                this.IterCreateEmployeeSymbol(emply, emplysymbol);\n            }\n\n            // ReEnable the Model redraw\n            this.diagram1.Model.EndUpdate();\n\n            // Instruct the LayoutManager to calculate and layout the diagram nodes\n            LayoutNodes();\n        }\n\n\n        /// <summary>\n        ///  Iterative sub-employee symbol node creation\n        /// </summary>\n        /// <param name=\"emply\">Employess business object</param>\n        /// <param name=\"emplysymbol\">Employee Node</param>\n        protected void IterCreateEmployeeSymbol(Employee emply, EmpSymbol emplysymbol)\n        {\n            foreach (Employee subemply in emply.SubEmployees)\n            {\n                string fileName = OrgChartLayoutDataSource.GetEmployeeImagePath(subemply.ImageName);\n                // Create a EmployeeSymbol for each of the sub-employees of the particular employee //Waterfall, Horizontal\n                EmpSymbol subemplysymbol = new EmpSymbol(fileName);\n                subemplysymbol.LineStyle.LineColor = Color.LightSkyBlue;\n                subemplysymbol.EmployeeName = emply.EmployeeName;\n                this.diagram1.Model.AppendChild(subemplysymbol);\n\n                emplysymbol.EnableCentralPort = true;\n                subemplysymbol.EnableCentralPort = true;\n                ConnectNodes(emplysymbol, subemplysymbol);\n\n                this.IterCreateEmployeeSymbol(subemply, subemplysymbol);\n            }\n\n        }\n\n        /// <summary>\n        /// Connects the nodes\n        /// </summary>\n        /// <param name=\"emplysymbol\">Parent Node</param>\n        /// <param name=\"subemplysymbol\">Child node</param>\n        private void ConnectNodes(Node emplysymbol, Node subemplysymbol)\n        {\n            OrgLineConnector ortholink = new OrgLineConnector(PointF.Empty, new PointF(0, 1));            \n            ortholink.LineStyle.LineWidth = 1f;\n            ortholink.LineStyle.LineColor = Color.Black;\n            ortholink.HeadDecorator.DecoratorShape = DecoratorShape.Filled45Arrow;            \n            ortholink.HeadDecorator.FillStyle.Color = Color.Black;\n            this.diagram1.Model.AppendChild(ortholink);\n\n            if (emplysymbol.CentralPort != null && subemplysymbol.CentralPort != null)\n            {\n                emplysymbol.CentralPort.TryConnect(ortholink.TailEndPoint);\n                subemplysymbol.CentralPort.TryConnect(ortholink.HeadEndPoint);\n            }\n\n            this.diagram1.Controller.SendToBack();\n        }\n\n#endregion\n        \n#region Event Handlers\n        \n        private void dialog_BeginLayout(OrgChartLayoutManager layout)\n        {\n            this.diagram1.LayoutManager = layout;\n            LayoutNodes();\n        }\n\n        void apply_Click(object sender, EventArgs e)\n        {\n            this.diagram1.BeginUpdate();\n            dtLayoutMgr = new OrgChartLayoutManager(this.diagram1.Model, RotateDirection.TopToBottom, 20, 50, (LayoutType)Enum.Parse(typeof(LayoutType), this.comboLytType.SelectedItem.ToString(), true), 1, true);\n            if (txtHSpacing.Text != string.Empty)\n                dtLayoutMgr.LeftMargin = float.Parse(txtLMarigin.Text);\n            if (txtVSpacing.Text != string.Empty)\n                dtLayoutMgr.TopMargin = float.Parse(txtTMarigin.Text);\n            if (txtLMarigin.Text != string.Empty)\n                dtLayoutMgr.HorizontalSpacing = float.Parse(txtHSpacing.Text);\n            if (txtTMarigin.Text != string.Empty)\n                dtLayoutMgr.VerticalSpacing = float.Parse(txtVSpacing.Text);\n\n            dtLayoutMgr.AutoLayout = chkAutoLayout.Checked;\n\n            this.diagram1.LayoutManager = this.dtLayoutMgr;\n            this.dtLayoutMgr.UpdateLayout(null);\n            this.diagram1.EndUpdate();\n            this.diagram1.UpdateView();\n        }\n\n        void comboExpSymbol_SelectedIndexChanged(object sender, EventArgs e)\n        {\n            this.diagram1.BeginUpdate();\n            foreach (Node node in diagram1.Model.Nodes)\n            {\n                if (node is EmpSymbol)\n                {\n                    if (comboExpSymbol.SelectedIndex == 1)\n                    {\n                        ((EmpSymbol)node).SymbolShapeType = EmpSymbol.SymbolShape.PlusMinus;\n                    }\n                    else if (comboExpSymbol.SelectedIndex == 0)\n                    {\n                        ((EmpSymbol)node).SymbolShapeType = EmpSymbol.SymbolShape.RightDownTriangle;\n                    }\n                }\n            }\n            this.diagram1.Refresh();\n            this.diagram1.EndUpdate();\n        }\n\n        void comboBShape_SelectedIndexChanged(object sender, EventArgs e)\n        {\n            this.diagram1.BeginUpdate();\n            foreach (Node node in diagram1.Model.Nodes)\n            {\n                if (node is EmpSymbol)\n                {\n                    if (comboBShape.SelectedIndex == 1)\n                    {\n                        ((EmpSymbol)node).BackgroundShapeType = EmpSymbol.BackgroundShape.ellipse;\n                    }\n                    else if (comboBShape.SelectedIndex == 0)\n                    {\n                        ((EmpSymbol)node).BackgroundShapeType = EmpSymbol.BackgroundShape.Rectangle;\n                    }\n                }\n            }\n            this.diagram1.Refresh();\n            this.diagram1.EndUpdate();\n        }\n\n        void EventSink_NodeMouseEnter(Syncfusion.Windows.Forms.Diagram.NodeMouseEventArgs evtArgs)\n        {\n            diagram1.Controller.ActiveTool.ActionCursor = Cursors.Arrow;\n        }\n\n        void diagram1_MouseMove(object sender, MouseEventArgs e)\n        {\n            EmpSymbol node = diagram1.Controller.GetNodeAtPoint(diagram1.Controller.ConvertToModelCoordinates(e.Location)) as EmpSymbol;\n            if (node != null)\n            {\n                node.MouseMove(diagram1.Controller.ConvertToModelCoordinates(e.Location));\n            }\n        }\n#endregion\n\n#region Helper Methods\n\n        private void LayoutNodes()\n        {\n            // Temporarily suspend the layoutmanager\n            this.diagram1.LayoutManager.AutoLayout = false;\n\n            this.diagram1.LayoutManager.Nodes.Clear();\n            this.diagram1.LayoutManager.Nodes.AddRange(this.diagram1.Model.Nodes);\n            this.diagram1.LayoutManager.UpdateLayout(null);\n        }        \n#endregion\n    }\n}\n\n"
    }
  ]
}