Esempio n. 1
0
 public ReverseCommand(UndoableList <T> list, int index, int count)
 {
     this.mList  = list;
     this.mIndex = index;
     this.mCount = count;
     this.mLabel = "Reverse list";
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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";
 }
Esempio n. 4
0
 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());
 }
Esempio n. 5
0
 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());
     }
 }
Esempio n. 6
0
 public RemoveAtCommand(UndoableList <T> list, int index)
 {
     this.mList  = list;
     this.mIndex = index;
     this.mItem  = this.mList.mItems[index];
 }