Example #1
0
        // Returns a pattern interface if supported, else null.
        internal override object GetPatternProvider(AutomationPattern iid)
        {
            if (iid == ScrollPattern.Pattern && WindowScroll.HasScrollableStyle(_hwnd))
            {
                return(this);
            }

            return(null);
        }
Example #2
0
        //------------------------------------------------------
        //
        //  Patterns Implementation
        //
        //------------------------------------------------------

        #region ProxySimple Interface

        // Returns a pattern interface if supported.
        internal override object GetPatternProvider(AutomationPattern iid)
        {
            // selection is always supported
            if (iid == SelectionPattern.Pattern)
            {
                return(this);
            }
            // the scroll pattern is only supported when the list is scrollable.
            else if (iid == ScrollPattern.Pattern && WindowScroll.HasScrollableStyle(_hwnd))
            {
                // delegate work to the NonClientArea implementation of IScrollProvider
                IScrollProvider scroll = NonClientArea.Create(_hwnd, 0) as IScrollProvider;

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


            return(null);
        }