TX Text Control .NET Server

IsInheritedFromParagraph 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

Informs about whether one or more of the style's attributes are inherited from the surrounding paragraph. Text formatted through an inline style has all the attributes defined through the surrounding paragraph except the attributes explicitly defined through the inline style.

Syntax

public bool IsInheritedFromParagraph(InlineStyle.Attributes attributes);

Parameters

ParameterDescription
attributes

Specifies one or more attributes. It can be a bitwise combination of values from the Attributes enumeration contained in this class.

Return Value

The return value is true, if the specified attributes are inherited from the paragraph. Otherwise it is false.

Examples

The following example creates and configures a reusable inline style for the document by using InlineStyle.IsInheritedFromParagraph.

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

if (inlineStyle.IsInheritedFromParagraph(InlineStyle.Attributes.FontName))
{
    Console.WriteLine("Is Inherited From Paragraph completed successfully.");
}