VegaRise.NET
Back to DOM

DocumentDefualtStylesClass

Definition

Namespace
DOM.Styles
Assembly
DOM.dll

Provides the default / built-in style collection for a document.

Remarks

This class derives from and represents the canonical set of styles that should be applied to a newly created document (for example default paragraph, character, table and list styles). BaseDocumentStyle The class itself is intentionally lightweight and acts primarily as a typed marker so callers can request or register the default document styles by name or type. Concrete style values are supplied by the base implementation or by style initialization logic elsewhere in the library.

Examples

csharp
1// 1. Set both default styles
2var defaults = new DocumentDefualtStyles
3{
4 ParagraphStyle = new ParagraphStyle(),
5 TextStyle = new TextStyle { Font = new Font("Calibri", 11.0) }
6};
7doc.DocumentStyles.DocumentDefualtStyles = defaults;
8
csharp
1// 2. Set only the default text style
2var defaults = new DocumentDefualtStyles
3{
4 TextStyle = new TextStyle
5 {
6 Font = new Font
7 {
8 Latin = new FontPart { FontName = "Segoe UI", Size = 11.0 },
9 Color = Color.DarkSlateGray
10 }
11 }
12};
13
csharp
1// 3. Empty instance — consumer falls back to library defaults
2doc.DocumentStyles.DocumentDefualtStyles = new DocumentDefualtStyles();
3
csharp
1// 4. Use alongside built-in styles
2doc.DocumentStyles.DocumentDefualtStyles = new DocumentDefualtStyles
3{
4 TextStyle = new TextStyle { Font = new Font("Cambria", 11.0) }
5};
6doc.DocumentStyles.DocumentBuiltInStyles = new List<IBuiltInStyle>
7{
8 new BuiltInStyle { StyleId = "Normal", Name = "Normal", IsDefault = true, Type = StyleValues.Paragraph }
9};
10
No members discovered for this type.
VegaRiseVDocs.NET

Create Account

Create your VDocs account.

or

Already have an account? Sign in