Ejemplo n.º 1
0
        public override bool SameNode(LdmlNode other)
        {
            LdmlTypeUnitNode nd = other as LdmlTypeUnitNode;

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

            return(nd != null &&
                   nd.Name == Name &&
                   nd._length == _length);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 4
0
 public static string GetText(this LdmlNode root)
 {
     if (root != null)
     {
         return(root.Value ?? "");
     }
     return("");
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 11
0
 internal static LdmlNode Select(this LdmlNode root, string name1, string name2)
 {
     return(root.Select(name1).Select(name2));
 }