当前位置: 首页>>代码示例>>C#>>正文


C# ProxySimple.GetPatternProvider方法代码示例

本文整理汇总了C#中MS.Internal.AutomationProxies.ProxySimple.GetPatternProvider方法的典型用法代码示例。如果您正苦于以下问题:C# ProxySimple.GetPatternProvider方法的具体用法?C# ProxySimple.GetPatternProvider怎么用?C# ProxySimple.GetPatternProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MS.Internal.AutomationProxies.ProxySimple的用法示例。


在下文中一共展示了ProxySimple.GetPatternProvider方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleTextSelectionChangedEvent

        private static void HandleTextSelectionChangedEvent(ProxySimple el, IntPtr hwnd, int eventId)
        {
            ITextProvider textProvider = el.GetPatternProvider(TextPattern.Pattern) as ITextProvider;
            if (textProvider == null)
                return;

            if (eventId == NativeMethods.EventObjectLocationChange)
            {
                // We do not want to raise the EventObjectLocationChange when it is caused by a scroll.  To do this
                // store the previous range and compare it to the current range.  The range will not change when scrolling.
                ITextRangeProvider[] currentRanges = textProvider.GetSelection();
                ITextRangeProvider currentRange = null;
                if (currentRanges != null && currentRanges.Length > 0)
                    currentRange = currentRanges[0];

                if (hwnd == _hwndLast && currentRange != null)
                {
                    if (_lastSelection != null && !currentRange.Compare(_lastSelection))
                    {
                        AutomationInteropProvider.RaiseAutomationEvent(TextPattern.TextSelectionChangedEvent, el, new AutomationEventArgs(TextPattern.TextSelectionChangedEvent));
                    }
                }
                else
                {
                    AutomationInteropProvider.RaiseAutomationEvent(TextPattern.TextSelectionChangedEvent, el, new AutomationEventArgs(TextPattern.TextSelectionChangedEvent));
                }

                //store the current range and window handle.
                _hwndLast = hwnd;
                _lastSelection = currentRange;
            }
            else if (eventId == NativeMethods.EventObjectTextSelectionChanged)
            {
                AutomationInteropProvider.RaiseAutomationEvent(
                    TextPattern.TextSelectionChangedEvent, el,
                    new AutomationEventArgs(TextPattern.TextSelectionChangedEvent));
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:38,代码来源:EventManager.cs

示例2: HandleStructureChangedEventClient

 private static void HandleStructureChangedEventClient(ProxySimple el, IntPtr hwnd, int eventId)
 {
     if (eventId == NativeMethods.EventObjectCreate)
     {
         AutomationInteropProvider.RaiseStructureChangedEvent (el, new StructureChangedEventArgs (StructureChangeType.ChildAdded, el.MakeRuntimeId()));
     }
     else if (eventId == NativeMethods.EventObjectDestroy)
     {
         AutomationInteropProvider.RaiseStructureChangedEvent( el, new StructureChangedEventArgs( StructureChangeType.ChildRemoved, el.MakeRuntimeId() ) );
     }
     else if ( eventId == NativeMethods.EventObjectReorder )
     {
         IGridProvider grid = el.GetPatternProvider(GridPattern.Pattern) as IGridProvider;
         if ( grid == null )
             return;
         AutomationInteropProvider.RaiseStructureChangedEvent( el, new StructureChangedEventArgs( StructureChangeType.ChildrenInvalidated, el.MakeRuntimeId() ) );
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:18,代码来源:EventManager.cs

示例3: HandleHorizontalScrollPercentProperty

 private static void HandleHorizontalScrollPercentProperty(ProxySimple el, IntPtr hwnd, int eventId)
 {
     IScrollProvider scroll = el.GetPatternProvider (ScrollPattern.Pattern) as IScrollProvider;
     if (scroll == null || scroll.HorizontalScrollPercent == ScrollPattern.NoScroll)
         return;
     
     RaisePropertyChangedEvent(el, ScrollPattern.HorizontalScrollPercentProperty, scroll.HorizontalScrollPercent);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:EventManager.cs

示例4: HandleWindowInvokedEvent

        private static void HandleWindowInvokedEvent(ProxySimple el, IntPtr hwnd, int eventId)
        {
            IInvokeProvider invoke = el.GetPatternProvider(InvokePattern.Pattern) as IInvokeProvider;
            if (invoke == null)
                return;

            if (eventId == NativeMethods.EventSystemCaptureEnd )
            {
                AutomationInteropProvider.RaiseAutomationEvent(InvokePattern.InvokedEvent, el, new AutomationEventArgs(InvokePattern.InvokedEvent));
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:11,代码来源:EventManager.cs

示例5: HandleElementRemovedFromSelectionEvent

        private static void HandleElementRemovedFromSelectionEvent(ProxySimple el, IntPtr hwnd, int eventId)
        {
            ISelectionItemProvider selProvider = el.GetPatternProvider(SelectionItemPattern.Pattern) as ISelectionItemProvider;
            if (selProvider == null)
                return;

            if (eventId == NativeMethods.EventObjectSelectionRemove)
            {
                AutomationInteropProvider.RaiseAutomationEvent(SelectionItemPattern.ElementRemovedFromSelectionEvent, el, new AutomationEventArgs(SelectionItemPattern.ElementRemovedFromSelectionEvent));
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:11,代码来源:EventManager.cs

示例6: HandleToggleStateProperty

        private static void HandleToggleStateProperty(ProxySimple el, IntPtr hwnd, int eventId)
        {
            IToggleProvider toggle = el.GetPatternProvider(TogglePattern.Pattern) as IToggleProvider;
            if (toggle == null)
                return;

            RaisePropertyChangedEvent(el, TogglePattern.ToggleStateProperty, toggle.ToggleState);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:EventManager.cs

示例7: HandleScrollInvokedEvent

        private static void HandleScrollInvokedEvent(ProxySimple el, IntPtr hwnd, int eventId)
        {
            IInvokeProvider invoke = el.GetPatternProvider(InvokePattern.Pattern) as IInvokeProvider;
            if (invoke == null)
                return;

            if (eventId == NativeMethods.EventObjectStateChange)
            {
                AutomationInteropProvider.RaiseAutomationEvent(InvokePattern.InvokedEvent, el, new AutomationEventArgs(InvokePattern.InvokedEvent));
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:11,代码来源:EventManager.cs

示例8: HandleIsSelectionRequiredProperty

        private static void HandleIsSelectionRequiredProperty(ProxySimple el, IntPtr hwnd, int eventId)
        {
            ISelectionProvider selection = el.GetPatternProvider(SelectionPattern.Pattern) as ISelectionProvider;
            if (selection == null)
                return;

            RaisePropertyChangedEvent(el, SelectionPattern.IsSelectionRequiredProperty, selection.IsSelectionRequired);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:EventManager.cs

示例9: HandleVerticalViewSizeProperty

        private static void HandleVerticalViewSizeProperty(ProxySimple el, IntPtr hwnd, int eventId)
        {
            IScrollProvider scroll = el.GetPatternProvider(ScrollPattern.Pattern) as IScrollProvider;
            if (scroll == null)
                return;

            RaisePropertyChangedEvent(el, ScrollPattern.VerticalViewSizeProperty, scroll.VerticalViewSize);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:EventManager.cs

示例10: HandleRowHeadersProperty

        private static void HandleRowHeadersProperty(ProxySimple el, IntPtr hwnd, int eventId)
        {
            ITableProvider table = el.GetPatternProvider(TablePattern.Pattern) as ITableProvider;
            if (table == null)
                return;

            RaisePropertyChangedEvent(el, TablePattern.RowHeadersProperty, table.GetRowHeaders());
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:EventManager.cs

示例11: HandleRowProperty

        private static void HandleRowProperty(ProxySimple el, IntPtr hwnd, int eventId)
        {
            IGridItemProvider gridItem = el.GetPatternProvider(GridItemPattern.Pattern) as IGridItemProvider;
            if (gridItem == null)
                return;

            RaisePropertyChangedEvent(el, GridItemPattern.RowProperty, gridItem.Row);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:EventManager.cs

示例12: HandleColumnCountProperty

        private static void HandleColumnCountProperty(ProxySimple el, IntPtr hwnd, int eventId)
        {
            IGridProvider grid = el.GetPatternProvider(GridPattern.Pattern) as IGridProvider;
            if (grid == null)
                return;

            RaisePropertyChangedEvent(el, GridPattern.ColumnCountProperty, grid.ColumnCount);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:EventManager.cs

示例13: HandleExpandCollapseStateProperty

 private static void HandleExpandCollapseStateProperty(ProxySimple el, IntPtr hwnd, int eventId)
 {
     IExpandCollapseProvider expandCollapse = el.GetPatternProvider(ExpandCollapsePattern.Pattern) as IExpandCollapseProvider;
     if (expandCollapse == null)
         return;
     
     RaisePropertyChangedEvent(el, ExpandCollapsePattern.ExpandCollapseStateProperty, expandCollapse.ExpandCollapseState);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:EventManager.cs

示例14: HandleRangeValueProperty

        private static void HandleRangeValueProperty(ProxySimple el, IntPtr hwnd, int eventId)
        {
            IRangeValueProvider rangeValue = el.GetPatternProvider(RangeValuePattern.Pattern) as IRangeValueProvider;
            if (rangeValue == null)
                return;

            RaisePropertyChangedEvent(el, RangeValuePattern.ValueProperty, rangeValue.Value);
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:8,代码来源:EventManager.cs


注:本文中的MS.Internal.AutomationProxies.ProxySimple.GetPatternProvider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。