protected virtual bool ValidateRegionName(string[] lines, ref string regionName)
        {
            int keepHashMark = 0; // "#example" if value is -1 or "example" if value will be 0

            string region      = lines[0];
            int    regionIndex = region.IndexOf(RegionHelperStartPattern);

            if (regionIndex == 0)
            {
                isHelper   = true;
                regionName = CodeExampleDemoUtils.ConvertStringToMoreHumanReadableForm(region.Substring(regionIndex + RegionHelperStartPattern.Length + keepHashMark));
            }

            if (regionIndex < 0)
            {
                isHelper    = false;
                regionIndex = region.IndexOf(RegionStartPattern);
                if (regionIndex < 0)
                {
                    regionName = String.Empty;
                    return(false);
                }
                regionName = CodeExampleDemoUtils.ConvertStringToMoreHumanReadableForm(region.Substring(regionIndex + RegionStartPattern.Length + keepHashMark));
            }
            return(true);
        }
        private void InitializeSyntaxHighlightForVBClass(object sender, EventArgs e)
        {
            SyntaxHightlightInitializeHelper syntaxHightlightInitializator = new SyntaxHightlightInitializeHelper();

            syntaxHightlightInitializator.Initialize(codeEditorVbClass, CodeExampleDemoUtils.GetCodeExampleFileExtension(ExampleLanguage.VB));

            DisableRichEditFeatures(codeEditorVbClass);
        }
        protected CodeExample CreateRichEditExample(string exampleGroup, string regionName, string exampleCode)
        {
            CodeExample result = new CodeExample();

            SetExampleCode(exampleCode, result);
            result.RegionName             = regionName;
            result.HumanReadableGroupName = CodeExampleDemoUtils.ConvertStringToMoreHumanReadableForm(exampleGroup);
            return(result);
        }
 protected virtual string[] DeleteLeadingWhiteSpacesFromSourceCode(string[] lines)
 {
     return(CodeExampleDemoUtils.DeleteLeadingWhiteSpaces(lines, "        "));
 }
 protected override string[] DeleteLeadingWhiteSpacesFromSourceCode(string[] lines)
 {
     string[] result = base.DeleteLeadingWhiteSpacesFromSourceCode(lines);
     return(CodeExampleDemoUtils.DeleteLeadingWhiteSpaces(result, "\t\t"));
 }