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