Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 45 additions & 40 deletions libraries/radwordsprocessing/concepts/document-themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,22 @@ __Example 1__ demonstrates how to create a __ThemeColorScheme__ object. Note tha

#### __[C#] Example 1: Create a ThemeColorScheme object__

{{region radwordsprocessing-concepts-document-themes_0}}
ThemeColorScheme colorScheme = new ThemeColorScheme(
"Mine",
Colors.Black, // background 1
Colors.Blue, // text 1
Colors.Brown, // background 2
Colors.Cyan, // text 2
Colors.DarkGray, // accent 1
Colors.Gray, // accent 2
Colors.Green, // accent 3
Colors.LightGray, // accent 4
Colors.Magenta, // accent 5
Colors.Orange, // accent 6
Colors.Purple, // hyperlink
Colors.Red); // followedHyperlink
{{region cs-radwordsprocessing-concepts-document-themes_0}}

ThemeColorScheme colorScheme = new ThemeColorScheme(
"Mine",
Colors.Black, // background 1
Colors.Blue, // text 1
Colors.Brown, // background 2
Colors.Cyan, // text 2
Colors.DarkGray, // accent 1
Colors.Gray, // accent 2
Colors.Green, // accent 3
Colors.LightGray, // accent 4
Colors.Magenta, // accent 5
Colors.Orange, // accent 6
Colors.Purple, // hyperlink
Colors.Red); // followedHyperlink
{{endregion}}


Expand Down Expand Up @@ -91,8 +92,9 @@ In order to create colors that depend on the current document theme, you need to

#### __[C#] Example 2: Create a ThemableColor object__

{{region radwordsprocessing-concepts-document-themes_1}}
ThemableColor themableColor = new ThemableColor(ThemeColorType.Accent1);
{{region cs-radwordsprocessing-concepts-document-themes_1}}

ThemableColor themableColor = new ThemableColor(ThemeColorType.Accent1);
{{endregion}}


Expand All @@ -111,12 +113,13 @@ The code in __Example 3__ illustrates how to create a __ThemeFontScheme__ object

#### __[C#] Example 3: Create a ThemeFontScheme__

{{region radwordsprocessing-concepts-document-themes_2}}
ThemeFontScheme fontScheme = new ThemeFontScheme(
"Mine",
"Times New Roman", // Major
"Arial"); // Minor
{{endregion}}
{{region cs-radwordsprocessing-concepts-document-themes_2}}

ThemeFontScheme fontScheme = new ThemeFontScheme(
"Mine",
"Times New Roman", // Major
"Arial"); // Minor
{{endregion}}



Expand All @@ -134,8 +137,9 @@ When you need to create a font that depends on the current document theme, you n

#### __[C#] Example 4: Create a ThemableFontFamily object__

{{region radwordsprocessing-concepts-document-themes_3}}
ThemableFontFamily themableFont = new ThemableFontFamily(ThemeFontType.Major);
{{region cs-radwordsprocessing-concepts-document-themes_3}}

ThemableFontFamily themableFont = new ThemableFontFamily(ThemeFontType.Major);
{{endregion}}


Expand All @@ -147,8 +151,9 @@ Now that you have a color and a font schemes, you can create a new __DocumentThe

#### __[C#] Example 5: Create a DocumentTheme object__

{{region radwordsprocessing-concepts-document-themes_4}}
DocumentTheme theme = new DocumentTheme("Mine", colorScheme, fontScheme);
{{region cs-radwordsprocessing-concepts-document-themes_4}}

DocumentTheme theme = new DocumentTheme("Mine", colorScheme, fontScheme);
{{endregion}}


Expand All @@ -158,8 +163,9 @@ There are a number of predefined color and font schemes. You can find them in a

#### __[C#] Example 6: Using a predefined scheme__

{{region radwordsprocessing-concepts-document-themes_5}}
DocumentTheme theme1 = new DocumentTheme("From Predefined schemes", PredefinedThemeSchemes.ColorSchemes[0], PredefinedThemeSchemes.FontSchemes[5]);
{{region cs-radwordsprocessing-concepts-document-themes_5}}

DocumentTheme theme1 = new DocumentTheme("From Predefined schemes", PredefinedThemeSchemes.ColorSchemes[0], PredefinedThemeSchemes.FontSchemes[5]);
{{endregion}}


Expand All @@ -169,9 +175,9 @@ Changing the current document theme is as easy as setting a single property.

#### __[C#] Example 7: Change the document theme__

{{region radwordsprocessing-concepts-document-themes_6}}
RadFlowDocument document = new RadFlowDocument();
document.Theme = theme;
{{region cs-radwordsprocessing-concepts-document-themes_6}}
RadFlowDocument document = new RadFlowDocument();
document.Theme = theme;
{{endregion}}


Expand All @@ -183,24 +189,23 @@ In order to get the actual value from __ThemableColor__ or __ThemableFontFamily_

#### __[C#] Example 8: Get actual value from ThemableColor__

{{region radwordsprocessing-concepts-document-themes_7}}
Color actualColor = themableColor.GetActualValue(theme);
// the actual color is the same as Accent1 color of the colorScheme
{{region cs-radwordsprocessing-concepts-document-themes_7}}
Color actualColor = themableColor.GetActualValue(theme);
// The actual color is the same as Accent1 color of the colorScheme.
{{endregion}}



