/// <summary> /// Is there a stored link for the given scan /// </summary> /// <param name="mi"></param> /// <returns></returns> public bool HasStoredLink(ScanMetaInfo mi) { if (mi == null) { throw new ArgumentNullException(nameof(mi)); } return(StoredLinks.ContainsKey($"{mi.UIFramework}-{mi.ControlType}-{PropertyType.GetInstance().GetNameById(mi.PropertyId)}")); }
#pragma warning disable CA1055 // Uri return values should not be strings /// <summary> /// Get CELA Snippet Query Url /// </summary> /// <param name="sr"></param> /// <returns></returns> public string GetSnippetQueryUrl(ScanMetaInfo mi) #pragma warning restore CA1055 // Uri return values should not be strings { if (mi == null) { throw new ArgumentNullException(nameof(mi)); } return(StoredLinks[$"{mi.UIFramework}-{mi.ControlType}-{PropertyType.GetInstance().GetNameById(mi.PropertyId)}"]); }
public void ScanMetaInfoTest2() { A11yElement e = new A11yElement(); e.Properties = new Dictionary <int, A11yProperty>(); e.Properties.Add(PropertyType.UIA_ControlTypePropertyId, new A11yProperty(PropertyType.UIA_ControlTypePropertyId, ControlType.UIA_AppBarControlTypeId)); e.Properties.Add(PropertyType.UIA_FrameworkIdPropertyId, new A11yProperty(PropertyType.UIA_FrameworkIdPropertyId, "Win32")); var s = new ScanMetaInfo(e); Assert.AreEqual(0, s.PropertyId); Assert.AreEqual("AppBar", s.ControlType); Assert.AreEqual("Win32", s.UIFramework); }
public void ScanMetaInfoTest() { A11yElement e = new A11yElement(); e.Properties = new Dictionary <int, A11yProperty>(); e.Properties.Add(PropertyType.UIA_ControlTypePropertyId, new A11yProperty(PropertyType.UIA_ControlTypePropertyId, ControlType.UIA_ButtonControlTypeId)); e.Properties.Add(PropertyType.UIA_FrameworkIdPropertyId, new A11yProperty(PropertyType.UIA_FrameworkIdPropertyId, "WPF")); var s = new ScanMetaInfo(e, PropertyType.UIA_AccessKeyPropertyId); Assert.AreEqual(PropertyType.UIA_AccessKeyPropertyId, s.PropertyId); Assert.AreEqual("Button", s.ControlType); Assert.AreEqual("WPF", s.UIFramework); }
#pragma warning disable CA1055 // Uri return values should not be strings /// <summary> /// Get CELA Snippet Query Url /// </summary> /// <param name="sr"></param> /// <returns></returns> public string GetSnippetQueryUrl(ScanMetaInfo mi) #pragma warning restore CA1055 // Uri return values should not be strings { return(StoredLinks[$"{mi.UIFramework}-{mi.ControlType}-{PropertyType.GetInstance().GetNameById(mi.PropertyId)}"]); }
/// <summary> /// Is there a stored link for the given scan /// </summary> /// <param name="mi"></param> /// <returns></returns> public bool HasStoredLink(ScanMetaInfo mi) { return(StoredLinks.ContainsKey($"{mi.UIFramework}-{mi.ControlType}-{PropertyType.GetInstance().GetNameById(mi.PropertyId)}")); }