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


C# Automation.AutomationProperty类代码示例

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


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

示例1: WindowPatternIdentifiers

		static WindowPatternIdentifiers ()
		{
			Pattern =
				new AutomationPattern (PatternId,
				                       "WindowPatternIdentifiers.Pattern");
			CanMaximizeProperty =
				new AutomationProperty (CanMaximizePropertyId,
				                        "WindowPatternIdentifiers.CanMaximizeProperty");
			CanMinimizeProperty =
				new AutomationProperty (CanMinimizePropertyId,
				                        "WindowPatternIdentifiers.CanMinimizeProperty");
			IsModalProperty =
				new AutomationProperty (IsModalPropertyId,
				                        "WindowPatternIdentifiers.IsModalProperty");
			IsTopmostProperty =
				new AutomationProperty (IsTopmostPropertyId,
				                        "WindowPatternIdentifiers.IsTopmostProperty");
			WindowInteractionStateProperty =
				new AutomationProperty (WindowInteractionStatePropertyId,
				                        "WindowPatternIdentifiers.WindowInteractionStateProperty");
			WindowVisualStateProperty =
				new AutomationProperty (WindowVisualStatePropertyId,
				                        "WindowPatternIdentifiers.WindowVisualStateProperty");
			WindowClosedEvent =
				new AutomationEvent (WindowClosedEventId,
				                     "WindowPatternIdentifiers.WindowClosedProperty");
			WindowOpenedEvent =
				new AutomationEvent (WindowOpenedEventId,
				                     "WindowPatternIdentifiers.WindowOpenedProperty");
		}
开发者ID:mono,项目名称:uia2atk,代码行数:30,代码来源:WindowPatternIdentifiers.cs

示例2: FindDescendantsBy

 public static IEnumerable<AutomationElement> FindDescendantsBy(this AutomationElement ae, AutomationProperty property, object value)
 {
     return ae.FindAll(
     TreeScope.Descendants,
     new PropertyCondition(property, value))
     .Cast<AutomationElement>();
 }
开发者ID:softek,项目名称:WinUIScraper,代码行数:7,代码来源:AutomationExtensions.cs

示例3: GetAllChildNodes

 public AutomationElementCollection GetAllChildNodes(AutomationElement element, AutomationProperty automationProperty, object value, TreeScope treeScope)
 {
     var allChildNodes = element.FindAll(treeScope, GetPropertyCondition(automationProperty, value));
     if (allChildNodes == null)
         throw new ElementNotAvailableException("Not able to find the child nodes of the element");
     return allChildNodes;
 }
开发者ID:prasannarhegde2015,项目名称:MySQLBackupCsharpScript,代码行数:7,代码来源:SampleUIAAutoamtion.cs

