You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
656 B
36 lines
656 B
using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Text; |
|
|
|
namespace SharpDevelop.XamlDesigner.Dom.UndoSystem |
|
{ |
|
class InsertAction : UndoAction |
|
{ |
|
public InsertAction(DesignItemCollection collection, DesignItem item, int index) |
|
{ |
|
this.collection = collection; |
|
this.item = item; |
|
this.index = index; |
|
} |
|
|
|
DesignItemCollection collection; |
|
DesignItem item; |
|
int index; |
|
|
|
public override void Undo() |
|
{ |
|
collection.RemoveAt(index); |
|
} |
|
|
|
public override void Redo() |
|
{ |
|
collection.Insert(index, item); |
|
} |
|
|
|
public override IEnumerable<DesignItem> GetAffectedItems() |
|
{ |
|
yield return item; |
|
} |
|
} |
|
}
|
|
|