Interface ITextContainer
Represents a container for text elements.
Namespace: IronWord.Models.Abstract.Interfaces
Assembly: IronWord.dll
Syntax
public interface ITextContainer
Methods
AddText(TextContent)
Adds a pre-existing Run to the text container.
Declaration
TextContent AddText(TextContent Run)
Parameters
| Type | Name | Description |
|---|---|---|
| TextContent | Run | The Run to be added. |
Returns
| Type | Description |
|---|---|
| TextContent | The added Run. |
AddText(String)
Adds a Run with the specified text to the text container.
Declaration
TextContent AddText(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The text content of the Run to be added. |
Returns
| Type | Description |
|---|---|
| TextContent | The added Run. |
ExtractText()
Extract all text from the container
Declaration
string ExtractText()
Returns
| Type | Description |
|---|---|
| System.String | Extracted text |
FindText(String)
Find the first text element which contains the specified text
Declaration
TextContent FindText(string find)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | find | Text to find |
Returns
| Type | Description |
|---|---|
| TextContent | Text element containing the specified text |
Remove(TextContent)
Remove the specified text element
Declaration
bool Remove(TextContent element)
Parameters
| Type | Name | Description |
|---|---|---|
| TextContent | element | Text element to remove |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the element was found and removed, False otherwise |
ReplaceText(String, String)
Replace all instances of the specified text
Declaration
void ReplaceText(string find, string replace)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | find | Text to replace |
| System.String | replace | Replacement text |