Esempio n. 1
0
        protected virtual void AddAuthorAndBioToBody(FlowDocument flowDocument, XPathNavigator navigator, Story story, FlowDocumentStyleProvider styleProvider)
        {
            XPathNavigator headerNavigator = GetHeaderNavigator(navigator);
            MsdnFlowDocumentStyleProvider msdnStyleProvider = styleProvider as MsdnFlowDocumentStyleProvider;

            CreateBioTextParagraph(flowDocument, headerNavigator, story, msdnStyleProvider);
        }
Esempio n. 2
0
 protected virtual Style GetCopyrightParagraphStyle(MsdnFlowDocumentStyleProvider msdnStyleProvider)
 {
     if (msdnStyleProvider != null)
     {
         return(msdnStyleProvider.CopyrightParagraphStyle);
     }
     return(null);
 }
Esempio n. 3
0
 protected virtual Style GetLinkToSampleCodeFigureStyle(MsdnFlowDocumentStyleProvider msdnStyleProvider)
 {
     if (msdnStyleProvider != null)
     {
         return(msdnStyleProvider.LinkToSampleCodeFigureStyle);
     }
     return(null);
 }
Esempio n. 4
0
 protected virtual Style GetAuthorIssueFigureStyle(MsdnFlowDocumentStyleProvider msdnStyleProvider)
 {
     if (msdnStyleProvider != null)
     {
         return(msdnStyleProvider.AuthorIssueFigureStyle);
     }
     return(null);
 }
Esempio n. 5
0
        /// <summary>
        /// Creates headline and byline paragraphs
        /// </summary>
        protected override void CreateHeadline(FlowDocument flowDocument, XPathNavigator nitfNavigator, Story story, FlowDocumentStyleProvider styleProvider)
        {
            XPathNavigator headerNavigator = GetHeaderNavigator(nitfNavigator);
            MsdnFlowDocumentStyleProvider msdnStyleProvider = styleProvider as MsdnFlowDocumentStyleProvider;

            CreateHeadlineParagraph(flowDocument, headerNavigator, story, msdnStyleProvider);
            CreateAuthorIssueParagraph(flowDocument, headerNavigator, nitfNavigator, story, msdnStyleProvider);
            CreateLinkToSampleCodeParagraph(flowDocument, headerNavigator, story, msdnStyleProvider);
            //CreateBylineDateParagraph(flowDocument, headerNavigator, story, styleProvider);
        }
Esempio n. 6
0
        public virtual FlowDocument Convert(XPathDocument document, Story story)
        {
            XPathNavigator navigator = document.CreateNavigator();
            XPathNavigator msdn      = GetMsdnNavigator(navigator);

            Story = story;

            // Before conversion, pre-populate the list of web and ImageReference figures
            GetWebFigures(msdn, story);
            GetImageReferenceFigures(msdn, story);

            MsdnFlowDocumentStyleProvider styleProvider = ServiceProvider.ConverterManager.FlowDocumentStyleProvider as MsdnFlowDocumentStyleProvider;

            return(GetFlowDocumentFromNavigator(msdn, story, styleProvider));
        }
Esempio n. 7
0
        protected virtual void CreateCopyrightNoticeParagraph(FlowDocument flowDocument, MsdnFlowDocumentStyleProvider msdnStyleProvider)
        {
            Paragraph copyrightPara = new Paragraph();

            ApplyStyle(copyrightPara, GetCopyrightParagraphStyle(msdnStyleProvider));
            copyrightPara.Inlines.Add(new Run(Resources.Strings.MagazineConverterCopyright));
            flowDocument.Blocks.Add(copyrightPara);
        }
Esempio n. 8
0
        protected virtual void CreateBioTextParagraph(FlowDocument flowDocument, XPathNavigator headlineNavigator, Story story, MsdnFlowDocumentStyleProvider msdnStyleProvider)
        {
            Paragraph bioPara = new Paragraph();

            ApplyStyle(bioPara, GetBioParagraphStyle(msdnStyleProvider));

            String bioText = GetAuthorText(headlineNavigator) + GetBioText(headlineNavigator);

            bioPara.Inlines.Add(new Run(bioText));

            flowDocument.Blocks.Add(bioPara);
        }
Esempio n. 9
0
        protected virtual void CreateLinkToSampleCodeParagraph(FlowDocument flowDocument, XPathNavigator headlineNavigator, Story story, MsdnFlowDocumentStyleProvider msdnStyleProvider)
        {
            Hyperlink download = GetDownloadHyperlink(headlineNavigator);

            if (download != null)
            {
                Paragraph samplePara = new Paragraph();
                ApplyStyle(samplePara, GetLinkToSampleCodeParagraphStyle(msdnStyleProvider));

                Figure sampleFigure = new Figure();
                ApplyStyle(sampleFigure, GetLinkToSampleCodeFigureStyle(msdnStyleProvider));
                samplePara.Inlines.Add(sampleFigure);

                Paragraph sampleTextPara = new Paragraph();
                sampleTextPara.Inlines.Add(download);
                sampleFigure.Blocks.Add(sampleTextPara);

                flowDocument.Blocks.Add(samplePara);
            }
        }
Esempio n. 10
0
        protected virtual void CreateAuthorIssueParagraph(FlowDocument flowDocument, XPathNavigator headlineNavigator, XPathNavigator nitfNavigator, Story story, MsdnFlowDocumentStyleProvider msdnStyleProvider)
        {
            Paragraph authorIssuePara = new Paragraph();

            ApplyStyle(authorIssuePara, GetAuthorParagraphStyle(msdnStyleProvider));

            Figure authorIssueFigure = new Figure();

            ApplyStyle(authorIssueFigure, GetAuthorIssueFigureStyle(msdnStyleProvider));
            authorIssuePara.Inlines.Add(authorIssueFigure);

            String    authorText     = GetAuthorText(headlineNavigator);
            Paragraph authorTextPara = new Paragraph(new Run(authorText));

            authorIssueFigure.Blocks.Add(authorTextPara);

            String    issueText     = GetIssueText(nitfNavigator);
            Paragraph issueTextPara = new Paragraph(new Run(issueText));

            ApplyStyle(issueTextPara, GetIssueParagraphStyle(msdnStyleProvider));
            authorIssueFigure.Blocks.Add(issueTextPara);

            flowDocument.Blocks.Add(authorIssuePara);
        }
Esempio n. 11
0
        protected virtual void AddCopyrightNoticeToBody(FlowDocument flowDocument, XPathNavigator navigator, Story story, FlowDocumentStyleProvider styleProvider)
        {
            MsdnFlowDocumentStyleProvider msdnStyleProvider = styleProvider as MsdnFlowDocumentStyleProvider;

            CreateCopyrightNoticeParagraph(flowDocument, msdnStyleProvider);
        }