本文整理汇总了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));
}
}
示例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() ) );
}
}
示例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);
}
示例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));
}
}
示例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));
}
}
示例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);
}
示例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));
}
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}