protected AutomationBase(IPropertyLibray propertyLibrary, IEventLibrary eventLibrary, IPatternLibrary patternLibrary) { PropertyLibrary = propertyLibrary; EventLibrary = eventLibrary; PatternLibrary = patternLibrary; ConditionFactory = new ConditionFactory(propertyLibrary); OverlayManager = new WinFormsOverlayManager(); }
protected AutomationBase(IPropertyLibrary propertyLibrary, IEventLibrary eventLibrary, IPatternLibrary patternLibrary) { PropertyLibrary = propertyLibrary; EventLibrary = eventLibrary; PatternLibrary = patternLibrary; ConditionFactory = new ConditionFactory(propertyLibrary); OverlayManager = new WinFormsOverlayManager(); // Make sure all pattern ids are initialized var unused = PatternLibrary.AllForCurrentFramework; }
protected AutomationBase(IPropertyLibray propertyLibrary, IEventLibrary eventLibrary, IPatternLibrary patternLibrary) { PropertyLibrary = propertyLibrary; EventLibrary = eventLibrary; PatternLibrary = patternLibrary; ConditionFactory = new ConditionFactory(propertyLibrary); OverlayManager = new WinFormsOverlayManager(); // Make sure all pattern ids are initialized var allPatterns = PatternLibrary.AllSupportedPatterns; }
/// <summary> /// Creates a new <see cref="AutomationBase"/> instance. /// </summary> /// <param name="propertyLibrary">The property library to use.</param> /// <param name="eventLibrary">The event library to use.</param> /// <param name="patternLibrary">The pattern library to use.</param> /// <param name="textAttributeLibrary">The text attribute library to use.</param> protected AutomationBase(IPropertyLibrary propertyLibrary, IEventLibrary eventLibrary, IPatternLibrary patternLibrary, ITextAttributeLibrary textAttributeLibrary) { PropertyLibrary = propertyLibrary; EventLibrary = eventLibrary; PatternLibrary = patternLibrary; TextAttributeLibrary = textAttributeLibrary; ConditionFactory = new ConditionFactory(propertyLibrary); #if NETSTANDARD OverlayManager = new NullOverlayManager(); #else OverlayManager = new WinFormsOverlayManager(); #endif // Make sure all pattern ids are initialized var unused = PatternLibrary.AllForCurrentFramework; }
/// <summary> /// 高亮一个元素 /// </summary> /// <param name="color">高亮的颜色</param> /// <param name="duration">延迟时间</param> /// <param name="blocking">是否堵塞</param> public void DrawHighlight(Color?color = null, TimeSpan?duration = null, bool blocking = false) { var colorName = color ?? Color.Red; var rectangle = uiNode.BoundingRectangle; this.BoundingRectangle = uiNode.BoundingRectangle; if (!rectangle.IsEmpty) { var durationInMs = (int)(duration ?? TimeSpan.FromSeconds(2)).TotalMilliseconds; var overlayManager = new WinFormsOverlayManager(); if (blocking) { overlayManager.ShowBlocking(rectangle, colorName, durationInMs); } else { overlayManager.Show(rectangle, colorName, durationInMs); } } }