Пример #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);
        }
Пример #2
0
        public void RetrieveMemberExposingSentence()
        {
            var htmlText = @"ManagedCPlusPlusCode"" id=""ManagedCPlusPlusCodeId"">" +
                           @"<pre xml:space=""preserve"" class=""libCScode""><span " +
                           @"class=""keyword"">public</span> <span class=""keyword"">ref class" +
                           @"</span> <span class=""identifier"">MMSControl</span> <span " +
                           @"class=""keyword"">sealed</span> : <span class=""keyword"">public</span> " +
                           @"<span class=""nolink"">ControlBase</span></pre></div></div></div>" +
                           @"</div></div><p>The MMSControl type exposes the following members.</p>" +
                           @"<div class=""LW_CollapsibleArea_Container""><div " +
                           @"class=""LW_CollapsibleArea_TitleDiv""><h2 " +
                           @"class=""LW_CollapsibleArea_Title"">Constructors</h2><div " +
                           @"class=""LW_CollapsibleArea_HrDiv"">";

            var syntaxProcessor = new HtmlSyntaxProcessor(htmlText);
            var memberSentence  = syntaxProcessor.MemberSentence();

            Assert.AreEqual("The MMSControl type exposes the following members.",
                            memberSentence);
        }
        public void RetrieveMemberExposingSentence()
        {
            var htmlText = @"ManagedCPlusPlusCode"" id=""ManagedCPlusPlusCodeId"">" +
                @"<pre xml:space=""preserve"" class=""libCScode""><span " +
                @"class=""keyword"">public</span> <span class=""keyword"">ref class" +
                @"</span> <span class=""identifier"">MMSControl</span> <span " +
                @"class=""keyword"">sealed</span> : <span class=""keyword"">public</span> " +
                @"<span class=""nolink"">ControlBase</span></pre></div></div></div>" +
                @"</div></div><p>The MMSControl type exposes the following members.</p>" +
                @"<div class=""LW_CollapsibleArea_Container""><div " +
                @"class=""LW_CollapsibleArea_TitleDiv""><h2 " +
                @"class=""LW_CollapsibleArea_Title"">Constructors</h2><div " +
                @"class=""LW_CollapsibleArea_HrDiv"">";

            var syntaxProcessor = new HtmlSyntaxProcessor(htmlText);
            var memberSentence = syntaxProcessor.MemberSentence();

            Assert.AreEqual("The MMSControl type exposes the following members.",
                memberSentence);
        }