示例#1
0
 /// <summary>
 /// Common constructors initialization
 /// </summary>
 public void InitConnection()
 {
     //From = null;
     //To = null;
     this.ShowLabel   = false;
     Pen              = BlackPen;
     mPainter         = new DefaultPainter(this);
     mTracker         = new ConnectionTracker(mInsertionPoints, true);
     mInsertionPoints = new ArrayList();
 }
示例#2
0
        /// <summary>
        /// Deserialization constructor
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected Connection(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            this.InitConnection();
            //attaching the connection to shape connector occurs in the BinarySerializer class;
            //instantiate the connectors to keep the UID references until then

            this.mTo = new Connector(info.GetString("mTo.UID"));

            this.mFrom = new Connector(info.GetString("mFrom.UID"));

            this.mLineColor = (Color)info.GetValue("mLineColor", typeof(Color));

            this.mLineEnd = (ConnectionEnd)info.GetValue("mLineEnd", typeof(ConnectionEnd));

            this.mLineWidth = info.GetInt32("mLineWidth");

            mLinePath = info.GetString("mLinePath");

            if (mLinePath == "Bezier")
            {
                mPainter = info.GetValue("mPainter", typeof(BezierPainter)) as BezierPainter;
            }

            mInsertionPoints = (ArrayList)info.GetValue("mInsertionPoints", typeof(ArrayList));

            this.Tag = info.GetString("mLayer");             //layer is set in the post-deserialization

            try
            {
                this.mZOrder = info.GetInt32("mZOrder");
            }
            catch
            {
                this.mZOrder = 0;
            }
        }
 /// <summary>
 /// Common constructors initialization
 /// </summary>
 public void InitConnection()
 {
     //From = null;
     //To = null;
     this.mShowLabel = false;
     this.pen = this.blackpen;
     mPainter  = new DefaultPainter(this);
     mTracker = new ConnectionTracker(insertionPoints,true);
     insertionPoints = new ArrayList();
 }