コード例 #1
0
ファイル: FsmXObjects.cs プロジェクト: pusp/o2platform
 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;
 }
コード例 #2
0
ファイル: XmlComparision.cs プロジェクト: liwq-net/SwfLib
 private static bool Compare(XName first, XName second)
 {
     return first.Equals(second);
 }