TX Text Control .NET for WPF

InlineStyleCollection Class

Class|Introduced in 10.1
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.
Inherits
  1. FormattingStyleCollection
  2. InlineStyleCollection
Implements
ICollection, IEnumerable

Description

An instance of the InlineStyleCollection class contains all inline formatting styles in the current document represented through objects of the type InlineStyle. An inline style is a character-based formatting style that can be used to format single words in a line of text. The InlineStyleCollection class implements the IEnumerable and the ICollection interfaces. An instance of this class can be obtained with the TextControl.InlineStyles property.

Syntax

public sealed class InlineStyleCollection : FormattingStyleCollection

Examples

The following example works with inline styles in the current document.

InlineStyleCollection inlineStyleCollection = textControl.InlineStyles;
inlineStyleCollection.Add(new InlineStyle("Emphasis"));

Members

Properties

PropertyDescription
CountGets the number of elements contained in the collection. (Inherited from FormattingStyleCollection.)
IsSynchronizedReturns true if the collection is designed to be thread safe, otherwise, it returns false. (Inherited from FormattingStyleCollection.)
SyncRootGets an object that can be used to synchronize access to the collection. (Inherited from FormattingStyleCollection.)

Methods

MethodDescription
AddAdds to new formatting style to the current document.
CopyToCopies the elements of the collection to an array, starting at a particular index.
GetEnumeratorReturns an enumerator that can be used to iterate through the collection. (Inherited from FormattingStyleCollection.)
GetItemGets a particular style from the collection.
RemoveRemoves a formatting style from a Text Control document. (Inherited from FormattingStyleCollection.)