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


C# AutomationElement.GetSupportedProperties方法代码示例

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


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

示例1: LogProperties

 public static void LogProperties(AutomationElement element)
 {
     AutomationProperty[] automationProperties = element.GetSupportedProperties();
     foreach (AutomationProperty automationProperty in automationProperties)
     {
         Logger.Info(automationProperty.ProgrammaticName + ":" + element.GetCurrentPropertyValue(automationProperty));
     }
 }
开发者ID:ritro,项目名称:White,代码行数:8,代码来源:Debug.cs

示例2: GetPatterns

        internal static string GetPatterns(AutomationElement element)
        {
            var properties = element.GetSupportedProperties();

            var msg = new StringBuilder();

            msg.Append("Supported Properties:\n");
            foreach (var automationProperty in properties)
            {
                var value = element.GetCurrentPropertyValue(automationProperty);
                msg.AppendFormat(CultureInfo.InvariantCulture, "{0}: {1}\n", automationProperty.ProgrammaticName, value);
            }

            return msg.ToString();
        }
开发者ID:NetlifeBackupSolutions,项目名称:Winium.StoreApps.CodedUi,代码行数:15,代码来源:GetSupportedAutomationExecutor.cs

示例3: AutomationElementGetSupportedProperties

 public static void AutomationElementGetSupportedProperties(AutomationElement element)
 {
     Dump("GetSupportedProperties()", true, element);
     try
     {
         AutomationProperty[] obj = element.GetSupportedProperties();
     }
     catch (Exception exception)
     {
         VerifyException(element, exception, typeof(ElementNotAvailableException));
     }
 }
开发者ID:geeksree,项目名称:cSharpGeeks,代码行数:12,代码来源:stress.cs

示例4: GetProperties

        private void GetProperties(AutomationElement element, bool recurseChildren, bool recurseFirstSiblings, string level)
        {
            if (element == null)
                return;

            if (element.Current.Name == "Desktop")
                Console.WriteLine("");

            Comment("----------------------------------------------------------------");
            Comment("Path : " + Library.GetUISpyLook(element));
            try
            {
                foreach (AutomationProperty property in element.GetSupportedProperties())
                {
                    try
                    {
                        Comment(level + " : " + property.ToString() + " : " + element.GetCurrentPropertyValue(property));
                    }
                    catch (Exception error)
                    {
                        CacheError(error, property.ToString(), level);
                    }
                }
            }
            catch (Exception error)
            {
                CacheError(error, "GetSupportedProperties", level);
            }

            try
            {
                // Don't do any console windows since it my be ourself and it's output 
                // which will be recursive in output.  I know this might nnot be correct, 
                // as it might be another console window.
                if (element.Current.ClassName != "ConsoleWindowClass")
                    GetProperties(TreeWalker.ControlViewWalker.GetFirstChild(element), recurseChildren, true, level + ".1");
            }
            catch (Exception error)
            {
                CacheError(error, "GetFirstChild", level);
            }

            if (recurseFirstSiblings)
            {

                int iloc = level.LastIndexOf('.');
                if (iloc < 1)
                    return; // we are at the end
                string after = level.Substring(iloc + 1);
                string before = level.Substring(0, iloc);

                int t = Convert.ToInt16(after);
                t++;
                level = before + "." + t.ToString();

                try
                {
                    this.GetProperties(TreeWalker.ControlViewWalker.GetNextSibling(element), recurseFirstSiblings, true, level);
                }
                catch (Exception error)
                {
                    CacheError(error, "GetNextSibling", level);
                }

            }
        }
开发者ID:TestStack,项目名称:UIAVerify,代码行数:66,代码来源:Msaa.cs

示例5: SupportedPropertiesTestInternal

		private void SupportedPropertiesTestInternal (AutomationElement element)
		{
			var supportedProperties = element.GetSupportedProperties ();
			foreach (AutomationPattern pattern in element.GetSupportedPatterns ()) {
				foreach (var prop in GetPatternProperties (pattern)) {
					Assert.IsTrue (supportedProperties.Contains (prop),
						string.Format ("[{0}] {1} shall be supported since {2} pattern is supported",
							element.Current.Name,
							prop.ProgrammaticName,
							At.PatternName (pattern)));
				}
			}
			foreach (var prop in supportedProperties) {
				Assert.AreNotEqual (AutomationElement.NotSupported,
					element.GetCurrentPropertyValue (prop, true),
					string.Format ("[{0}] {1} shall be supported since it's in SupportedProperties",
						element.Current.Name,
						prop.ProgrammaticName));
			}
		}
开发者ID:mono,项目名称:uia2atk,代码行数:20,代码来源:AutomationElementTest.cs


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