当前位置: 首页>>代码示例>>C#>>正文


C# IRawElementProviderSimple.GetPropertyValue方法代码示例

本文整理汇总了C#中System.Windows.Automation.Provider.IRawElementProviderSimple.GetPropertyValue方法的典型用法代码示例。如果您正苦于以下问题:C# IRawElementProviderSimple.GetPropertyValue方法的具体用法?C# IRawElementProviderSimple.GetPropertyValue怎么用?C# IRawElementProviderSimple.GetPropertyValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Automation.Provider.IRawElementProviderSimple的用法示例。


在下文中一共展示了IRawElementProviderSimple.GetPropertyValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Window

		public Window (IRawElementProviderSimple provider) : base (provider)
		{
			if (provider != null)
				Role = Atk.Role.Frame;
			
			balloonWindow = (bool)(provider.GetPropertyValue (AutomationElementIdentifiers.IsNotifyIconProperty.Id) != null);
			rootProvider = (IRawElementProviderFragmentRoot) provider;
			
			if (rootProvider != null && balloonWindow) {
				Role = Atk.Role.Alert;
				Name = (string) provider.GetPropertyValue (AutomationElementIdentifiers.HelpTextProperty.Id);
			}

			transformProvider = (ITransformProvider) provider.GetPatternProvider (TransformPatternIdentifiers.Pattern.Id);
			windowProvider = (IWindowProvider) provider.GetPatternProvider (WindowPatternIdentifiers.Pattern.Id);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:16,代码来源:Window.cs

示例2: MenuItem

		public MenuItem (IRawElementProviderSimple provider) : base (provider)
		{
			if (provider == null)
				throw new ArgumentNullException ("provider");

			if ((provider as IRawElementProviderFragment) == null)
				throw new ArgumentException ("Provider for ParentMenu should be IRawElementProviderFragment");

			textExpert = TextImplementorFactory.GetImplementor (this, provider);

			Role = Atk.Role.MenuItem;

			string name = (string) provider.GetPropertyValue (AutomationElementIdentifiers.NameProperty.Id);
			if (!String.IsNullOrEmpty (name))
				Name = name;

			invokeProvider = (IInvokeProvider)
				provider.GetPatternProvider (InvokePatternIdentifiers.Pattern.Id);
			toggleProvider = (IToggleProvider)
				provider.GetPatternProvider (TogglePatternIdentifiers.Pattern.Id);
			selectionItemProvider = (ISelectionItemProvider)
				provider.GetPatternProvider (SelectionItemPatternIdentifiers.Pattern.Id);
			expandCollapseProvider = (IExpandCollapseProvider)
				provider.GetPatternProvider (ExpandCollapsePatternIdentifiers.Pattern.Id);

			actionExpert.Add ("click", "click", null, DoClick);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:27,代码来源:MenuItem.cs

示例3: ComboBoxItem

		public ComboBoxItem (IRawElementProviderSimple provider) : base (provider)
		{
			int controlType = (int) provider.GetPropertyValue (AutomationElementIdentifiers.ControlTypeProperty.Id);
			selectionItemProvider = (ISelectionItemProvider)provider.GetPatternProvider (
			  SelectionItemPatternIdentifiers.Pattern.Id);
			if (selectionItemProvider == null)
				throw new ArgumentException (
				  String.Format ("Provider for ComboBoxItem (control type {0}) should implement ISelectionItemProvider", controlType));

			textExpert = TextImplementorFactory.GetImplementor (this, provider);
			
			//FIXME: take in account ComboBox style changes at runtime
			if (ParentIsSimple ())
				Role = Atk.Role.TableCell;
			else
				Role = Atk.Role.MenuItem;
		}
开发者ID:mono,项目名称:uia2atk,代码行数:17,代码来源:ComboBoxItem.cs

示例4: TextBoxEntryView

		public TextBoxEntryView (IRawElementProviderSimple provider) : base (provider)
		{
			if (IsTableCell)
				Role = Atk.Role.TableCell;
			else
				Role = Atk.Role.Text;

			if (provider.GetPatternProvider (TextPatternIdentifiers.Pattern.Id) == null
			    && provider.GetPatternProvider (ValuePatternIdentifiers.Pattern.Id) == null)
				throw new ArgumentException ("Provider for TextBox should either implement IValue or IText");
			
			textExpert = TextImplementorFactory.GetImplementor (this, provider);
			if ((int) provider.GetPropertyValue (AutomationElementIdentifiers.ControlTypeProperty.Id) 
			    == ControlType.Document.Id)
				multiLine = true;

			editableTextExpert = new EditableTextImplementorHelper (this, this, textExpert);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:18,代码来源:TextBoxEntryView.cs

示例5: SplitContainer

		public SplitContainer (IRawElementProviderSimple provider) : base (provider)
		{
			Role = Atk.Role.SplitPane;
			rangeValueProvider = (IRangeValueProvider)provider.GetPatternProvider (RangeValuePatternIdentifiers.Pattern.Id);
			object o = provider.GetPropertyValue (AutomationElementIdentifiers.OrientationProperty.Id);
			if (o is OrientationType)
				orientation = (OrientationType)o;
			else {
				IDockProvider dockProvider = (IDockProvider)provider.GetPatternProvider (DockPatternIdentifiers.Pattern.Id);
				if (dockProvider != null) {
					orientation = (dockProvider.DockPosition == DockPosition.Top || dockProvider.DockPosition == DockPosition.Bottom)?
						OrientationType.Horizontal:
						OrientationType.Vertical;
				} else {
					Log.Warn ("SplitContainer: Couldn't get orientation for splitter.  Does not support DockProvider.");
					orientation = OrientationType.Horizontal;
				}
			}
		}
开发者ID:mono,项目名称:uia2atk,代码行数:19,代码来源:SplitContainer.cs

示例6: TestExpandCollapsePattern_ExpandCollapseStatePropertyEvent

		protected virtual void TestExpandCollapsePattern_ExpandCollapseStatePropertyEvent (IRawElementProviderSimple provider)
		{
			IExpandCollapseProvider expandCollapseProvider
				= provider.GetPatternProvider (ExpandCollapsePatternIdentifiers.Pattern.Id) as IExpandCollapseProvider;
			if (expandCollapseProvider == null)
				Assert.Fail ("Provider {0} is not implementing IExpandCollapseProvider", provider.GetType ());

			bool enabled 
				= (bool) provider.GetPropertyValue (AutomationElementIdentifiers.IsEnabledProperty.Id);
			ExpandCollapseState currentState = expandCollapseProvider.ExpandCollapseState;

			try {
				bridge.ResetEventLists ();

				if (currentState == ExpandCollapseState.Collapsed)
					expandCollapseProvider.Expand ();
				else if (currentState == ExpandCollapseState.Expanded 
				         || currentState == ExpandCollapseState.PartiallyExpanded)
					expandCollapseProvider.Collapse ();
				
				Assert.IsNotNull (bridge.GetAutomationPropertyEventFrom (provider, ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty.Id),
				                  "IExpandCollapseProvider.ExpandCollapseStateProperty didn't raise any event.");
				// Is hard to test NewValue or OldValue because the spec doesn't
				// say anything about those values when calling Collapse/Expand.
			} catch (ElementNotEnabledException) {
				if (!enabled)
					Assert.Fail ("Your provider is disabled but didn't throw ElementNotEnabledException.");
			} catch (InvalidOperationException) {
				// Expand is called when the ExpandCollapseState = LeafNode.
				if (currentState != ExpandCollapseState.LeafNode)
					Assert.Fail (string.Format ("InvalidOperationException is only thrown when state is LeafNode, current state: ", currentState));
			}
		}
开发者ID:mono,项目名称:uia2atk,代码行数:33,代码来源:BaseProviderTest.cs

示例7: TestEmbeddedImagePattern_All

		protected virtual void TestEmbeddedImagePattern_All (IRawElementProviderSimple provider, bool imageExpected)
		{
			IEmbeddedImageProvider embeddedImage 
				= provider.GetPatternProvider (EmbeddedImagePatternIdentifiers.Pattern.Id) as IEmbeddedImageProvider;

			Assert.IsNotNull (embeddedImage, "Provider {0} is not implementing IEmbeddedImageProvider");
			Assert.AreEqual (!imageExpected,
			                 embeddedImage.Bounds.IsEmpty,
			                 string.Format ("Image was {0}expected, but was {1}found", 
			                                imageExpected ? "" : "not ",
			                                embeddedImage.Bounds.IsEmpty ? "not " : ""));

			if (imageExpected) {
				Rect providerRect
					= (Rect) provider.GetPropertyValue (AutomationElementIdentifiers.BoundingRectangleProperty.Id);
				Rect imageRect = embeddedImage.Bounds;

				Assert.IsTrue (imageRect.X >= providerRect.X,
				               string.Format ("Image X: {0} must be >= than container X: {1}", imageRect.X, providerRect.X));
				Assert.IsTrue (imageRect.Y >= providerRect.Y,
				               string.Format ("Image Y: {0} must be >= than container Y: {1}", imageRect.Y, providerRect.Y));
				Assert.IsTrue (imageRect.Width <= providerRect.Width,
				               string.Format ("Image Width: {0} must be <= than container Width: {1}", imageRect.Width, providerRect.Width));
				Assert.IsTrue (imageRect.Height <= providerRect.Height,
				               string.Format ("Image Height: {0} must be <= than container Height: {1}", imageRect.Height, providerRect.Height));
			}
		}
开发者ID:mono,项目名称:uia2atk,代码行数:27,代码来源:BaseProviderTest.cs

示例8: DistanceFrom

		private double DistanceFrom (IRawElementProviderSimple otherProvider)
		{
			Rect bounds = (Rect) GetPropertyValue (AutomationElementIdentifiers.BoundingRectangleProperty.Id);
			Rect otherBounds = (Rect) otherProvider.GetPropertyValue (AutomationElementIdentifiers.BoundingRectangleProperty.Id);
			
			if (control != null && control.RightToLeft == SWF.RightToLeft.Yes)
				return Distance (bounds.TopRight, otherBounds.TopRight);
			else
				return Distance (bounds.TopLeft, otherBounds.TopLeft);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:10,代码来源:SimpleControlProvider.cs

示例9: TestThumbPatterns

		protected virtual void TestThumbPatterns (IRawElementProviderSimple provider) 
		{
			// http://msdn.microsoft.com/en-us/library/ms742539.aspx

			// DEPENDS: IRangeValueProvider
			// DEPENDS: ITransformProvider

			Assert.AreEqual (Catalog.GetString ("thumb"),
			                 provider.GetPropertyValue (AutomationElementIdentifiers.LocalizedControlTypeProperty.Id),
			                 "LocalizedControlTypeProperty");
		}
开发者ID:mono,项目名称:uia2atk,代码行数:11,代码来源:BaseProviderTest.cs

示例10: TestEditPatterns

		protected override void TestEditPatterns (IRawElementProviderSimple provider) 
		{
			// LAMESPEC: Edit must always support ITextProvider, but this *is not true* in Edit Cells
			Assert.IsTrue ((bool) provider.GetPropertyValue (AutomationElementIdentifiers.IsValuePatternAvailableProperty.Id),
			               "Edit ControlType in DataGrid must support IValueProvider");
			Assert.IsFalse ((bool) provider.GetPropertyValue (AutomationElementIdentifiers.IsRangeValuePatternAvailableProperty.Id),
			                "Edit ControlType in DataGrid MUST NOT support IRangeValueProvider");

			Assert.AreEqual (Catalog.GetString ("edit"),
			                 provider.GetPropertyValue (AutomationElementIdentifiers.LocalizedControlTypeProperty.Id),
			                 "LocalizedControlTypeProperty");
			
			TestValuePattern_All (provider);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:14,代码来源:DataGridProviderTest.cs

示例11: ScrollBar

		public ScrollBar (IRawElementProviderSimple provider) : base (provider)
		{
			Role = Atk.Role.ScrollBar;
			rangeValueProvider = (IRangeValueProvider)provider.GetPatternProvider (RangeValuePatternIdentifiers.Pattern.Id);
			orientation = (OrientationType)provider.GetPropertyValue (AutomationElementIdentifiers.OrientationProperty.Id);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:6,代码来源:ScrollBar.cs

示例12: TestWindowPatterns

		protected virtual void TestWindowPatterns (IRawElementProviderSimple provider) 
		{
			// http://msdn.microsoft.com/en-us/library/ms746673.aspx

			Assert.IsTrue ((bool) provider.GetPropertyValue (AutomationElementIdentifiers.IsTransformPatternAvailableProperty.Id),
			               "Window ControlType must support ITransformProvider");
			Assert.IsTrue ((bool) provider.GetPropertyValue (AutomationElementIdentifiers.IsWindowPatternAvailableProperty.Id),
			               "Window ControlType must support IWindowProvider");

			// DEPENDS: IDockProvider

			Assert.AreEqual (Catalog.GetString ("window"),
			                 provider.GetPropertyValue (AutomationElementIdentifiers.LocalizedControlTypeProperty.Id),
			                 "LocalizedControlTypeProperty");
		}
开发者ID:mono,项目名称:uia2atk,代码行数:15,代码来源:BaseProviderTest.cs

示例13: HeaderValue

 public string HeaderValue(IRawElementProviderSimple element)
 {
     return element.GetPropertyValue(AutomationElementIdentifiers.NameProperty.Id).ToString();
 }
开发者ID:northwoodspd,项目名称:UIA.Extensions,代码行数:4,代码来源:TableProviderTest.cs

示例14: TestTreePatterns

		protected virtual void TestTreePatterns (IRawElementProviderSimple provider) 
		{
			// http://msdn.microsoft.com/en-us/library/ms743706.aspx

			// DEPENDS: ISelectionProvider
			// DEPENDS: IScrollProvider

			Assert.AreEqual (Catalog.GetString ("tree"),
			                 provider.GetPropertyValue (AutomationElementIdentifiers.LocalizedControlTypeProperty.Id),
			                 "LocalizedControlTypeProperty");
		}
开发者ID:mono,项目名称:uia2atk,代码行数:11,代码来源:BaseProviderTest.cs

示例15: TestTreeItemPatterns

		protected virtual void TestTreeItemPatterns (IRawElementProviderSimple provider) 
		{
			// http://msdn.microsoft.com/en-us/library/ms743384.aspx

			Assert.IsTrue ((bool) provider.GetPropertyValue (AutomationElementIdentifiers.IsExpandCollapsePatternAvailableProperty.Id),
			               "TreeItem ControlType must support IExpandCollapseProvider");

			// DEPENDS: IInvokeProvider
			// DEPENDS: IScrollItemProvider
			// DEPENDS: ISelectionItemProvider
			// DEPENDS: IToggleProvider
			
			Assert.AreEqual (Catalog.GetString ("tree item"),
			                 provider.GetPropertyValue (AutomationElementIdentifiers.LocalizedControlTypeProperty.Id),
			                 "LocalizedControlTypeProperty");

			TestExpandCollapsePattern_ExpandCollapseStatePropertyEvent (provider);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:18,代码来源:BaseProviderTest.cs


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