• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# AutomationProxies.ProxySimple类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ProxySimple类属于MS.Internal.AutomationProxies命名空间,在下文中一共展示了ProxySimple类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: 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


示例2: PreviousSibling

            // Returns the previous sibling element in the raw hierarchy.
            // Peripheral controls have always negative values.
            // Returns null is no previous.
            private ProxySimple PreviousSibling (ProxySimple child)
            {
                IntPtr hPrev = WindowsTreeView.GetPreviousItem (_hwnd, ((TreeViewItem) child)._hItem);

                return hPrev != IntPtr.Zero ? new TreeViewItem(_hwnd, this, hPrev, _item + 1) : null;
            }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:9,代码来源:WindowsTreeView.cs


示例3: GetPreviousSibling

        // Returns the previous sibling element in the raw hierarchy.
        // Peripheral controls have always negative values.
        // Returns null is no previous
        internal override ProxySimple GetPreviousSibling (ProxySimple child)
        {
            // start with the scrollbars
            ProxySimple ret = base.GetPreviousSibling (child);

            if (ret != null)
            {
                return ret;
            }

            // top level Treeview return the prev
            TVItem item = (TVItem)child._item;

            if (item == TVItem.TopLevel)
            {
                IntPtr hPrev = GetPreviousItem (_hwnd, ((TreeViewItem) child)._hItem);

                return hPrev != IntPtr.Zero ? new TreeViewItem (_hwnd, this, hPrev, (int) TVItem.TopLevel) : null;
            }

            // either scroll bar or nothing as prev
            IntPtr hChild = GetRoot (_hwnd);

            if (hChild != IntPtr.Zero)
            {
                // First Child found, now retrieve the last one (no specific msg, need to walk thru all of them)
                IntPtr temp;

                for (temp = GetNextItem (_hwnd, hChild); temp != IntPtr.Zero; temp = GetNextItem (_hwnd, hChild))
                {
                    hChild = temp;
                }

                return new TreeViewItem (_hwnd, this, hChild, (int) TVItem.TopLevel);
            }

            return null;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:41,代码来源:WindowsTreeView.cs


示例4: GetPreviousSibling

 // Returns the previous sibling element in the raw hierarchy.
 // Peripheral controls have always negative values.
 // Returns null is no previous.
 internal override ProxySimple GetPreviousSibling(ProxySimple child)
 {
     return _elUpDown.GetPreviousSibling(child);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:WindowsSpinner.cs


示例5: Compare

        // Compares 2 raw elements and returns true if equal, false otherwise
        internal static bool Compare(ProxySimple el1, ProxySimple el2)
        {
            int[] a1 = el1.GetRuntimeId();
            int[] a2 = el2.GetRuntimeId();
            int l = a1.Length;

            if (l != a2.Length)
                return false;

            for (int i = 0; i < l; i++)
            {
                if (a1[i] != a2[i])
                {
                    return false;
                }
            }

            return true;
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:20,代码来源:Misc.cs


示例6: GetPreviousSibling

 // Returns the previous sibling element in the raw hierarchy.
 // Peripheral controls have always negative values.
 // Returns null is no previous
 internal override ProxySimple GetPreviousSibling (ProxySimple child)
 {
     // If the index of the previous node would be out of range...
     int item = child._item;
     if (item > 0 && item < Count)
     {
         return CreateRebarItem (item - 1);
     }
     return null;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:13,代码来源:WindowsRebar.cs


示例7: 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


示例8: 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


示例9: 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


示例10: 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


示例11: 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


示例12: 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


示例13: 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


示例14: 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


示例15: 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


示例16: DispatchEvent

        // ------------------------------------------------------
        //
        // Constructors
        //
        // ------------------------------------------------------

        #region Constructors

        
        #endregion
        
        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------

        #region Internal Methods

        internal static void DispatchEvent(ProxySimple el, IntPtr hwnd, int eventId, object idProp, int idObject)
        {
            // This logic uses a hastables in order to get to a delegate that will raise the correct Automation event
            // that may be a property change event a Automation event or a structure changed event. 
            // There are three hashtables one for each idObject we support.  Depending on the idObject that gets
            // passed in we access one of these hashtables with a key of an automation identifier and then retrieve 
            // the data which ia a delegate of type RasieEvent.  This delegate is called to raise the correct type of event.
            RaiseEvent raiseEvent = null;

            switch (idObject)
            {
                case NativeMethods.OBJID_WINDOW:
                    lock (_classLock)
                    {
                        if (_objectIdWindow == null)
                            InitObjectIdWindow();
                    }
                    
                    raiseEvent = (RaiseEvent)_objectIdWindow[idProp];
                    break;
                    
                case NativeMethods.OBJID_CLIENT:
                    lock (_classLock)
                    {
                        if (_objectIdClient == null)
                            InitObjectIdClient();
                    }

                    raiseEvent = (RaiseEvent)_objectIdClient[idProp];
                    break;
                    
                case NativeMethods.OBJID_VSCROLL:
                case NativeMethods.OBJID_HSCROLL:
                    lock (_classLock)
                    {
                        if (_objectIdScroll == null)
                            InitObjectIdScroll();
                    }

                    raiseEvent = (RaiseEvent)_objectIdScroll[idProp];
                    break;

                case NativeMethods.OBJID_CARET:
                    lock (_classLock)
                    {
                        if (_objectIdCaret == null)
                            InitObjectIdCaret();
                    }

                    raiseEvent = (RaiseEvent)_objectIdCaret[idProp];
                    break;

                case NativeMethods.OBJID_SYSMENU:
                case NativeMethods.OBJID_MENU:
                    lock (_classLock)
                    {
                        if (_objectIdMenu == null)
                            InitObjectIdMenu();
                    }

                    raiseEvent = (RaiseEvent)_objectIdMenu[idProp];
                    break;

                default:
                    // Commented out to remove annoying asserts temporarily.
                    // (See work item PS1254940.)
                    //System.Diagnostics.Debug.Assert(false, "Unexpected idObject " + idObject);
                    return;
            }
            
            
            if (raiseEvent != null)
            {
                raiseEvent(el, hwnd, eventId);
            }
            else
            {
                // If there is no delegate then we need to handle this property genericly by just getting the property value
                // and raising the a property changed event.
                AutomationProperty property = idProp as AutomationProperty;
                if (property == null)
//.........这里部分代码省略.........
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:101,代码来源:EventManager.cs


示例17: HandleMenuItemInvokedEvent

 private static void HandleMenuItemInvokedEvent(ProxySimple el, IntPtr hwnd, int eventId)
 {
     // Skip the check for InvokePattern because el is just a wrapper on a dead element and
     // GetPatternProvider will fail to return the pattern.  Later, if the caller tries to
     // use this element most properties and methods will throw ElementNotAvailable.
     if (eventId == NativeMethods.EventObjectInvoke)
     {
         AutomationInteropProvider.RaiseAutomationEvent(InvokePattern.InvokedEvent, el, new AutomationEventArgs(InvokePattern.InvokedEvent));
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:10,代码来源:EventManager.cs


示例18: GetNextSibling

 // Returns the next sibling element in the raw hierarchy.
 // Peripheral controls have always negative values.
 // Returns null if no next child
 internal override ProxySimple GetNextSibling (ProxySimple child)
 {
     return null;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:WindowsRebar.cs


示例19: 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


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UnsafeNativeMethods.PTS类代码示例发布时间:2022-05-26
下一篇:
C# Internal.FrameworkObject类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap