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.

Document doc = new Document(MyDir + "Bibliography.docx");

// If the document already has a style you can change it with the following code:
// doc.Bibliography.BibliographyStyle = "Bibliography custom style.xsl";

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

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

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

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

See Also