Example #1
0
        public override bool SameNode(LdmlNode other)
        {
            LdmlTypeUnitNode nd = other as LdmlTypeUnitNode;

            return(nd != null &&
                   nd.Name == Name &&
                   nd._unit == _unit);
        }
Example #2
0
        public override bool SameNode(LdmlNode other)
        {
            LdmlTypeLengthNode nd = other as LdmlTypeLengthNode;

            return(nd != null &&
                   nd.Name == Name &&
                   nd._length == _length);
        }
Example #3
0
 internal static LdmlNode Select(this LdmlNode root, params string[] entries)
 {
     for (int i = 0; root != null && i < entries.Length; i++)
     {
         root = root.Select(entries[i]);
     }
     return(root);
 }
Example #4
0
 public static string GetText(this LdmlNode root)
 {
     if (root != null)
     {
         return(root.Value ?? "");
     }
     return("");
 }
Example #5
0
 internal static LdmlNode Select(this LdmlNode root, params NodePathEntry[] entries)
 {
     for (int i = 0; root != null && i < entries.Length; i++)
     {
         root = root.Select(entries[i].Name, entries[i].Attributes);
     }
     return(root);
 }
Example #6
0
 internal LdmlNode ResolveNode(LdmlNode root)
 {
     for (int i = Level; root != null && i > 0; i--)
     {
         root = root.Parent;
     }
     for (int i = 0; root != null && i < _entries.Length; i++)
     {
         root = root.ResolveNode(_entries[i].Name, _entries[i].Attributes);
     }
     return(root);
 }
Example #7
0
        internal LdmlNode SelectNode(LdmlDocument document)
        {
            if (Level != 0 || _entries.Length == 0 || _entries[0].Attributes.Length != 0)
            {
                return(null);
            }
            LdmlNode root = document.ResolveRootNode(_entries[0].Name);

            for (int i = 1; root != null && i < _entries.Length; i++)
            {
                root = root.SelectNode(_entries[i].Name, _entries[i].Attributes);
            }
            return(root);
        }
Example #8
0
 internal static LdmlNode SelectNode(this LdmlNode root, string name, LdmlAttributeValue[] filter = null)
 {
     if (root != null)
     {
         foreach (LdmlNode node in root.Children)
         {
             if (node.Name == name && node.HasAttributes(filter))
             {
                 return(node);
             }
         }
     }
     return(null);
 }
Example #9
0
 internal static LdmlNode Select(this LdmlNode root, string name, string filter, LdmlAttribute tp)
 {
     if (root != null)
     {
         foreach (LdmlNode node in root.Children)
         {
             if (node.Name == name && node.GetAttribute(tp) == filter)
             {
                 return(node);
             }
         }
     }
     return(null);
 }
Example #10
0
 internal static LdmlNode Select(this LdmlNode root, string name)
 {
     if (root != null)
     {
         foreach (LdmlNode node in root.Children)
         {
             if (node.Name == name)
             {
                 return(node);
             }
         }
     }
     return(null);
 }
Example #11
0
 internal static LdmlNode Select(this LdmlNode root, string name1, string name2)
 {
     return(root.Select(name1).Select(name2));
 }