IBibliographyStylesProvider

IBibliographyStylesProvider interface

Implement this interface to provide bibliography style for the FieldBibliography and FieldCitation fields when they’re updated.

public interface IBibliographyStylesProvider

Methods

NameDescription
GetStyle(string)Returns bibliography style.

Examples

Shows how to override built-in styles or provide custom one.

public void ChangeBibliographyStyles()
{
    Document doc = new Document(MyDir + "Bibliography.docx");

    doc.FieldOptions.BibliographyStylesProvider = new BibliographyStylesProvider();
    doc.UpdateFields();

    doc.Save(ArtifactsDir + "Field.ChangeBibliographyStyles.docx");

}

public class BibliographyStylesProvider : IBibliographyStylesProvider
{
    Stream IBibliographyStylesProvider.GetStyle(string styleFileName)
    {
        return File.OpenRead(MyDir + "Bibliography custom style.xsl");
    }
}

See Also