Esempio n. 1
0
        static private int GetNext(MethodNameId location, int start, char endChar, out int pos)
        {
            var currStr = String.Empty;
            var j       = start;

            pos = -1;
            for (; j < location.Length; j++)
            {
                var currChar = location[j];
                if (currChar == endChar)
                {
                    if (Int32.TryParse(currStr, out pos))
                    {
                        return(j);
                    }
                    else
                    {
                        // failure
                        return(-1);
                    }
                }
                if (Char.IsDigit(currChar))
                {
                    currStr += currChar;
                }
                else if (j != start) // we forgive the first character to be a non-string, but not the others!
                {
                    return(-1);
                }
            }
            return(j);
        }
Esempio n. 2
0
 static private int GetNext(MethodNameId location, int start, char endChar, out int pos)
 {
   var currStr = String.Empty;
   var j = start;
   pos = -1;
   for (; j < location.Length; j++)
   {
     var currChar = location[j];
     if(currChar == endChar)
     {
       if(Int32.TryParse(currStr, out pos))
       {
         return j;
       }
       else
       {
         // failure
         return -1;
       }
     }
     if(Char.IsDigit(currChar))
     {
       currStr += currChar;
     }
     else if(j != start) // we forgive the first character to be a non-string, but not the others!
     {
       return -1;
     }
   }
   return j;
 }