public PatternPropertyUIWrapper(A11yPatternProperty p)
        {
            /// Trim node text if it contains a newline and append ...
            /// Full value will be available via tooltip
            int idx = p.NodeValue.IndexOfAny(new char[] { '\r', '\n' });

            this.NodeValue = idx == -1 ? p.NodeValue : p.NodeValue.Substring(0, idx) + "...\"";

            this.ToolTip = p.NodeValue;

            this.ActionVisibility = Visibility.Collapsed;
        }
Exemplo n.º 2
0
 public void TestTextSelectionSupportedFalse()
 {
     using (var e = new MockA11yElement())
     {
         var pattern  = new A11yPattern(e, PatternIDs.Text);
         var property = new A11yPatternProperty {
             Name = "SupportedTextSelection", Value = UIAutomationClient.SupportedTextSelection.SupportedTextSelection_None
         };
         pattern.Properties.Add(property);
         e.Patterns.Add(pattern);
         Assert.IsFalse(Patterns.TextSelectionSupported.Matches(e));
     } // using
 }