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 RetrievesVisualBasicCode()
        {
            var htmlText = @"VisualBasicCode"" id=""VisualBasicCodeId""><pre " +
                           @"xml:space=""preserve"" class=""libCScode""><span class=""keyword"">" +
                           @"Public</span> <span class=""keyword"">NotInheritable</span> " +
                           @"<span class=""keyword"">Class</span> <span class=""identifier"">" +
                           @"MMSControl</span> _
				<span class=""keyword"">Inherits</span> <span class=""nolink"">"                 +
                           @"ControlBase</span></pre></div><div class=""CodeSnippetContainerCode " +
                           @"ManagedCPlusPlusCode"" id=""ManagedCPlusPlusCodeId""><pre " +
                           @"xml:space=""preserve""";

            var syntaxProcessor = new HtmlSyntaxProcessor(htmlText);
            var vbCode          = syntaxProcessor.VisualBasicCode();

            Assert.AreEqual("VB -> Public NotInheritable Class MMSControl Inherits ControlBase",
                            vbCode);
        }
        public void RetrievesVisualBasicCode()
        {
            var htmlText = @"VisualBasicCode"" id=""VisualBasicCodeId""><pre " +
                @"xml:space=""preserve"" class=""libCScode""><span class=""keyword"">" +
                @"Public</span> <span class=""keyword"">NotInheritable</span> " +
                @"<span class=""keyword"">Class</span> <span class=""identifier"">" +
                @"MMSControl</span> _
                <span class=""keyword"">Inherits</span> <span class=""nolink"">" +
                @"ControlBase</span></pre></div><div class=""CodeSnippetContainerCode " +
                @"ManagedCPlusPlusCode"" id=""ManagedCPlusPlusCodeId""><pre " +
                @"xml:space=""preserve""";

            var syntaxProcessor = new HtmlSyntaxProcessor(htmlText);
            var vbCode = syntaxProcessor.VisualBasicCode();

            Assert.AreEqual("VB -> Public NotInheritable Class MMSControl Inherits ControlBase",
                vbCode);
        }