TX Text Control .NET for WPF

IsCommonValueSelected Method

Method
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Informs about whether a certain attribute has the same value for the complete selection.

Syntax

IsCommonValueSelected(Selection.Attribute)

Informs about whether an attribute from the Selection.Attribute enumeration has the same value for the complete selection.

public bool IsCommonValueSelected(Selection.Attribute attribute);
ParameterDescription
attribute

Specifies a possible value from the enumeration.

IsCommonValueSelected(ParagraphFormat.Attribute)

Informs about whether an attribute from the ParagraphFormat.Attribute enumeration has the same value for the complete selection.

public bool IsCommonValueSelected(ParagraphFormat.Attribute attribute);
ParameterDescription
attribute

Specifies a possible value from the enumeration.

IsCommonValueSelected(ListFormat.Attribute)

Informs about whether an attribute from the ListFormat.Attribute enumeration has the same value for the complete selection.

public bool IsCommonValueSelected(ListFormat.Attribute attribute);
ParameterDescription
attribute

Specifies a possible value from the enumeration.

IsCommonValueSelected(SectionFormat.Attribute)

Informs about whether an attribute from the SectionFormat.Attribute enumeration has the same value for the complete selection.

public bool IsCommonValueSelected(SectionFormat.Attribute attribute);
ParameterDescription
attribute

Specifies a possible value from the enumeration.

IsCommonValueSelected(PageMargins.Attribute)

Informs about whether an attribute from the PageMargins.Attribute enumeration has the same value for the complete selection.

public bool IsCommonValueSelected(PageMargins.Attribute attribute);
ParameterDescription
attribute

Specifies a possible value from the enumeration.

IsCommonValueSelected(PageSize.Attribute)

Informs about whether an attribute from the PageSize.Attribute enumeration has the same value for the complete selection.

public bool IsCommonValueSelected(PageSize.Attribute attribute);
ParameterDescription
attribute

Specifies a possible value from the enumeration.

IsCommonValueSelected(PageBorder.Attribute)

Informs about whether an attribute from the PageBorder.Attribute enumeration has the same value for the complete selection.

public bool IsCommonValueSelected(PageBorder.Attribute attribute);
ParameterDescription
attribute

Specifies a possible value from the enumeration.

Return Value

The return value is true if the complete selection is formatted with the same value of the specified attribute. Otherwise it is false.

Examples

The following example formats the heading of a short document by using Selection.IsCommonValueSelected.

textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;

if (selection.IsCommonValueSelected(Selection.Attribute.Baseline))
{
    Console.WriteLine("Is Common Value Selected completed successfully.");
}