System.Windows.Automation.MultipleViewPattern.SetCurrentView C# (CSharp) Method

SetCurrentView() public method

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

Usage Example

コード例 #1
0
		public void NotEnabledTest ()
		{
			RunCommand ("disable list view");
			listView1Element = testFormElement.FindFirst (TreeScope.Children,
				new PropertyCondition (AEIds.NameProperty, "listView1"));
			Assert.IsNotNull (listView1Element);
			pattern = (MultipleViewPattern) listView1Element.GetCurrentPattern (MultipleViewPattern.Pattern);
			// We should expect and ElementNotEnabledException here
			// But since on Windows Winforms there isn't expcetion fired, then we also assert no exception here
			pattern.SetCurrentView (1);
			RunCommand ("enable list view");
			pattern = (MultipleViewPattern) listView1Element.GetCurrentPattern (MultipleViewPattern.Pattern);
		}