Exemple #1
0
		public void Add(IUndoData objectToUndoTo, string typeOfObject, MergeType mergeType)
		{
			IUndoData cloneableObject = objectToUndoTo;
			if (cloneableObject != null)
			{
				if (currentUndoIndex <= 0
					|| mergeType == MergeType.NotMergable
					|| undoBuffer[currentUndoIndex].typeOfObject != typeOfObject)
				{
					currentUndoIndex++;
				}

				UndoCheckPoint newUndoCheckPoint = new UndoCheckPoint(cloneableObject.Clone(), typeOfObject, mergeType);
				if (currentUndoIndex < undoBuffer.Count)
				{
					undoBuffer[currentUndoIndex] = newUndoCheckPoint;
				}
				else
				{
					undoBuffer.Add(newUndoCheckPoint);
				}

				lastValidUndoIndex = currentUndoIndex;
			}
		}
Exemple #2
0
        public void Add(IUndoData objectToUndoTo, string typeOfObject, MergeType mergeType)
        {
            IUndoData cloneableObject = objectToUndoTo;

            if (cloneableObject != null)
            {
                if (currentUndoIndex <= 0 ||
                    mergeType == MergeType.NotMergable ||
                    undoBuffer[currentUndoIndex].typeOfObject != typeOfObject)
                {
                    currentUndoIndex++;
                }

                UndoCheckPoint newUndoCheckPoint = new UndoCheckPoint(cloneableObject.Clone(), typeOfObject, mergeType);
                if (currentUndoIndex < undoBuffer.Count)
                {
                    undoBuffer[currentUndoIndex] = newUndoCheckPoint;
                }
                else
                {
                    undoBuffer.Add(newUndoCheckPoint);
                }

                lastValidUndoIndex = currentUndoIndex;
            }
        }
Exemple #3
0
			internal UndoCheckPoint(IUndoData objectToUndoTo, string typeOfObject, MergeType mergeType)
			{
				this.objectToUndoTo = objectToUndoTo;
				this.typeOfObject = typeOfObject;
				this.mergeType = mergeType;
			}
Exemple #4
0
 internal UndoCheckPoint(IUndoData objectToUndoTo, string typeOfObject, MergeType mergeType)
 {
     this.objectToUndoTo = objectToUndoTo;
     this.typeOfObject   = typeOfObject;
     this.mergeType      = mergeType;
 }