Ejemplo n.º 1
0
 /// <summary>
 /// Initialize the nodes in daigram
 /// </summary>
 private void PopulateFields(DataTable dt)
 {
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         Syncfusion.Windows.Forms.Diagram.RoundRect rect = new Syncfusion.Windows.Forms.Diagram.RoundRect(0, 0, 120, 60, MeasureUnits.Pixel);
         rect.FillStyle.Color     = Color.FromArgb(255, 86, 4);
         rect.FillStyle.ForeColor = Color.FromArgb(255, 165, 74);
         rect.LineStyle.LineColor = Color.White;
         rect.FillStyle.Type      = FillStyleType.LinearGradient;
         //rect.EnableShading = true;
         rect.Name = dt.Rows[i]["Name"].ToString();
         Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(rect, dt.Rows[i]["Name"].ToString());
         label.FontStyle.Family     = "Segoe UI";
         label.FontStyle.Size       = 9;
         label.FontColorStyle.Color = Color.White;
         rect.Labels.Add(label);
         Syncfusion.Windows.Forms.Diagram.Label label1 = new Syncfusion.Windows.Forms.Diagram.Label(rect, dt.Rows[i]["Designation"].ToString());
         label1.FontStyle.Family     = "Segoe UI";
         label1.FontStyle.Size       = 9;
         label1.FontColorStyle.Color = Color.White;
         label1.OffsetX = rect.BoundingRectangle.Width / 2 - label1.Size.Width / 2;
         label1.OffsetY = rect.BoundingRectangle.Height / 2 + 5;
         rect.Labels.Add(label1);
         diagram1.Model.AppendChild(rect);
         if (!string.IsNullOrEmpty(dt.Rows[i]["ParentName"].ToString()))
         {
             Syncfusion.Windows.Forms.Diagram.RoundRect parentNode = diagram1.Model.Nodes.FindNodeByName(dt.Rows[i]["ParentName"].ToString()) as Syncfusion.Windows.Forms.Diagram.RoundRect;
             string ss = parentNode.Name;
             ConnectNodes(parentNode, rect);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// create a new RoundRect
 /// </summary>
 /// <returns></returns>
 private static Syncfusion.Windows.Forms.Diagram.RoundRect GetRoundRect()
 {
     Syncfusion.Windows.Forms.Diagram.RoundRect rect = new Syncfusion.Windows.Forms.Diagram.RoundRect(0, 0, 110, 50, MeasureUnits.Pixel);
     rect.FillStyle.Color     = Color.FromArgb(152, 152, 186);
     rect.FillStyle.ForeColor = Color.FromArgb(102, 102, 153);
     rect.LineStyle.LineColor = Color.SlateBlue;
     rect.FillStyle.Type      = FillStyleType.LinearGradient;
     return(rect);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// New function for adding label to the Rectangle
 /// </summary>
 /// <param name="rect">Container of the Label</param>
 /// <param name="labelText">Text of the Label</param>
 /// <returns></returns>
 private static Syncfusion.Windows.Forms.Diagram.Label AddLabel(Syncfusion.Windows.Forms.Diagram.RoundRect rect, string labelText)
 {
     Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(rect, labelText);
     label.FontStyle.Family     = "Verdana";
     label.FontStyle.Size       = 8;
     label.FontColorStyle.Color = Color.White;
     label.HorizontalAlignment  = StringAlignment.Center;
     label.VerticalAlignment    = StringAlignment.Center;
     return(label);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Initialize the Diagram
        /// </summary>
        protected void InitailizeDiagram()
        {
            Layer rectanglelayer = CreateLayer("Rectangle Layer");
            Layer ellipselayer   = CreateLayer("Ellipse Layer");
            Layer roundRectlayer = CreateLayer("RoundRect Layer");

            float rectPinPointX = 50, ellipsePinPointX = 300, roundRectPinPointX = 550, PinPointY = 75;

            for (int i = 0; i < 4; i++)
            {
                Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(rectPinPointX, PinPointY, 200, 50);
                rect.FillStyle.Color     = Color.FromArgb(240, 242, 240);
                rect.FillStyle.ForeColor = Color.White;
                rect.FillStyle.Type      = FillStyleType.LinearGradient;
                rect.LineStyle.LineColor = Color.DarkGray;
                //rect.Name = "Rectangle" + (i + 1);
                AddLabel(rect.Name, rect);
                diagram1.Model.AppendChild(rect);
                rectanglelayer.Nodes.Add(rect);
                rect.Layers.Add(rectanglelayer);

                Syncfusion.Windows.Forms.Diagram.Ellipse ellipse = new Syncfusion.Windows.Forms.Diagram.Ellipse(ellipsePinPointX, PinPointY, 200, 50);
                ellipse.FillStyle.Color     = Color.FromArgb(240, 242, 240);
                ellipse.FillStyle.ForeColor = Color.White;
                ellipse.FillStyle.Type      = FillStyleType.LinearGradient;
                ellipse.LineStyle.LineColor = Color.DarkGray;
                // ellipse.Name = "Ellipse" + (i + 1);
                AddLabel(ellipse.Name, ellipse);
                diagram1.Model.AppendChild(ellipse);
                ellipselayer.Nodes.Add(ellipse);
                ellipse.Layers.Add(ellipselayer);


                Syncfusion.Windows.Forms.Diagram.RoundRect roundRect = new Syncfusion.Windows.Forms.Diagram.RoundRect(roundRectPinPointX, PinPointY, 200, 50, MeasureUnits.Pixel);
                roundRect.FillStyle.Color     = Color.FromArgb(240, 242, 240);
                roundRect.FillStyle.ForeColor = Color.White;
                roundRect.FillStyle.Type      = FillStyleType.LinearGradient;
                roundRect.LineStyle.LineColor = Color.DarkGray;
                // roundRect.Name = "RoundRect" + (i + 1);
                AddLabel(roundRect.Name, roundRect);
                diagram1.Model.AppendChild(roundRect);
                roundRectlayer.Nodes.Add(roundRect);
                roundRect.Layers.Add(roundRectlayer);

                PinPointY += 125;
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Generates the diagram from the data source.
 /// </summary>
 /// <param name="dt">Data Source to be passed</param>
 private void PopulateFields(DataTable dt)
 {
     for (int i = 0; i < dt.Rows.Count; i++)
     {
         Syncfusion.Windows.Forms.Diagram.RoundRect rect = GetRoundRect();
         rect.Name = "Node" + dt.Rows[i]["ID"].ToString();
         string labelText = dt.Rows[i]["Title"].ToString() + "\r\n" + dt.Rows[i]["Designation"].ToString();
         // create a new label for roundrect
         Syncfusion.Windows.Forms.Diagram.Label label = AddLabel(rect, labelText);
         rect.Labels.Add(label);
         diagram1.Model.AppendChild(rect);
         if (!string.IsNullOrEmpty(dt.Rows[i]["ParentID"].ToString()))
         {
             Syncfusion.Windows.Forms.Diagram.RoundRect parentNode = diagram1.Model.Nodes.FindNodeByName("Node" + dt.Rows[i]["ParentID"].ToString()) as Syncfusion.Windows.Forms.Diagram.RoundRect;
             string ss = parentNode.Name;
             ConnectNodes(parentNode, rect);
         }
     }
 }
    public ContentWithOuterRectangle(string content, string tip, Color BackColor, Color tipBackColor)
    {
        Syncfusion.Windows.Forms.Diagram.Rectangle ContentEmpty = new Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 200, 10, units);
        ContentEmpty.FillStyle.Color     = Color.Transparent;
        ContentEmpty.LineStyle.LineWidth = 0;
        RectangleF rect = new RectangleF(0, 15, 200, 45);

        TextNode nodeRectHeader = new TextNode(content, rect);

        nodeRectHeader.EnableCentralPort     = false;
        nodeRectHeader.BackgroundStyle.Color = BackColor;
        nodeRectHeader.BackgroundStyle.Color = Color.White;
        nodeRectHeader.LineStyle.LineWidth   = 1;
        nodeRectHeader.FontStyle.Size        = 10;
        nodeRectHeader.ReadOnly            = true;
        nodeRectHeader.HorizontalAlignment = StringAlignment.Near;
        nodeRectHeader.VerticalAlignment   = StringAlignment.Near;

        Syncfusion.Windows.Forms.Diagram.RoundRect roundrect = new Syncfusion.Windows.Forms.Diagram.RoundRect(ContentEmpty.Size.Width - 20, 0, 40, 15, units);
        roundrect.EnableCentralPort = false;
        // Add an outer RoundRectangle.
        roundrect.FillStyle.ForeColor = System.Drawing.Color.SkyBlue;
        roundrect.LineStyle.LineColor = Color.FromArgb(253, 188, 140);
        roundrect.FillStyle.Color     = tipBackColor;
        roundrect.EnableShading       = false;

        Syncfusion.Windows.Forms.Diagram.Label lblr = new Syncfusion.Windows.Forms.Diagram.Label();
        lblr.Text           = tip;
        lblr.SizeToNode     = true;
        lblr.Position       = Position.Center;
        lblr.FontStyle.Size = 14;
        lblr.FontStyle.Bold = true;
        roundrect.Labels.Add(lblr);
        this.EnableCentralPort         = true;
        ContentEmpty.EnableCentralPort = true;
        roundrect.EnableCentralPort    = true;
        this.AppendChild(ContentEmpty);
        this.AppendChild(nodeRectHeader);
        this.AppendChild(roundrect);
        this.EditStyle.AllowSelect = false;
    }
Ejemplo n.º 7
0
        /// <summary>
        /// Create the new member with specified name and title.
        /// </summary>
        /// <param name="strMemberName">The member name.</param>
        /// <param name="strTitle">The title.</param>
        private Node CreateMember(string strMemberName, string strTitle)
        {
            SizeF szSize = new SizeF(140, 60);

            Syncfusion.Windows.Forms.Diagram.RoundRect rnRect = new Syncfusion.Windows.Forms.Diagram.RoundRect(0, 0, 120, 60, MeasureUnits.Pixel);
            rnRect.FillStyle.Color     = Color.FromArgb(255, 86, 4);
            rnRect.FillStyle.ForeColor = Color.FromArgb(255, 165, 74);
            rnRect.LineStyle.LineColor = Color.White;
            rnRect.FillStyle.Type      = FillStyleType.LinearGradient;
            Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(rnRect, strMemberName);
            label.FontStyle.Family     = "Segoe UI";
            label.FontStyle.Size       = 9;
            label.FontColorStyle.Color = Color.White;
            rnRect.Labels.Add(label);
            Syncfusion.Windows.Forms.Diagram.Label label1 = new Syncfusion.Windows.Forms.Diagram.Label(rnRect, strTitle);
            label1.FontStyle.Family     = "Segoe UI";
            label1.FontStyle.Size       = 9;
            label1.FontColorStyle.Color = Color.White;
            label1.OffsetX = rnRect.BoundingRectangle.Width / 2 - label1.Size.Width / 2;
            label1.OffsetY = rnRect.BoundingRectangle.Height / 2 + 5;
            rnRect.Labels.Add(label1);
            return(rnRect);
        }
Ejemplo n.º 8
0
        private void Form1_Load(object sender, EventArgs e)
        {
            diagram1.Model.RenderingStyle.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, 50, 100, 75);
            rect.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            rect.FillStyle.ForeColor = Color.White;
            rect.FillStyle.Type      = FillStyleType.LinearGradient;
            rect.LineStyle.LineWidth = 1;
            AddLabel(rect);

            Syncfusion.Windows.Forms.Diagram.RoundRect roundRect = new Syncfusion.Windows.Forms.Diagram.RoundRect(220, 0, 100, 75, MeasureUnits.Pixel);
            roundRect.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            roundRect.FillStyle.ForeColor = Color.White;
            roundRect.FillStyle.Type      = FillStyleType.LinearGradient;
            roundRect.LineStyle.LineWidth = 1;
            AddLabel(roundRect);

            Ellipse ellipse1 = new Ellipse(100, 200, 100, 80);

            ellipse1.Name                = "Start/Stop";
            ellipse1.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            ellipse1.FillStyle.ForeColor = Color.White;
            ellipse1.FillStyle.Type      = FillStyleType.LinearGradient;
            ellipse1.LineStyle.LineWidth = 1;
            AddLabel(ellipse1);
            diagram1.Model.AppendChild(ellipse1);

            Polygon poly = new Polygon(new PointF[] { new PointF(15, 0), new PointF(0, 45), new PointF(15, 90), new PointF(60, 90), new PointF(75, 45), new PointF(60, 0) });

            poly                     = new Polygon(new PointF[] { new PointF(45, 0), new PointF(0, 45), new PointF(45, 90), new PointF(90, 45) });
            poly.Name                = "Decision";
            poly.PinPoint            = new PointF(350, 230);
            poly.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            poly.FillStyle.ForeColor = Color.White;
            poly.FillStyle.Type      = FillStyleType.LinearGradient;
            poly.LineStyle.LineWidth = 1;
            AddLabel(poly);
            diagram1.Model.AppendChild(poly);

            Syncfusion.Windows.Forms.Diagram.Rectangle rect1 = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, 350, 100, 75);
            rect1.Name                = "Process";
            rect1.FillStyle.Color     = Color.FromArgb(242, 242, 242);
            rect1.FillStyle.ForeColor = Color.White;
            rect1.FillStyle.Type      = FillStyleType.LinearGradient;
            rect1.LineStyle.LineWidth = 1;
            AddLabel(rect1);
            diagram1.Model.AppendChild(rect1);

            Group group = new Group();

            group.AppendChild(rect);
            group.AppendChild(roundRect);
            diagram1.Model.AppendChild(group);
            Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label();
            label.Container        = group;
            label.Text             = "Group1";
            label.FontStyle.Family = "Segoe UI";
            label.FontStyle.Size   = 9;
            group.Labels.Add(label);
            diagram1.View.BackgroundColor = Color.White;
            diagram1.View.SelectionList.Clear();
            this.diagram1.MouseDown += new MouseEventHandler(diagram1_MouseDown);
            this.diagram1.MouseUp   += new MouseEventHandler(diagram1_MouseUp);

            // Wire up OnIdle processing
            Application.Idle += new EventHandler(Application_Idle);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Insert nodes from the palete
        /// </summary>
        public void AddingNodesToTheDrawingArea()
        {
            InsertNodeFromPallete(0, new PointF(85, 60));
            InsertNodeFromPallete(3, new PointF(173, 150));
            InsertNodeFromPallete(4, new PointF(173, 150));
            InsertNodeFromPallete(5, new PointF(173, 153));
            InsertNodeFromPallete(6, new PointF(171, 145));

            foreach (Node node in this.diagram1.Model.Nodes)
            {
                if (node.Name.Equals("ClockHead"))
                {
                    mynode = node as Node;
                }
                else if (node.Name.Equals("Oscillator"))
                {
                    centerNode = node as Node;
                }
                else if (node.Name.Equals("Seconds"))
                {
                    secondsNode = node as Node;
                }
                else if (node.Name.Equals("Hours"))
                {
                    hoursNode = node as Node;
                }
                else if (node.Name.Equals("Minutes"))
                {
                    minutesNode = node as Node;
                }
                node.EditStyle.AllowSelect = false;
            }

            #region Digital clock

            Syncfusion.Windows.Forms.Diagram.RoundRect outerRect = new Syncfusion.Windows.Forms.Diagram.RoundRect(325, 70, 420, 160, MeasureUnits.Pixel);
            outerRect.FillStyle.Color       = ColorTranslator.FromHtml("#FF119EDA");
            outerRect.LineStyle.LineWidth   = 0;
            outerRect.EditStyle.AllowSelect = false;
            diagram1.Model.AppendChild(outerRect);
            Syncfusion.Windows.Forms.Diagram.RoundRect innerRect = new Syncfusion.Windows.Forms.Diagram.RoundRect(335, 80, 400, 140, MeasureUnits.Pixel);
            innerRect.FillStyle.Color       = ColorTranslator.FromHtml("#FF96D3ED");
            innerRect.LineStyle.LineWidth   = 0;
            innerRect.EditStyle.AllowSelect = false;
            diagram1.Model.AppendChild(innerRect);
            Syncfusion.Windows.Forms.Diagram.RoundRect innerRect1 = new Syncfusion.Windows.Forms.Diagram.RoundRect(345, 90, 380, 120, 7, MeasureUnits.Pixel);
            innerRect1.FillStyle.Color       = Color.White;
            innerRect1.LineStyle.LineWidth   = 0;
            innerRect1.EditStyle.AllowSelect = false;
            diagram1.Model.AppendChild(innerRect1);

            bitList.Add(zero);
            bitList.Add(one);
            bitList.Add(two);
            bitList.Add(three);
            bitList.Add(four);
            bitList.Add(five);
            bitList.Add(six);
            bitList.Add(seven);
            bitList.Add(eight);
            bitList.Add(nine);

            digit = new Group(palette.Nodes[7] as Group);
            ApplyStyle(digit);
            digit.PinPoint = new PointF(380, 150);
            digit.EditStyle.AllowSelect = false;
            digit.Visible = false;
            diagram1.Model.AppendChild(digit);

            digit1 = new Group(palette.Nodes[7] as Group);
            ApplyStyle(digit1);
            digit1.PinPoint = new PointF(430, 150);
            digit1.EditStyle.AllowSelect = false;
            digit1.Visible = false;
            diagram1.Model.AppendChild(digit1);

            digit2 = new Group(palette.Nodes[7] as Group);
            ApplyStyle(digit2);
            digit2.PinPoint = new PointF(515, 150);
            digit2.EditStyle.AllowSelect = false;
            digit2.Visible = false;
            diagram1.Model.AppendChild(digit2);

            digit3 = new Group(palette.Nodes[7] as Group);
            ApplyStyle(digit3);
            digit3.PinPoint = new PointF(565, 150);
            digit3.EditStyle.AllowSelect = false;
            digit3.Visible = false;
            diagram1.Model.AppendChild(digit3);

            digit4 = new Group(palette.Nodes[7] as Group);
            ApplyStyle(digit4);
            digit4.PinPoint = new PointF(640, 150);
            digit4.EditStyle.AllowSelect = false;
            digit4.Visible = false;
            diagram1.Model.AppendChild(digit4);

            digit5 = new Group(palette.Nodes[7] as Group);
            ApplyStyle(digit5);
            digit5.PinPoint = new PointF(690, 150);
            digit5.EditStyle.AllowSelect = false;
            digit5.Visible = false;
            diagram1.Model.AppendChild(digit5);

            colon1 = new Group(palette.Nodes[8] as Group);
            ApplyStyle(colon1);
            colon1.PinPoint = new PointF(470, 150);
            colon1.EditStyle.AllowSelect = false;
            diagram1.Model.AppendChild(colon1);

            colon2 = new Group(palette.Nodes[8] as Group);
            ApplyStyle(colon2);
            colon2.PinPoint = new PointF(600, 150);
            colon2.EditStyle.AllowSelect = false;
            diagram1.Model.AppendChild(colon2);

            #endregion

            this.diagram1.Controller.SelectionList.Clear();
        }
Ejemplo n.º 10
0
        /// <summary>
        /// initializes the Diagram data
        /// </summary>
        private void InitializeDiagram()
        {
            Syncfusion.Windows.Forms.Diagram.Rectangle rect = new Syncfusion.Windows.Forms.Diagram.Rectangle(100, 25, 120, 75);
            rect.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            rect.FillStyle.ForeColor = Color.White;
            rect.FillStyle.Type      = FillStyleType.LinearGradient;
            rect.LineStyle.LineColor = Color.DarkGray;
            AddLabel(rect, "Rectangle", Position.Center);
            diagram1.Model.AppendChild(rect);

            Syncfusion.Windows.Forms.Diagram.RoundRect roundRect = new Syncfusion.Windows.Forms.Diagram.RoundRect(400, 25, 120, 75, MeasureUnits.Pixel);
            roundRect.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            roundRect.FillStyle.ForeColor = Color.White;
            roundRect.LineStyle.LineColor = Color.DarkGray;
            roundRect.FillStyle.Type      = FillStyleType.LinearGradient;
            AddLabel(roundRect, "RoundRect1", Position.Center);
            diagram1.Model.AppendChild(roundRect);

            Ellipse ellipse1 = new Ellipse(100, 125, 120, 80);

            ellipse1.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            ellipse1.FillStyle.ForeColor = Color.White;
            ellipse1.LineStyle.LineColor = Color.DarkGray;
            ellipse1.FillStyle.Type      = FillStyleType.LinearGradient;
            AddLabel(ellipse1, "Ellipse", Position.Center);
            diagram1.Model.AppendChild(ellipse1);

            Polygon poly = new Polygon(new PointF[] { new PointF(160, 235), new PointF(100, 265), new PointF(120, 325), new PointF(200, 325), new PointF(220, 265) });

            poly.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            poly.FillStyle.ForeColor = Color.White;
            poly.FillStyle.Type      = FillStyleType.LinearGradient;
            poly.LineStyle.LineColor = Color.DarkGray;
            AddLabel(poly, "Polygon", Position.Center);
            diagram1.Model.AppendChild(poly);

            SemiCircle semiCircle = new SemiCircle(400, 125, 120, 75);

            semiCircle.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            semiCircle.FillStyle.ForeColor = Color.White;
            semiCircle.FillStyle.Type      = FillStyleType.LinearGradient;
            semiCircle.LineStyle.LineColor = Color.DarkGray;
            AddLabel(semiCircle, "SemiCircle", Position.Center);
            diagram1.Model.AppendChild(semiCircle);

            TextNode textNode = new TextNode("TextNode1", new RectangleF(400, 245, 120, 50));

            textNode.FontStyle.Size       = 9;
            textNode.FontStyle.Family     = "Segoe UI";
            textNode.HorizontalAlignment  = StringAlignment.Center;
            textNode.VerticalAlignment    = StringAlignment.Center;
            textNode.LineStyle.LineColor  = Color.DarkGray;
            textNode.FontColorStyle.Color = Color.Black;
            diagram1.Model.AppendChild(textNode);

            RichTextNode richTextNode = new RichTextNode(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Meiryo UI;}{\f1\fnil\fcharset0 Microsoft Sans Serif;}}
{\colortbl ;\red255\green0\blue0;\red0\green64\blue128;}
\viewkind4\uc1\pard\b\f0\fs17 This is a text symbol\f1  \b0\f0 designed using the \cf1\b\i Essential Diagram\i0  \cf2\ul RichText\ulnone  node\cf0\b0 .\par
\i\f1\fs20\par
}", new RectangleF(400, 320, 120, 100));

            richTextNode.LineStyle.LineColor = Color.DarkGray;
            diagram1.Model.AppendChild(richTextNode);

#if !NETCORE
            BitmapNode bmpNode = new BitmapNode(@"..\..\..\..\..\..\common\Images\Diagram\OrgChart Layout\image3.png");
#else
            BitmapNode bmpNode = new BitmapNode(@"..\..\..\..\..\..\..\common\Images\Diagram\OrgChart Layout\image3.png");
#endif
            bmpNode.Name                = "BitmapNode1";
            bmpNode.PinPoint            = new PointF(700, 75);
            bmpNode.Size                = new SizeF(120, 100);
            bmpNode.LineStyle.LineWidth = 0;
            diagram1.Model.AppendChild(bmpNode);

            ClosedCurveNode curve = new ClosedCurveNode(new PointF[] { new PointF(120, 350), new PointF(120, 450), new PointF(220, 400) });
            curve.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            curve.FillStyle.ForeColor = Color.White;
            curve.FillStyle.Type      = FillStyleType.LinearGradient;
            curve.LineStyle.LineColor = Color.DarkGray;
            AddLabel(curve, "ClosedCurve", Position.Center);
            diagram1.Model.AppendChild(curve);

            CurveNode curve1 = new CurveNode(new PointF[] { new PointF(120, 100), new PointF(120, 200), new PointF(220, 150) });
            curve1 = new CurveNode(new PointF[] { new PointF(0, 30), new PointF(4.99999952f, 25), new PointF(18.3333321f, 0), new PointF(30, 0), new PointF(41.66666641f, 0), new PointF(58.33333321f, 30), new PointF(70, 30), new PointF(81.66666f, 30), new PointF(95, 4.99999952f), new PointF(100, 0) });
            AddLabel(curve1, "CurveNode", Position.Center);
            diagram1.Model.AppendChild(curve1);

            CircularArc circular = new CircularArc(new RectangleF(640, 150, 100, 100), 0, 270);
            circular.FillStyle.Color     = Color.FromArgb(240, 242, 240);
            circular.FillStyle.ForeColor = Color.White;
            circular.FillStyle.Type      = FillStyleType.LinearGradient;
            circular.LineStyle.LineColor = Color.DarkGray;
            circular.PinPoint            = new PointF(700, 200);
            AddLabel(circular, "CircularArc", Position.Center);
            diagram1.Model.AppendChild(circular);

            Line line1 = new Line(new PointF(700, 320), new PointF(700, 430));
            line1.LineStyle.LineColor = Color.DarkGray;
            AddLabel(line1, "line", Position.TopCenter);
            diagram1.Model.AppendChild(line1);

            PolylineNode polyLine = new PolylineNode(new PointF[] { new PointF(640, 500), new PointF(760, 500), new PointF(640, 540), new PointF(760, 540) });
            polyLine.LineStyle.LineColor = Color.DarkGray;
            polyLine.LineStyle.LineWidth = 1;
            Syncfusion.Windows.Forms.Diagram.Label label = new Syncfusion.Windows.Forms.Diagram.Label(polyLine, "PolyLine Node");
            label.OffsetX              = polyLine.BoundingRectangle.Width / 5f;
            label.OffsetY              = polyLine.BoundingRectangle.Height + 10;
            label.FontStyle.Family     = "Segoe UI";
            label.FontColorStyle.Color = Color.Black;
            label.FontStyle.Size       = 9;
            polyLine.Labels.Add(label);
            diagram1.Model.AppendChild(polyLine);

            BezierCurve bezier = new BezierCurve(new PointF[] { new PointF(100, 470), new PointF(160, 470), new PointF(160, 560), new PointF(220, 560) });
            AddLabel(bezier, "BezierCurve", Position.BottomCenter);
            diagram1.Model.AppendChild(bezier);

            SplineNode spline = new SplineNode(new PointF[] { new PointF(400, 460), new PointF(520, 500), new PointF(400, 520) });
            spline.LineStyle.LineColor = Color.Black;
            spline.LineStyle.LineWidth = 1;
            AddLabel(spline, "Spline", Position.BottomCenter);
            diagram1.Model.AppendChild(spline);
        }
Ejemplo n.º 11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="src"></param>
 public RoundRect(RoundRect src) : base(src)
 {
     this.rcBounds = new RectangleF(src.rcBounds.Location, src.rcBounds.Size);
     this.curvePct = src.curvePct;
 }