ATMLCommonLibrary.controls.awb.AWBEditor.GetCommentForCurrentPosition C# (CSharp) Method

GetCommentForCurrentPosition() public method

public GetCommentForCurrentPosition ( ) : string
return string
        public string GetCommentForCurrentPosition()
        {
            var sb = new StringBuilder();
            int pos = CurrentPos;
            int startPos = -1;
            int endPos = -1;

            string subText = Text.Substring(0, pos);
            int startComment = subText.LastIndexOf("<!--");
            if (startComment != -1)
            {
                string restOfFile = Text.Substring(startComment);
                int endComment = restOfFile.IndexOf("-->");
                if (endComment != -1)
                    sb.Append(restOfFile.Substring(4, endComment - 3));
                else
                    sb.Append(restOfFile.Substring(4));
            }
            return sb.ToString();
        }