Exemplo n.º 1
0
        public Shape(Shape prototype) : base(prototype)
        {
            mAllowMove    = prototype.AllowMove;
            mAllowScale   = prototype.AllowScale;
            mAllowRotate  = prototype.AllowRotate;
            mDrawSelected = prototype.DrawSelected;
            mDirection    = prototype.Direction;
            mInteraction  = prototype.Interaction;

            mMaximumSize = prototype.MaximumSize;
            mMinimumSize = prototype.MinimumSize;
            mKeepAspect  = prototype.KeepAspect;

            //Copy ports
            Ports = new Elements(typeof(Port), "Port");
            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.Animation != null)
            {
                mAnimation = (Animation)prototype.Animation.Clone();
            }
        }
Exemplo n.º 2
0
        public Shape(Shape prototype) : base(prototype)
        {
            AllowMove     = prototype.AllowMove;
            AllowScale    = prototype.AllowScale;
            AllowRotate   = prototype.AllowRotate;
            _drawSelected = prototype.DrawSelected;
            Direction     = prototype.Direction;
            Interaction   = prototype.Interaction;

            MaximumSize = prototype.MaximumSize;
            MinimumSize = prototype.MinimumSize;
            _keepAspect = prototype.KeepAspect;

            //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();
            }
        }
Exemplo n.º 3
0
        public Line(Line prototype) : base(prototype)
        {
            mAllowMove    = prototype.AllowMove;
            mLineJoin     = prototype.LineJoin;
            mDrawSelected = prototype.DrawSelected;
            mInteraction  = 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;

            mPoints = (ArrayList)prototype.Points.Clone();

            //Copy ports
            Ports = new Elements(typeof(Port), "Port");
            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.Animation != null)
            {
                mAnimation = (Animation)prototype.Animation.Clone();
            }

            DrawPath();
        }
Exemplo n.º 4
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();
        }