Example #1
0
 /// <inheritdoc />
 public void UnExecute()
 {
     ElementToMove.Remove();
     if (IndexBeforeMove == ParentElementBeforeMove.Elements().Count())
     {
         ParentElementBeforeMove.Add(ElementToMove);
     }
     else
     {
         ParentElementBeforeMove.Elements().ToList()[IndexBeforeMove].AddBeforeSelf(ElementToMove);
     }
 }
Example #2
0
 /// <inheritdoc />
 public void Execute()
 {
     ElementToMove.Remove();
     ParentElementBeforeMove.AddAfterSelf(ElementToMove);
 }
Example #3
0
 /// <summary>
 /// Constructor setting the <see cref="ElementToMove"/>
 /// </summary>
 /// <param name="elementToMove">The <see cref="ElementToMove"/></param>
 public MoveElementOutAction(XElement elementToMove)
 {
     ElementToMove           = elementToMove;
     ParentElementBeforeMove = ElementToMove.Parent;
     IndexBeforeMove         = ParentElementBeforeMove?.Elements().ToList().IndexOf(ElementToMove) ?? 0;
 }