System.Windows.Automation.ExpandCollapsePattern.Expand C# (CSharp) Method

Expand() public method

public Expand ( ) : void
return void
        public void Expand()
        {
                        try
            {
this._pattern.Expand();            }
            catch (System.Runtime.InteropServices.COMException e)
            {
                Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; }
            }
        }

Usage Example

Esempio n. 1
0
        private bool ExpandListIfNeeded(out ExpandCollapsePattern expandCollapsePattern)
        {
            if (!IsExpansionRequired || !Enabled)
            {
                expandCollapsePattern = null;
                return false;
            }

            if (!TryGetExpandCollapsePattern(out expandCollapsePattern))
                return false;

            var expansionState = expandCollapsePattern.Current.ExpandCollapseState;
            if (expansionState != ExpandCollapseState.Collapsed)
                return false;

            expandCollapsePattern.Expand();
            Thread.Sleep(50);

            return true;
        }