Beispiel #1
0
 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;
 }
Beispiel #2
0
 private static bool Compare(XName first, XName second)
 {
     return first.Equals(second);
 }