Description of Highlighter.
Inheritance: IDisposable
示例#1
0
        internal static void Enqueue(Highlighter highLighter)
        {
            if (null == highLighter) {
                return;
            }

            if (HighlightersMaxCount <= HighlightersQueue.Count) {
                DecreaseQueue(HighlightersMaxCount - 1);
            }

            HighlightersQueue.Enqueue(highLighter);
        }
示例#2
0
        public static void Enqueue(
			AutomationElement elementToHighlight,
			int highlightersGeneration,
		    string highlighterData)
        {
            Highlighter highlighter = null;
            if (null != (elementToHighlight as AutomationElement)) {

                if (0 >= highlightersGeneration) {
                    HighlighterNumber++;
                } else {
                    HighlighterNumber = highlightersGeneration;
                }

                highlighter =
                    new Highlighter(
                        elementToHighlight.Current.BoundingRectangle.Height,
                        elementToHighlight.Current.BoundingRectangle.Width,
                        elementToHighlight.Current.BoundingRectangle.X,
                        elementToHighlight.Current.BoundingRectangle.Y,
                        elementToHighlight.Current.NativeWindowHandle,
                        (Highlighters)(HighlighterNumber % 10),
                        HighlighterNumber,
                        highlighterData);
                ExecutionPlan.Enqueue(highlighter);
            }
        }
示例#3
0
        public static void Enqueue(
            // 20131109
            //AutomationElement elementToHighlight,
            IUiElement elementToHighlight,
            // 20131204
            // int highlightersGeneration,
            string highlighterData)
        {
            // 20131109
            //if (null == (elementToHighlight as AutomationElement)) return;
            if (null == elementToHighlight) return;
            /*
            if (null == (elementToHighlight as IUiElement)) return;
            */
            // 20131204
//            if (0 >= highlightersGeneration) {
//                HighlighterNumber++;
//            } else {
//                HighlighterNumber = highlightersGeneration;
//            }
            if (0 == CommonCmdletBase.HighlighterGeneration) {
                CommonCmdletBase.HighlighterGeneration++;
            }
                
            // Highlighter highlighter = new Highlighter(
            var highlighter = new Highlighter(
                // 20140312
//                elementToHighlight.Current.BoundingRectangle.Height,
//                elementToHighlight.Current.BoundingRectangle.Width,
//                elementToHighlight.Current.BoundingRectangle.X,
//                elementToHighlight.Current.BoundingRectangle.Y,
//                elementToHighlight.Current.NativeWindowHandle,
                elementToHighlight.GetCurrent().BoundingRectangle.Height,
                elementToHighlight.GetCurrent().BoundingRectangle.Width,
                elementToHighlight.GetCurrent().BoundingRectangle.X,
                elementToHighlight.GetCurrent().BoundingRectangle.Y,
                elementToHighlight.GetCurrent().NativeWindowHandle,
                // 20131204
                // (Highlighters)(HighlighterNumber % 10),
                (Highlighters)(CommonCmdletBase.HighlighterGeneration % 10),
                // 20131204
                // HighlighterNumber,
                CommonCmdletBase.HighlighterGeneration,
                highlighterData);
            Enqueue(highlighter);

            /*
            if (null != (elementToHighlight as AutomationElement)) {

                if (0 >= highlightersGeneration) {
                    HighlighterNumber++;
                } else {
                    HighlighterNumber = highlightersGeneration;
                }
                
                highlighter =
                    new Highlighter(
                        elementToHighlight.Current.BoundingRectangle.Height,
                        elementToHighlight.Current.BoundingRectangle.Width,
                        elementToHighlight.Current.BoundingRectangle.X,
                        elementToHighlight.Current.BoundingRectangle.Y,
                        elementToHighlight.Current.NativeWindowHandle,
                        (Highlighters)(HighlighterNumber % 10),
                        HighlighterNumber,
                        highlighterData);
                ExecutionPlan.Enqueue(highlighter);
            }
            */
        }