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


C# AutomationPeer.GetPattern方法代码示例

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


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

示例1: GridTable

		public GridTable (Adapter adapter, AutomationPeer peer) : base (adapter, peer)
		{
			this.peer = peer;

			this.tableProvider = (ITableProvider) peer.GetPattern (
				PatternInterface.Table);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:GridTable.cs

示例2: Selection

		public Selection (Adapter adapter, AutomationPeer peer) : base (adapter, peer)
		{
			this.selectionProvider = (ISelectionProvider) peer.GetPattern (
				PatternInterface.Selection);

			adapter.AutomationPropertyChanged += (o, args) => {
				if (args.Property == SelectionPatternIdentifiers.SelectionProperty)
					adapter.EmitSignal ("selection_changed");
			};
		}
开发者ID:mono,项目名称:uia2atk,代码行数:10,代码来源:Selection.cs

示例3: RangeValue

		public RangeValue (Adapter adapter, AutomationPeer peer)
			: base (adapter, peer)
		{
			this.rangeValueProvider = (IRangeValueProvider) peer.GetPattern (
				PatternInterface.RangeValue);

			adapter.AutomationPropertyChanged
				+= new EventHandler<AutomationPropertyChangedEventArgs> (
					OnAutomationPropertyChanged);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:10,代码来源:RangeValue.cs

示例4: GetSupportedPropertyValueInternal

 internal static new object GetSupportedPropertyValueInternal(AutomationPeer itemPeer, int propertyId)
 {
     if (SelectionItemPatternIdentifiers.IsSelectedProperty.Id == propertyId)
     {
         ISelectionItemProvider selectionItem = itemPeer.GetPattern(PatternInterface.SelectionItem) as ISelectionItemProvider;
         if (selectionItem != null)
             return selectionItem.IsSelected;
         else
             return null;
     }
     return ItemsControlAutomationPeer.GetSupportedPropertyValueInternal(itemPeer, propertyId);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:12,代码来源:SelectorAutomationPeer.cs

示例5: TryInvokePatternAutomation

        private static bool TryInvokePatternAutomation(AutomationPeer peer)
        {
            var pattern = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;
            if (pattern == null)
                return false;

            try
            {
                pattern.Invoke();
            }
            catch (Exception exception)
            {
                throw new TestAutomationException("Exception while invoking pattern", exception);
            }

            return true;
        }
开发者ID:giozom,项目名称:WindowsPhoneTestFramework,代码行数:17,代码来源:InvokeControlTapActionCommand.cs

示例6: TryTogglePatternAutomation

        /// <summary>
        /// Tries the toggle pattern automation.
        /// </summary>
        /// <param name="peer">The peer.</param>
        /// <param name="element">The element.</param>
        /// <returns>
        /// True if the pattern was available and succeeded, else false.
        /// </returns>
        /// <exception cref="TestAutomationException">Exception while invoking pattern</exception>
        private static bool TryTogglePatternAutomation(AutomationPeer peer, UIElement element)
        {
            var pattern = peer.GetPattern(PatternInterface.Toggle) as IToggleProvider;
            if (pattern == null)
            {
                return false;
            }

            try
            {
                pattern.Toggle();
            
                // Toggle won't fire the command, so do that manually!
                var te = element as ToggleButton;

                if (te != null && te.Command != null)
                {
                    te.Command.Execute(te.CommandParameter);
                }

            }
            catch (Exception exception)
            {
                throw new TestAutomationException("Exception while invoking pattern", exception);
            }

            return true;
        }
开发者ID:jimtsay,项目名称:WindowsPhoneTestFramework,代码行数:37,代码来源:InvokeControlTapActionCommand.cs


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