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); }
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); }
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; }
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); }
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); }
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; }
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); }
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))); }