本文整理汇总了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));
}
}
示例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));
}
}
示例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);
}
}
}
示例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));
}
}