Method CreateReadonlyTextFragment
CreateReadonlyTextFragment(string, int, int)
Creates a ReadOnlyMessageFragment which represents a sub string of the original that should be preserved and not modified by any other pseudo methods. Fragments are created using an ObjectPool so they can be reused. Use ReleaseFragment(MessageFragment) to return the fragment or allow the Message to handle returning the fragment if it is part of Fragments.
Declaration
public ReadOnlyMessageFragment CreateReadonlyTextFragment(string original, int start, int end)
Parameters
| Type | Name | Description |
|---|---|---|
| string | original | Original string |
| int | start | Sub string start |
| int | end | Sub string end |
Returns
| Type | Description |
|---|---|
| ReadOnlyMessageFragment | A new fragment. |
CreateReadonlyTextFragment(string)
Creates a ReadOnlyMessageFragment which represents string that should be preserved and not modified by any other pseudo methods. Fragments are created using an ObjectPool so they can be reused. Use ReleaseFragment(MessageFragment) to return the fragment or allow the Message to handle returning the fragment if it is part of Fragments.
Declaration
public ReadOnlyMessageFragment CreateReadonlyTextFragment(string original)
Parameters
| Type | Name | Description |
|---|---|---|
| string | original | The source string. |
Returns
| Type | Description |
|---|---|
| ReadOnlyMessageFragment | A new fragment. |