Exemplo n.º 1
0
        public AttributeNode TakeAttribute(string name, NamespacesType nsType)
        {
            AttributeNode node;
            Func <AttributeNode, bool> predicate = null;
            Func <AttributeNode, bool> func2     = null;

            if (nsType == NamespacesType.Unqualified)
            {
                if (predicate == null)
                {
                    predicate = a => a.Name == name;
                }
                node = this.Attributes.FirstOrDefault <AttributeNode>(predicate);
            }
            else
            {
                if (func2 == null)
                {
                    func2 = a => ((this._node.Element.Namespace == "http://sparkviewengine.com/") && (a.Name == name)) || ((a.Namespace == "http://sparkviewengine.com/") && (NameUtility.GetName(a.Name) == name));
                }
                node = this.Attributes.FirstOrDefault <AttributeNode>(func2);
            }
            this.Attributes.Remove(node);
            return(node);
        }
Exemplo n.º 2
0
        public static bool IsMatch(string nameA, string namespaceA, string nameB, string namespaceB, NamespacesType type)
        {
            if (type == NamespacesType.Unqualified)
                return nameA == nameB;

            return namespaceA == namespaceB &&
                   GetName(nameA) == GetName(nameB);
        }
Exemplo n.º 3
0
 public static bool IsMatch(string matchName, NamespacesType type, string name, string ns)
 {
     if (type == NamespacesType.Unqualified)
         return name == matchName;
     if (ns != Constants.Namespace)
         return false;
     return GetName(name) == matchName;
 }
Exemplo n.º 4
0
 public static bool IsMatch(string matchName, NamespacesType type, string name, string ns)
 {
     if (type == NamespacesType.Unqualified)
     {
         return(name == matchName);
     }
     if (ns != "http://sparkviewengine.com/")
     {
         return(false);
     }
     return(GetName(name) == matchName);
 }
Exemplo n.º 5
0
 public static bool IsMatch(string matchName, NamespacesType type, string name, string ns)
 {
     if (type == NamespacesType.Unqualified)
     {
         return(name == matchName);
     }
     if (ns != Constants.Namespace)
     {
         return(false);
     }
     return(GetName(name) == matchName);
 }
Exemplo n.º 6
0
        public AttributeNode TakeAttribute(string name, NamespacesType nsType)
        {
            AttributeNode attr;
            if (nsType == NamespacesType.Unqualified)
            {
                attr = Attributes.FirstOrDefault(a => a.Name == name);
            }
            else
            {
                attr = Attributes.FirstOrDefault(a =>
                    (_node.Element.Namespace == Constants.Namespace && a.Name == name) ||
                    (a.Namespace == Constants.Namespace && NameUtility.GetName(a.Name) == name));
            }

            Attributes.Remove(attr);
            return attr;
        }
Exemplo n.º 7
0
        public AttributeNode TakeAttribute(string name, NamespacesType nsType)
        {
            AttributeNode attr;

            if (nsType == NamespacesType.Unqualified)
            {
                attr = Attributes.FirstOrDefault(a => a.Name == name);
            }
            else
            {
                attr = Attributes.FirstOrDefault(a =>
                                                 (_node.Element.Namespace == Constants.Namespace && a.Name == name) ||
                                                 (a.Namespace == Constants.Namespace && NameUtility.GetName(a.Name) == name));
            }

            Attributes.Remove(attr);
            return(attr);
        }
Exemplo n.º 8
0
 public static bool IsMatch(string nameA, string namespaceA, string nameB, string namespaceB, NamespacesType type)
 {
     if (type == NamespacesType.Unqualified)
     {
         return(nameA == nameB);
     }
     return((namespaceA == namespaceB) && (GetName(nameA) == GetName(nameB)));
 }