TX Text Control .NET Server

GetItem Method

Method|Introduced in 10.1
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Gets a particular style from the collection.

Syntax

public InlineStyle GetItem(string styleName);

Parameters

ParameterDescription
styleName

Specifies the name of the style.

Return Value

The return value is null, if a style with the specified name is not contained in the collection. Otherwise it is an object of the type InlineStyle.

Examples

The following example works with inline styles in the current document by using InlineStyleCollection.GetItem.

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

var result = inlineStyleCollection.GetItem("CustomerName");
Console.WriteLine($"Get Item result: {result}");