System.Windows.Automation.Text.TextPatternRange.AddToSelection C# (CSharp) Méthode

AddToSelection() public méthode

public AddToSelection ( ) : void
Résultat void
        public void AddToSelection()
        {
            try
            {
                _range.AddToSelection();
            }
            catch (System.Runtime.InteropServices.COMException e)
            {
                Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; }
            }
        }

Usage Example

Exemple #1
-1
        //---------------------------------------------------------------------------
        // Wrapper for TextPatternRange.AddToSelection Method
        //---------------------------------------------------------------------------
        internal void Range_AddToSelection(TextPatternRange callingRange, Type expectedException, CheckType checkType)
        {
            string call = "TextPatternRange.AddToSelection()";
            Comment("---Calling " + call);

            if (callingRange == null)
                throw new ArgumentNullException(call + " requires non-NULL TextPatterncallingRange");

            try
            {
                callingRange.AddToSelection();
            }
            catch (Exception actualException)
            {
                if (Library.IsCriticalException(actualException))
                    throw;

                // Bug 1746355: Throw "NotSupported" from TextPattern methods that...um...aren't supported
                if ((actualException is NotSupportedException) && (_frameworkId == "wpf"))
                {
                    NotSupportedException nse = new NotSupportedException();

                    TestException(nse.GetType(), actualException, call, checkType);
                }
                else
                    TestException(expectedException, actualException, call, checkType);
                return;
            }
            TestNoExceptionQuiet(expectedException, call, checkType);
        }