//[Variation(Priority = 0, Desc = "IEquatable: different names (NS)")] public void Variation13() { XName nameOne = GetName("nameOne", "ns1"); XName nameTwo = GetName("nameOne", "ns2"); TestLog.Compare(nameOne != nameTwo, "nameOne and nameTwo are the same objects"); TestLog.Compare(!nameOne.Equals(nameTwo), "nameOne and nameTwo are the same objects"); TestLog.Compare(!((IEquatable <XName>)nameOne).Equals(nameTwo), "nameOne and nameTwo are not the same objects"); }
public void StringComparisons() { string s = "xmlns"; XName n = "xmlns"; Assert.True(s == n); Assert.True(n == s); Assert.False(s.Equals(n)); Assert.False(n.Equals(s)); }
internal XElement ExecuteFSM(IEnumerator <XElement> enumerator, XName requestingXName, WildCard requestingWildCard) { XElement currElem = null; WildCard matchingWildCard = null; XName matchingName = null; while (enumerator.MoveNext()) { currElem = enumerator.Current; currentState = FsmMakeTransition(currentState, currElem.Name, out matchingName, out matchingWildCard); if (currentState != FSM.InvalidState) { if ((requestingXName != null) && (matchingName != null)) { if (requestingXName.Equals(currElem.Name)) { return(currElem); } } else if ((requestingWildCard != null) && (matchingWildCard != null)) { //requesting for ANY if (requestingWildCard.Allows(currElem.Name) ) //Make sure current element is allowed by requesting ANY property { return(currElem); } } } else { //Get stuck. No recovery attempt is provided for now. return(null); } } //No matching elements/wildcards are found return(null); }
public static IEnumerable <T> WithName <T> (this IEnumerable <XNode> nodes, XName name, bool ignoreCase) where T : XNode, INamedXObject { return(nodes.OfType <T> ().Where(el => XName.Equals(el.Name, name, ignoreCase))); }
public static bool IsServerScriptTag(this XElement el) { return(XName.Equals(el.Name, scriptName, true) && IsRunatServer(el)); }