Dev2.Common.Dev2TokenOp.ExecuteOperation C# (CSharp) Method

ExecuteOperation() public method

public ExecuteOperation ( System.CharEnumerator canidate, int startIdx, int len, bool isReversed ) : string
canidate System.CharEnumerator
startIdx int
len int
isReversed bool
return string
        public string ExecuteOperation(CharEnumerator canidate, int startIdx, int len, bool isReversed)
        {
            var result = new StringBuilder();

            if (!isReversed && _tokenParts.Length == 1)
            {
                if (_tokenParts.Length == 1)
                {
                    char tmp;

                    // fetch next value while 
                    char previous = '\0';
                    while (canidate.MoveNext() &&
                           ((tmp = canidate.Current) != _tokenParts[0] || SkipDueToEscapeChar(previous)))
                    {
                        result.Append(tmp);
                        previous = tmp;
                    }
                }

                // did they want the token included?
                if (_include && (startIdx + result.Length) < len)
                {
                    result.Append(_tokenParts);
                }
            }
            else
            {
                throw new Exception("CharEnumerator is not supported for this operation type!");
            }

            return result.ToString();
        }

Same methods

Dev2TokenOp::ExecuteOperation ( char candidate, int startIdx, bool isReversed ) : string