GetSupportedProperties() public method

public GetSupportedProperties ( ) : System.Windows.Automation.AutomationProperty[]
return System.Windows.Automation.AutomationProperty[]
コード例 #1
0
ファイル: Debug.cs プロジェクト: ritro/White
 public static void LogProperties(AutomationElement element)
 {
     AutomationProperty[] automationProperties = element.GetSupportedProperties();
     foreach (AutomationProperty automationProperty in automationProperties)
     {
         Logger.Info(automationProperty.ProgrammaticName + ":" + element.GetCurrentPropertyValue(automationProperty));
     }
 }
        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();
        }
コード例 #3
0
ファイル: stress.cs プロジェクト: geeksree/cSharpGeeks
 public static void AutomationElementGetSupportedProperties(AutomationElement element)
 {
     Dump("GetSupportedProperties()", true, element);
     try
     {
         AutomationProperty[] obj = element.GetSupportedProperties();
     }
     catch (Exception exception)
     {
         VerifyException(element, exception, typeof(ElementNotAvailableException));
     }
 }
コード例 #4
0
ファイル: Msaa.cs プロジェクト: TestStack/UIAVerify
        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
0
ファイル: AutomationElementTest.cs プロジェクト: mono/uia2atk
		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));
			}
		}