Dev2.Intellisense.Provider.FileSystemIntellisenseProvider.InLiteralRegion C# (CSharp) Method

InLiteralRegion() private method

Determines if the caret in a literal region
private InLiteralRegion ( string inputText, int caretPosition ) : bool
inputText string
caretPosition int
return bool
        bool InLiteralRegion(string inputText, int caretPosition)
        {
            bool inLiteralResionRegion = false;

            if(caretPosition <= inputText.Length)
            {
                inputText = inputText.Replace("\\\\", "##");
                inputText = inputText.Replace("\\'", "##");
                inputText = inputText.Replace("'''", "###");

                inLiteralResionRegion = inputText.Substring(0, caretPosition).Count(s => s == '\'') % 2 != 0;
            }

            return inLiteralResionRegion;
        }