#### __[C#] Example 9: Get actual value from ThemableFont__

{{region radwordsprocessing-concepts-document-themes_8}}
var actualFont = themableFont.GetActualValue(theme);

// the actualFont is the same as the Major font of the fontScheme
{{region cs-radwordsprocessing-concepts-document-themes_8}}
var actualFont = themableFont.GetActualValue(theme);
// The actualFont is the same as the Major font of the fontScheme.
{{endregion}}



# See Also
## See Also

* [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%})
* [Styles]({%slug radwordsprocessing-concepts-styles%})
34 changes: 19 additions & 15 deletions libraries/radwordsprocessing/concepts/fields/customcodefield.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ Here are some commonly used fields. The complete list of field codes and the swi

#### __[C#] Example 1: Insert PAGE field__

{{region radwordsprocessing-concepts-customcodefield_0}}
editor.InsertField("PAGE \\* ROMAN", "VII");
{{region cs-radwordsprocessing-concepts-customcodefield_0}}

editor.InsertField("PAGE \\* ROMAN", "VII");
{{endregion}}


Expand All @@ -66,29 +67,31 @@ The __\* ROMAN__ is general formatting switch that formats a numeric result usin

#### __[C#] Example 2: Insert NUMPAGES field__

{{region radwordsprocessing-concepts-customcodefield_1}}
editor.InsertText("Page ");
editor.InsertField("PAGE", "3");
editor.InsertText(" of ");
editor.InsertField("NUMPAGES", "5");
{{region cs-radwordsprocessing-concepts-customcodefield_1}}

editor.InsertText("Page ");
editor.InsertField("PAGE", "3");
editor.InsertText(" of ");
editor.InsertField("NUMPAGES", "5");
{{endregion}}



### Inserting AUTHOR Field

In ** Example 3** is demonstrated how to insert __AUTHOR__ field showing the name of the author of the document.
In **Example 3** is demonstrated how to insert __AUTHOR__ field showing the name of the author of the document.


#### __[C#] Example 3: Insert AUTHOR field__

{{region radwordsprocessing-concepts-customcodefield_3}}
editor.InsertField("AUTHOR \\* Upper", "JOHN DOE");
{{region cs-radwordsprocessing-concepts-customcodefield_3}}

editor.InsertField("AUTHOR \\* Upper", "JOHN DOE");
{{endregion}}



The __\* Upper__ switch will convert all letters in the result to uppercase.
The __\\\\\* Upper__ switch will convert all letters in the result to uppercase.


### Inserting Table of Contents Field
Expand All @@ -98,9 +101,10 @@ The __\* Upper__ switch will convert all letters in the result to uppercase.

#### __[C#] Example 4: Insert Table of Contents field__

{{region radwordsprocessing-concepts-customcodefield_4}}
FieldInfo tocField = editor.InsertField("TOC \\o \"1-3\" \\h \\z \\u", "result");
tocField.IsDirty = true;
{{region cs-radwordsprocessing-concepts-customcodefield_4}}

FieldInfo tocField = editor.InsertField("TOC \\o \"1-3\" \\h \\z \\u", "result");
tocField.IsDirty = true;
{{endregion}}


Expand All @@ -123,7 +127,7 @@ There are several switches which can be used for this field:
The __IsDirty__ property is set so that the TOC field is updated when the document is loaded inside an editor like Microsoft Word.


# See Also
## See Also

* [Fields]({%slug radwordsprocessing-concepts-fields%})
* [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%})
Expand Down
20 changes: 11 additions & 9 deletions libraries/radwordsprocessing/concepts/fields/document-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ Document variables provide a mechanism to store information in the document in a

#### __[C#] Example 1: Add document variable record__

{{region radwordsprocessing-concepts-document-variables_0}}
RadFlowDocument document = new RadFlowDocument();
document.DocumentVariables["Job"] = "Software Engineer";
document.DocumentVariables.Add("Name", "Nancy Davolio");
{{region cs-radwordsprocessing-concepts-document-variables_0}}

RadFlowDocument document = new RadFlowDocument();
document.DocumentVariables["Job"] = "Software Engineer";
document.DocumentVariables.Add("Name", "Nancy Davolio");
{{endregion}}


Expand All @@ -41,8 +42,9 @@ Removing defined variables can be achieved by using the __Remove()__ method of t

#### __[C#] Example 2: Remove document variable record__

{{region radwordsprocessing-concepts-document-variables_1}}
document.DocumentVariables.Remove("Job");
{{region cs-radwordsprocessing-concepts-document-variables_1}}

document.DocumentVariables.Remove("Job");
{{endregion}}


Expand All @@ -62,13 +64,13 @@ A __DocumentVariable__ field can be inserted through [RadFlowDocumentEditor]({%s

#### __[C#] Example 3: Insert document variable field__

{{region radwordsprocessing-concepts-document-variables_2}}
editor.InsertField("DOCVARIABLE Name", "Nancy Davolio");
{{region cs-radwordsprocessing-concepts-document-variables_2}}
editor.InsertField("DOCVARIABLE Name", "Nancy Davolio");
{{endregion}}



# See Also
## See Also

* [Fields]({%slug radwordsprocessing-concepts-fields%})
* [RadFlowDocument]({%slug radwordsprocessing-model-radflowdocument%})
Loading