TX Text Control .NET for Windows Forms

Save Method

Method|Introduced in 25.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Saves the editable region's text with the specified format.

Syntax

Save(out byte[], BinaryStreamType)

Saves the editable region's text in a byte array with the specified format.

public void Save(out byte[] binaryData, BinaryStreamType binaryStreamType);
ParameterDescription
binaryData

Specifies a byte array into which the editable region's text is saved. No memory needs to be allocated through the caller.

binaryStreamType

Specifies one of the BinaryStreamType values.

Save(out string, StringStreamType)

Saves the editable region's text as a string with the specified format.

public void Save(out string stringData, StringStreamType stringStreamType);
ParameterDescription
stringData

Specifies a string into which the editable region's text is saved. No memory needs to be allocated through the caller.

stringStreamType

Specifies one of the StringStreamType values.

Save(out byte[], BinaryStreamType, SaveSettings)

Saves the editable region's text in a byte array with the specified format and special settings.

public void Save(out byte[] binaryData, BinaryStreamType binaryStreamType, SaveSettings saveSettings);
ParameterDescription
binaryData

Specifies a byte array into which the editable region's text is saved. No memory needs to be allocated through the caller.

binaryStreamType

Specifies one of the BinaryStreamType values.

saveSettings

Specifies a SaveSettings object with additional information and settings for the save operation.

Save(out string, StringStreamType, SaveSettings)

Saves the editable region's text as a string with the specified format and special settings.

public void Save(out string stringData, StringStreamType stringStreamType, SaveSettings saveSettings);
ParameterDescription
stringData

Specifies a string into which the editable region's text is saved. No memory needs to be allocated through the caller.

stringStreamType

Specifies one of the StringStreamType values.

saveSettings

Specifies a SaveSettings object with additional information and settings for the save operation.

Examples

The following example marks selected contract text as editable by the review team by using EditableRegion.Save.

textControl.Text = "Terms subject to legal review";
textControl.Select(0, textControl.Text.Length);
EditableRegion editableRegion = new("ReviewTeam", 10);
textControl.EditableRegions.Add(editableRegion);

string stringData = @"{\rtf1\ansi Sample document}";
editableRegion.Save(out stringData, StringStreamType.RichTextFormat);