示例4: GetElementProperty

        // Process all the Element Properties
        internal override object GetElementProperty(AutomationProperty idProp)
        {
            if (idProp == AutomationElement.IsOffscreenProperty)
            {
                Rect parentRect = GetParent().BoundingRectangle;
                NativeMethods.Win32Rect itemRect = ListViewCheckBoxRect(_hwnd, _listviewItem);
                if (itemRect.IsEmpty || parentRect.IsEmpty)
                {
                    return true;
                }

                if (Misc.MapWindowPoints(_hwnd, IntPtr.Zero, ref itemRect, 2) && !Misc.IsItemVisible(ref parentRect, ref itemRect))
                {
                    return true;
                }
            }
            // EventManager.DispatchEvent() genericaly uses GetElementProperty()
            // to get properties during a property change event.  Proccess ToggleStateProperty
            // so the ToggleStateProperty Change Event can get the correct state.
            else if (idProp == TogglePattern.ToggleStateProperty)
            {
                return ((IToggleProvider)this).ToggleState;
            }

            return base.GetElementProperty(idProp);
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:27,代码来源:WindowsListViewItemCheckBox.cs

示例5: RaisePropertyChangedEvent

		public void RaisePropertyChangedEvent (AutomationPeer peer, 
		                                       AutomationProperty property, 
		                                       object oldValue, 
						       object newValue)
		{
			if (!AccessibilityEnabled || peer == null)
				return;

			if (object.Equals (newValue, oldValue))
				return;

			// We are going to raise changes only when the value ACTUALLY CHANGES
			IAutomationCacheProperty cachedProperty = peer.GetCachedProperty (property);
			if (cachedProperty != null) {
				if (object.Equals (newValue, cachedProperty.OldValue))
					return;
				cachedProperty.OldValue = newValue;
			}

			if (AutomationPropertyChanged != null)
				AutomationPropertyChanged (this, 
				                           new AutomationPropertyChangedEventArgs (peer, 
							                                           property, 
												   oldValue, 
												   newValue));
		}
开发者ID:dfr0,项目名称:moon,代码行数:26,代码来源:AutomationSingleton.cs

示例6: GridItemPatternIdentifiers

		static GridItemPatternIdentifiers ()
		{
			Pattern =
				new AutomationPattern (PatternId,
						"GridItemPatternIdentifiers.Pattern");

			RowProperty =
				new AutomationProperty (RowPropertyId,
						"GridItemPatternIdentifiers.RowProperty");

			ColumnProperty =
				new AutomationProperty (ColumnPropertyId,
						"GridItemPatternIdentifiers.ColumnProperty");

			RowSpanProperty =
				new AutomationProperty (RowSpanPropertyId,
						"GridItemPatternIdentifiers.RowSpanProperty");

			ColumnSpanProperty =
				new AutomationProperty (ColumnSpanPropertyId,
						"GridItemPatternIdentifiers.ColumnSpanProperty");

			ContainingGridProperty =
				new AutomationProperty (ContainingGridPropertyId,
						"GridItemPatternIdentifiers.ContainingGridProperty");
		}
开发者ID:mono,项目名称:uia2atk,代码行数:26,代码来源:GridItemPatternIdentifiers.cs

示例7: AdviseEventAdded

        //------------------------------------------------------
        //
        //  Patterns Implementation
        //
        //------------------------------------------------------

        #region ProxyHwnd Methods

        // ------------------------------------------------------
        //
        // Internal Methods
        //
        // ------------------------------------------------------

        // Advises proxy that an event has been added.
        // Maps the Automation Events into WinEvents and add those to the list of WinEvents notification hooks
        internal virtual void AdviseEventAdded (AutomationEvent eventId, AutomationProperty [] aidProps)
        {
            // No RawElementBase creation callback, exit from here
            if (_createOnEvent == null)
            {
                return;
            }

            int cEvents = 0;
            WinEventTracker.EvtIdProperty [] aEvents;

            // Gets an Array of WinEvents to trap on a per window handle basis
            if (eventId == AutomationElement.AutomationPropertyChangedEvent)
            {
                aEvents = PropertyToWinEvent (aidProps, out cEvents);
            }
            else
            {
                aEvents = EventToWinEvent (eventId, out cEvents);
            }

            // If we have WinEvents to trap, add those to the list of WinEvent
            // notification list
            if (cEvents > 0)
            {
                WinEventTracker.AddToNotificationList (_hwnd, _createOnEvent, aEvents, cEvents);
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:44,代码来源:ProxyHwnd.cs

示例8: AutomationPropertyChangedEventArgs

		public AutomationPropertyChangedEventArgs (AutomationProperty property, object oldValue, object newValue) :
            base (AutomationElementIdentifiers.AutomationPropertyChangedEvent)
		{
			Property = property;
			OldValue = oldValue;
			NewValue = newValue;
		}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:AutomationPropertyChangedEventArgs.cs

示例9: BaseAutomationPropertyEvent

		protected BaseAutomationPropertyEvent (SimpleControlProvider provider,
		                                       AutomationProperty property)
			: base (provider)
		{
			this.property = property;
			OldValue = Provider.GetPropertyValue (Property.Id);
		}
开发者ID:mono,项目名称:uia2atk,代码行数:7,代码来源:BaseAutomationPropertyEvent.cs

示例10: CreateConditionPathForPropertyValues

        public static IEnumerable<Condition> CreateConditionPathForPropertyValues(AutomationProperty property, 
            IEnumerable<object> values)
        {
            IEnumerable<PropertyCondition> conditions = values.Select(value => new PropertyCondition(property, value));

            return conditions.Cast<Condition>();
        }
开发者ID:GraemeF,项目名称:Fluid,代码行数:7,代码来源:AutomationExtensions.cs

示例11: ClickTabItem

 public static void ClickTabItem(this TestBase @this, AutomationProperty searchBy, object value, AutomationElement retrievedControl = null)
 {
     Dictionary<AutomationProperty, object> searchCretia = new Dictionary<AutomationProperty, object>();
     searchCretia.Add(SearchBy.ByControlType, ControlType.TabItem);
     searchCretia.Add(searchBy, value);
     var target = @this.App.FindDescendant(searchCretia, retrievedControl);
     ControlProvider.Transfer<AETabItem>(target).Select();
 }
开发者ID:Gnail-nehc,项目名称:Black,代码行数:8,代码来源:CommonAction.cs

示例12: SupportsProperty

		public bool SupportsProperty (AutomationProperty property)
		{
			try {
				return dbusElement.SupportsProperty (property.Id);
			} catch (Exception ex) {
					throw DbusExceptionTranslator.Translate (ex);
			}
		}
开发者ID:mono,项目名称:uia2atk,代码行数:8,代码来源:UiaDbusElement.cs

示例13: GetPropertyValue

 public object GetPropertyValue(AutomationProperty property)
 {
     if (TestOfMoreThanTwoPatternPropertiesPattern.Standalone1Property.Equals(property))
         return 42;
     if (TestOfMoreThanTwoPatternPropertiesPattern.NullStringStandaloneProperty.Equals(property))
         return null;
     return null;
 }
开发者ID:TestStack,项目名称:uia-custom-pattern-managed,代码行数:8,代码来源:TestControlAutomationPeer.cs

示例14: TogglePatternIdentifiers

		static TogglePatternIdentifiers ()
		{
			Pattern =
				new AutomationPattern (PatternId,
				                       "TogglePatternIdentifiers.Pattern");
			ToggleStateProperty =
				new AutomationProperty (ToggleStatePropertyId,
				                        "TogglePatternIdentifiers.ToggleStateProperty");
		}
开发者ID:mono,项目名称:uia2atk,代码行数:9,代码来源:TogglePatternIdentifiers.cs

示例15:

 // threadsafe
 private object this[AutomationProperty property] {
 	get {
 		return STAHelper.Invoke(
 			delegate() {
 		    	return element.GetCurrentPropertyValue(property);
 			}
 		);
 	}
 }
开发者ID:kevtham,项目名称:twin,代码行数:10,代码来源:Element.cs


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