Class TextContainer
Represents an object that contains text.
Implements
IronSoftware.Abstractions.IDocumentElement
IronSoftware.IDocumentObject
System.ICloneable
Inherited Members
Namespace: IronWord.Models.Abstract
Assembly: IronWord.dll
Syntax
public abstract class TextContainer : ParentElement, IDocumentElement, IDocumentObject, ICloneable, ITextContainer
Constructors
TextContainer()
Declaration
protected TextContainer()
Methods
AddChild(ContentElement[])
Adds one or more child content elements to the current content element.
Declaration
public override void AddChild(params ContentElement[] children)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentElement[] | children | The content elements to be added as children. |
Overrides
AddText(TextContent)
Adds a new Run to this paragraph.
Declaration
public TextContent AddText(TextContent textContent)
Parameters
| Type | Name | Description |
|---|---|---|
| TextContent | textContent |
Returns
| Type | Description |
|---|---|
| TextContent |
AddText(String)
Adds a new Text to this paragraph.
Declaration
public TextContent AddText(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text |
Returns
| Type | Description |
|---|---|
| TextContent |
ExtractText()
Extract all text from the container
Declaration
public string ExtractText()
Returns
| Type | Description |
|---|---|
| System.String | Extracted text |
FindText(String)
Find the first text element which contains the specified text
Declaration
public 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
public 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
public void ReplaceText(string find, string replace)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | find | Text to replace |
| System.String | replace | Replacement text |
Implements
IronSoftware.Abstractions.IDocumentElement
IronSoftware.IDocumentObject
System.ICloneable