internal static object GetUIControlPropertyValue(UITestControl uiTestControl, string propertyName, Dictionary <string, UITestPropertyDescriptor> Properties) { if (Properties.ContainsKey(propertyName)) { AutomationElement automationElement = uiTestControl.NativeElement as AutomationElement; AutomationElement.AutomationElementInformation current = automationElement.Current; if (current.ItemStatus.Equals(string.Empty)) { throw new NotSupportedException(); } AutomationElement.AutomationElementInformation current2 = automationElement.Current; string[] array = current2.ItemStatus.Split(new string[] { "#" }, StringSplitOptions.None); return(array[PropertyProviderHelper.FindIndex(propertyName, Properties)]); } else if (propertyName == "ClassName") { AutomationElement automationElement = uiTestControl.NativeElement as AutomationElement; AutomationElement.AutomationElementInformation current = automationElement.Current; return(current.ClassName); } throw new NotSupportedException(); }
/// <summary> /// Get the Property value /// </summary> /// <param name="uiTestControl">UITestControl</param> /// <param name="propertyName">PropertyName</param> /// <returns>object</returns> public object GetUIControlPropertyValue(UITestControl uiTestControl, string propertyName) { if (propertyName == "FriendlyName") { AutomationElement automationElement = uiTestControl.NativeElement as AutomationElement; AutomationElement.AutomationElementInformation current = automationElement.Current; if (current.ItemStatus.Equals(string.Empty)) { throw new NotSupportedException(); } AutomationElement.AutomationElementInformation current2 = automationElement.Current; string[] array = current2.ItemStatus.Split(new string[] { "#" }, StringSplitOptions.RemoveEmptyEntries); return(array[0]); } else if (propertyName == "Name") { return(null); } else { return(PropertyProviderHelper.GetUIControlPropertyValue(uiTestControl, propertyName, TreeGridCellProperties)); } }
/// <summary> /// Get the Property value /// </summary> /// <param name="uiTestControl">UITestControl</param> /// <param name="propertyName">PropertyName</param> /// <returns>object</returns> public object GetUIControlPropertyValue(UITestControl uiTestControl, string propertyName) { return(PropertyProviderHelper.GetUIControlPropertyValue(uiTestControl, propertyName, GroupDropAreaProperties)); }
/// <summary> /// Get the Property value /// </summary> /// <param name="uiTestControl">UITestControl</param> /// <param name="propertyName">PropertyName</param> /// <returns>object</returns> public object GetUIControlPropertyValue(UITestControl uiTestControl, string propertyName) { return(PropertyProviderHelper.GetUIControlPropertyValue(uiTestControl, propertyName, DataGridPropertiesMap)); }
/// <summary> /// Get the Property value /// </summary> /// <param name="uiTestControl">UITestControl</param> /// <param name="propertyName">PropertyName</param> /// <returns>object</returns> public object GetUIControlPropertyValue(UITestControl uiTestControl, string propertyName) { return(PropertyProviderHelper.GetUIControlPropertyValue(uiTestControl, propertyName, TreeGridStackedHeaderCellProperties)); }