public ReverseCommand(UndoableList <T> list, int index, int count) { this.mList = list; this.mIndex = index; this.mCount = count; this.mLabel = "Reverse list"; }
public SwapCommand(UndoableList <T> list, int index1, int index2) { this.mList = list; this.mIndex1 = index1; this.mIndex2 = index2; this.mLabel = string.Concat("Swap list items at indices ", index1, " and ", index2); }
public ClearCommand(UndoableList <T> list) { this.mList = list; this.mBackup = new T[this.mList.mSize]; Array.Copy(this.mList.mItems, this.mBackup, this.mList.mSize); this.mLabel = "Clear list"; }
public SetAtIndexCommand(UndoableList <T> list, int index, T item) { this.mList = list; this.mIndex = index; this.mBackup = list.mItems[index]; this.mItem = item; this.mLabel = string.Concat("Set list item at index ", index.ToString()); }
public AddInsertCommand(UndoableList <T> list, int index, T item) { this.mList = list; this.mIndex = index; this.mItem = item; if (index == -1) { this.mLabel = "Add item to list"; } else { this.mLabel = string.Concat("Insert item in list at index ", index.ToString()); } }
public RemoveAtCommand(UndoableList <T> list, int index) { this.mList = list; this.mIndex = index; this.mItem = this.mList.mItems[index]; }