public void Redo() { BufferedElement buff = (BufferedElement)undoB.Redo(); if (buff != null) { switch (buff.op) { case "U": buff.objRef.CopyFrom(buff.newE); break; case "I": List.Add(buff.objRef); break; case "D": List.Remove(buff.objRef); break; default: break; } } }
public static IEnumerable <IBufferedElement> SelectWithLocation(this IWebDriver webDriver, ReadOnlyCollection <IWebElement> elements) { var result = webDriver.RunLibraryScript($"return {MethodBase.GetCurrentMethod().Name}(arguments[0])", elements); var returnValue = new List <IBufferedElement>(); foreach (var pair in result as ReadOnlyCollection <object> ) { var dictionary = ((ReadOnlyCollection <object>)pair)[1] as Dictionary <string, object>; var left = ConvertToIntFromTypeUnsafe(dictionary["left"]); var top = ConvertToIntFromTypeUnsafe(dictionary["top"]); var height = ConvertToIntFromTypeUnsafe(dictionary["height"]); var width = ConvertToIntFromTypeUnsafe(dictionary["width"]); var bufferedElement = new BufferedElement { WebElement = ((ReadOnlyCollection <object>)pair)[0] as IWebElement, Rectangle = new Rectangle(left, top, width, height) }; returnValue.Add(bufferedElement); } return(returnValue); }
public void StoreDo(string option, Ele e) { Ele olde = null; if (e.undoEle != null) { olde = e.undoEle.Copy(); } Ele newe = e.Copy(); BufferedElement buff = new BufferedElement(e, newe, olde, option); undoB.Add2Buff(buff); e.undoEle = e.Copy(); }