예제 #1
0
 protected AutomationBase(IPropertyLibray propertyLibrary, IEventLibrary eventLibrary, IPatternLibrary patternLibrary)
 {
     PropertyLibrary  = propertyLibrary;
     EventLibrary     = eventLibrary;
     PatternLibrary   = patternLibrary;
     ConditionFactory = new ConditionFactory(propertyLibrary);
     OverlayManager   = new WinFormsOverlayManager();
 }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
        /// <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;
        }
예제 #5
0
        /// <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);
                }
            }
        }