예제 #1
0
        public override FlowChartComponent GetComponent()
        {
            FlowChartComponent component = new FlowChartComponent();

            component.ID   = this.ID;
            component.Text = Text;
            component.Type = this.GetType().FullName;
            component.Points.Add(StartPoint);
            component.Points.Add(EndPoint);

            FlowChartReference fcRef1 = new FlowChartReference
            {
                ID   = ConnectionStart != null ? ConnectionStart.ID : string.Empty,
                Name = "Start"
            };
            FlowChartReference fcRef2 = new FlowChartReference
            {
                ID   = ConnectionEnd != null ? ConnectionEnd.ID : string.Empty,
                Name = "End"
            };

            component.ConnectionIds.Add(fcRef1);
            component.ConnectionIds.Add(fcRef2);

            if (ConnectionStart != null)
            {
                fcRef1.Key1 = ConnectionStartPointIndex;
            }
            if (ConnectionEnd != null)
            {
                fcRef2.Key1 = ConnectionEndPointIndex;
            }
            return(component);
        }
예제 #2
0
        private void HookToParentBox(BaseLineComponent c)
        {
            FlowChartReference fRef1 = component.ConnectionIds.Find(y => y.Name == "Start");

            if (fRef1 != null)
            {
                c.ConnectionStart = (BaseBoxComponent)this.model.Items.Find(y => y.ID == fRef1.ID);
            }
            FlowChartReference fRef2 = component.ConnectionIds.Find(y => y.Name == "End");

            if (fRef2 != null)
            {
                c.ConnectionEnd = (BaseBoxComponent)this.model.Items.Find(y => y.ID == fRef2.ID);
            }

            c.ConnectionStartPointIndex = fRef1.Key1;
            c.ConnectionEndPointIndex   = fRef2.Key1;
        }