Beispiel #1
0
        public Shape(StencilItem stencil)
        {
            AllowMove    = true;
            AllowScale   = true;
            AllowRotate  = false;
            DrawSelected = true;
            Direction    = Direction.Both;
            Interaction  = UserInteraction.BringToFront;

            MinimumSize = new SizeF(32, 32);
            MaximumSize = new SizeF(320, 320);

            //Set up stencil
            StencilItem = stencil;
            stencil.CopyTo(this);

            Ports = new Ports(Model);
        }
Beispiel #2
0
        public Link(Link prototype)
        {
            AllowMove    = prototype.AllowMove;
            LineJoin     = prototype.LineJoin;
            DrawSelected = prototype.DrawSelected;
            Interaction  = prototype.Interaction;

            //Set up new origins
            Start = new Origin(prototype.FirstPoint);
            End   = new Origin(prototype.LastPoint);

            Start.Marker = prototype.Start.Marker;
            End.Marker   = prototype.End.Marker;

            List <PointF> points = new List <PointF>();

            points.AddRange(prototype.Points);
            SetPoints(points);

            //Copy ports
            Ports = new Ports(Model);
            foreach (Port port in prototype.Ports.Values)
            {
                Port clone = (Port)port.Clone();
                Ports.Add(port.Key, clone);

                clone.SuspendValidation();
                clone.Location = port.Location;
                clone.ResumeValidation();
            }

            if (prototype.Label != null)
            {
                Label = (Label)prototype.Label.Clone();
            }
            if (prototype.Image != null)
            {
                Image = (Image)prototype.Image.Clone();
            }

            DrawPath();
        }
Beispiel #3
0
 public Link(Port start, Port end) : base()
 {
     Start = new Origin(start);
     End   = new Origin(end);
     Ports = new Ports(Model);
 }
Beispiel #4
0
 public Link(Shape start, Shape end) : base()
 {
     Start = new Origin(start);
     End   = new Origin(end);
     Ports = new Ports(Model);
 }
Beispiel #5
0
 public Link(Origin start, Origin end) : base()
 {
     Start = start;
     End   = end;
     Ports = new Ports(Model);
 }
Beispiel #6
0
 //Constructors
 public Link() : base()
 {
     Start = new Origin();
     End   = new Origin();
     Ports = new Ports(Model);
 }