Пример #1
0
        /// <summary>
        /// Make a following bounds change on this containerlist undoable!
        /// </summary>
        /// <param name="allowMerge">true means allow the moves to be merged</param>
        public void MakeBoundsChangeUndoable(bool allowMerge)
        {
            List <IDrawableContainer> movingList = new List <IDrawableContainer>();
            Surface surface = null;

            foreach (DrawableContainer dc in this)
            {
                movingList.Add(dc);
                surface = dc.parent;
            }
            if (movingList.Count > 0 && surface != null)
            {
                surface.MakeUndoable(new DrawableContainerBoundsChangeMemento(movingList), allowMerge);
            }
        }
Пример #2
0
 /// <summary>
 /// Make a following bounds change on this drawablecontainer undoable!
 /// </summary>
 /// <param name="allowMerge">true means allow the moves to be merged</param>
 public void MakeBoundsChangeUndoable(bool allowMerge)
 {
     _parent.MakeUndoable(new DrawableContainerBoundsChangeMemento(this), allowMerge);
 }
Пример #3
0
 /// <summary>
 /// This method will be called before a field is changes.
 /// Using this makes it possible to invalidate the object as is before changing.
 /// </summary>
 /// <param name="fieldToBeChanged">The field to be changed</param>
 /// <param name="newValue">The new value</param>
 public virtual void BeforeFieldChange(Field fieldToBeChanged, object newValue)
 {
     parent.MakeUndoable(new ChangeFieldHolderMemento(this, fieldToBeChanged), true);
     Invalidate();
 }