Exemplo n.º 1
0
        private void CreateSyntaxSection()
        {
            var htmlSyntaxProcessor = new HtmlSyntaxProcessor(_htmlFileContent);
            var csharpCode          = htmlSyntaxProcessor.CsharpCode();
            var vbCode         = htmlSyntaxProcessor.VisualBasicCode();
            var cppCode        = htmlSyntaxProcessor.CppCode();
            var memberSentence = htmlSyntaxProcessor.MemberSentence();

            _wordGenerator.CreateTextSection("Syntax", 1, 10, 16, WdColor.wdColorDarkBlue);
            _wordGenerator.CreateTextSection(csharpCode, 1, 6, 13);
            _wordGenerator.CreateTextSection(vbCode, 1, 6, 13);
            _wordGenerator.CreateTextSection(cppCode, 1, 10, 13);
            _wordGenerator.CreateTextSection(memberSentence, 0, 12);
        }
Exemplo n.º 2
0
        public void RetrievesCSharpCodeSyntax()
        {
            var htmlText = @"class=""CodeSnippetContainerCode CSharpCode"" " +
                           @"id=""CSharpCodeId""><pre xml:space=""preserve"" class=""libCScode"">" +
                           @"<span class=""keyword"">public</span> <span class=""keyword"">sealed" +
                           @"</span> <span class=""keyword"">class</span> <span class=""identifier"">" +
                           @"MMSControl</span> : <span class=""nolink"">ControlBase</span></pre>" +
                           @"</div><div class=""CodeSnippetContainerCode VisualBasicCode"" " +
                           @"id=""VisualBasicCodeId""><pre xml:space=""preserve""";

            var syntaxProcessor = new HtmlSyntaxProcessor(htmlText);
            var csharpCode      = syntaxProcessor.CsharpCode();

            Assert.AreEqual("C# -> public sealed class MMSControl : ControlBase", csharpCode);
        }
        public void RetrievesCSharpCodeSyntax()
        {
            var htmlText = @"class=""CodeSnippetContainerCode CSharpCode"" " +
                @"id=""CSharpCodeId""><pre xml:space=""preserve"" class=""libCScode"">" +
                @"<span class=""keyword"">public</span> <span class=""keyword"">sealed" +
                @"</span> <span class=""keyword"">class</span> <span class=""identifier"">" +
                @"MMSControl</span> : <span class=""nolink"">ControlBase</span></pre>" +
                @"</div><div class=""CodeSnippetContainerCode VisualBasicCode"" " +
                @"id=""VisualBasicCodeId""><pre xml:space=""preserve""";

            var syntaxProcessor = new HtmlSyntaxProcessor(htmlText);
            var csharpCode = syntaxProcessor.CsharpCode();

            Assert.AreEqual("C# -> public sealed class MMSControl : ControlBase", csharpCode);
        }