Example #1
0
        /// <summary>
        /// Raises the <see cref="Changed"/> event.
        /// </summary>
        /// <param name="e">an edit describing the change that just happened</param>
        /// <remarks>
        /// If you override this method, be sure to call the base method first.
        /// </remarks>
        protected virtual void OnChanged(ModelChangedEventArgs e)
        {
            if (e == null)
            {
                return;
            }
            if (_ChangedEvent != null)
            {
                _ChangedEvent(this, e);
            }

            if (!this.SkipsUndoManager && !this.Initializing)
            {
                UndoManager um = this.UndoManager;
                if (um != null)
                {
                    um.HandleModelChanged(this, e);
                }
                if (((int)e.Change) >= (int)ModelChange.Property)
                {
                    this.IsModified = true;
                }
            }
        }
Example #2
0
    /// <summary>
    /// Reset the fields that should not be shared from a copy created by <see cref="Object.MemberwiseClone"/>.
    /// </summary>
    /// <remarks>
    /// If you override this method because you have added some fields,
    /// be sure to call the base method too.
    /// </remarks>
    protected virtual void Reinitialize() {
      _ChangedEvent = null;

      _UndoManager = null;
      _UndoEditIndex = -2;

      _IsModified = false;
    }