VegaRise.NET
Back to DOM

BuiltInStyleClass

Definition

Namespace
DOM.Styles
Assembly
DOM.dll

Represents a single built-in or registered document style.

Remarks

extends with identification and behaviour metadata used to register and apply named styles in a document. Instances describe a style's identity ( and ), inheritance (), chaining (), and whether the style is considered the document default (). BuiltInStyle BaseDocumentStyle StyleId Name BasedOn Next IsDefault The registered set of built-in styles is exposed through . DocumentBuiltInStyles

Examples

csharp
1// 1. Register a custom paragraph style
2var custom = new BuiltInStyle
3{
4 StyleId = "MyQuote",
5 Name = "Block Quote",
6 Type = StyleValues.Paragraph,
7 BasedOn = "Normal",
8 Next = "Normal"
9};
10doc.DocumentStyles.DocumentBuiltInStyles.Add(custom);
11
csharp
1// 2. Register a character-level emphasis style
2var emphasis = new BuiltInStyle
3{
4 StyleId = "Emphasis",
5 Name = "Emphasis",
6 Type = StyleValues.Character,
7 TextStyle = new TextStyle
8 {
9 Font = new Font { Latin = new FontPart { FontName = "Calibri", Size = 11.0, IsItalic = true } }
10 }
11};
12
csharp
1// 3. Mark a style as the document default
2var normal = new BuiltInStyle
3{
4 StyleId = "Normal",
5 Name = "Normal",
6 Type = StyleValues.Paragraph,
7 IsDefault = true,
8 ParagraphStyle = new ParagraphStyle()
9};
10
csharp
1// 4. Heading style that chains to Normal
2var heading1 = new BuiltInStyle
3{
4 StyleId = "Heading1",
5 Name = "Heading 1",
6 Type = StyleValues.Paragraph,
7 BasedOn = "Normal",
8 Next = "Normal",
9 ParagraphStyle = new ParagraphStyle
10 {
11 SpacingBetweenLines = new Spacing { Before = 12, After = 6, Line = 1.2 }
12 }
13};
14
csharp
1// 5. Table style entry
2var tableStyle = new BuiltInStyle
3{
4 StyleId = "GridTable",
5 Name = "Grid Table",
6 Type = StyleValues.Table
7};
8

Properties

BasedOn

Gets or sets the identifier of the style this style is based on (inherits from).

IsDefault

Gets or sets a value indicating whether this style is the document default.

Name

Gets or sets the human-readable display name for the style.

Next

Gets or sets the identifier of the style to apply to the next paragraph created after using this style.

StyleId

Gets or sets the unique identifier for this style.

Gets or sets the style category/type.

VegaRise.NET

Sign In

Welcome back. Please sign in to your account.

Forgot password?
or

Don't have an account? Create an account

By signing in, you agree to our Terms of Service and Privacy Policy.