private void OnMouseUp(InputEventArgs e) { isMouseDown = false; var thread = new Thread(new ThreadStart(() => { Log.Debug(string.Format("Windows.Recording::OnMouseUp::begin")); var re = new RecordEvent(); re.Button = e.Button; var a = new GetElement { DisplayName = e.Element.Name }; var sw = new System.Diagnostics.Stopwatch(); sw.Start(); WindowsSelector sel = null; // sel = new WindowsSelector(e.Element.rawElement, null, true); sel = new WindowsSelector(e.Element.RawElement, null, PluginConfig.enum_selector_properties); if (sel.Count < 2) { return; } if (sel == null) { return; } a.Selector = sel.ToString(); a.MaxResults = 1; a.Image = e.Element.ImageString(); re.OffsetX = e.X - e.Element.Rectangle.X; re.OffsetY = e.Y - e.Element.Rectangle.Y; re.UIElement = e.Element; re.Element = e.Element; re.Selector = sel; re.X = e.X; re.Y = e.Y; if (sel.Count > 3) { var p1 = sel[1].Properties.Where(x => x.Name == "ClassName").FirstOrDefault(); var p2 = sel[2].Properties.Where(x => x.Name == "AutomationId").FirstOrDefault(); if (p1 != null && p2 != null) { if (p1.Value.StartsWith("Windows.UI") && p2.Value == "SplitViewFrameXAMLWindow") { re.SupportVirtualClick = false; } } } re.a = new GetElementResult(a); re.SupportInput = e.Element.SupportInput; Log.Debug(string.Format("Windows.Recording::OnMouseUp::end {0:mm\\:ss\\.fff}", sw.Elapsed)); OnUserAction?.Invoke(this, re); })); thread.IsBackground = true; thread.Start(); }
public Activity Create(System.Windows.DependencyObject target) { var fef = new GetElement(); var aa = new ActivityAction <UIElement>(); var da = new DelegateInArgument <UIElement>(); da.Name = "item"; fef.Body = aa; aa.Argument = da; return(fef); }
public Activity Create(System.Windows.DependencyObject target) { var da = new DelegateInArgument <UIElement> { Name = "item" }; Type t = Type.GetType("OpenRPA.Activities.ClickElement, OpenRPA"); var instance = Activator.CreateInstance(t); var fef = new GetElement(); fef.Body = new ActivityAction <UIElement> { Argument = da, Handler = (Activity)instance }; return(fef); }
private void OnMouseUp(InputEventArgs e) { var thread = new Thread(new ThreadStart(() => { Log.Debug(string.Format("Windows.Recording::OnMouseUp::begin")); var re = new RecordEvent(); re.Button = e.Button; var a = new GetElement { DisplayName = e.Element.Id + "-" + e.Element.Name }; var sw = new System.Diagnostics.Stopwatch(); sw.Start(); WindowsSelector sel = null; // sel = new WindowsSelector(e.Element.rawElement, null, true); sel = new WindowsSelector(e.Element.RawElement, null, false); if (sel.Count < 2) { return; } if (sel == null) { return; } a.Selector = sel.ToString(); a.MaxResults = 1; a.Image = e.Element.ImageString(); re.UIElement = e.Element; re.Element = e.Element; re.Selector = sel; re.X = e.X; re.Y = e.Y; re.a = new GetElementResult(a); re.SupportInput = e.Element.SupportInput; Log.Debug(string.Format("Windows.Recording::OnMouseUp::end {0:mm\\:ss\\.fff}", sw.Elapsed)); OnUserAction?.Invoke(this, re); })); thread.IsBackground = true; thread.Start(); }
public GetElementResult(GetElement activity) { Activity = activity; }