Beispiel #1
0
        /// <summary>
        /// This is only used when cloning the Stroq.
        /// </summary>
        protected Stroq(Stroke s, Dictionary <Guid, object> strokeprops, Dictionary <Guid, SortedDictionary <int, object> > ptprops, Stroq oldstroq)
            : this(s, true)
        {
            _strokeProperties = strokeprops;
            _ptProperties     = ptprops;
            Property          = new SyntacticSugarDictionary <Guid, object>(this, _ptProperties, _strokeProperties);

            // notify the properties about the cloning
            foreach (var sp in _strokeProperties)
            {
                IStroqCloneable pval = sp.Value as IStroqCloneable;
                if (pval != null)
                {
                    pval.AfterClone(oldstroq, this);
                }
            }
            foreach (var pp in _ptProperties)
            {
                foreach (var prop in pp.Value)
                {
                    IStroqCloneable pval = prop.Value as IStroqCloneable;
                    if (pval != null)
                    {
                        pval.AfterClone(oldstroq, this);
                    }
                }
            }

            if (StroqCreated != null)
            {
                StroqCreated(this);
            }
        }
Beispiel #2
0
 protected Stroq(Stroke backingStroke, bool suppressEvent)
 {
     _backingStroke = backingStroke;
     Property       = new SyntacticSugarDictionary <Guid, object>(this, _ptProperties, _strokeProperties);
     if (!suppressEvent && StroqCreated != null)
     {
         StroqCreated(this);
     }
 }
Beispiel #3
0
 public void onDeserializedFix(StreamingContext sc)
 {
     if (_backingStrokeShadow != null)
     {
         _strokeProperties        = _strokePropsSerialShadow;
         _strokePropsSerialShadow = null;
         _ptProperties            = _ptPropsSerialShadow;
         _ptPropsSerialShadow     = null;
         StrokeCollection stc = new StrokeCollection(_backingStrokeShadow);
         _backingStroke       = stc[0];
         _backingStrokeShadow = null;
         Property             = new SyntacticSugarDictionary <Guid, object>(this, _ptProperties, _strokeProperties);
     }
 }