Interface ITextContentElement
Assembly: IronPPT.dll
Syntax
public interface ITextContentElement : IHasTextStyle
Reading and rewriting the words of a text element in C# runs through ITextContentElement. It is the contract for an element whose content is editable text, giving a developer the find-and-replace surface that turns a placeholder deck into a finished one without rebuilding it.
A developer reaches this contract through a concrete element: Text implements it (a single run of text), and TextContentElement is the abstract base that text-bearing elements share. Code that searches or substitutes text usually works against this contract so the same routine handles any text element. The members are the editing toolkit: the Text property holds the current string, Find returns a List<int> of match positions for a search string (with optional regex, whole-word, and case-sensitivity flags), Replace swaps matched text and returns the updated ITextContentElement for chaining, and ToString yields the plain text. The TextStyle inherited from IHasTextStyle carries the formatting that travels with that text.
ITextContentElement element = run;
element.Replace("2024", "2025");
The add text how-to places editable text, and the add paragraph example builds text content.
Properties
Text
Declaration
string Text { get; set; }
Property Value
| Type |
Description |
| System.String |
|
Methods
Find(String, Nullable<RegexOptions>, Boolean, Boolean)
Declaration
List<int> Find(string searchText, Nullable<RegexOptions> regexOption = null, bool wholeWordOnly = false, bool caseSensitive = false)
Parameters
| Type |
Name |
Description |
| System.String |
searchText |
|
| System.Nullable<System.Text.RegularExpressions.RegexOptions> |
regexOption |
|
| System.Boolean |
wholeWordOnly |
|
| System.Boolean |
caseSensitive |
|
Returns
| Type |
Description |
| System.Collections.Generic.List<System.Int32> |
|
Replace(String, String, Nullable<RegexOptions>, Boolean, Boolean)
Declaration
ITextContentElement Replace(string searchText, string replaceText, Nullable<RegexOptions> regexOption = null, bool wholeWordOnly = false, bool caseSensitive = false)
Parameters
| Type |
Name |
Description |
| System.String |
searchText |
|
| System.String |
replaceText |
|
| System.Nullable<System.Text.RegularExpressions.RegexOptions> |
regexOption |
|
| System.Boolean |
wholeWordOnly |
|
| System.Boolean |
caseSensitive |
|
Returns
ToString()
Declaration
Returns
| Type |
Description |
| System.String |
|