Επεξεργασία

Κοινή χρήση μέσω


MaskedTextProvider.Set Method

Definition

Sets the formatted string to the specified input string.

Overloads

Set(String)

Sets the formatted string to the specified input string.

Set(String, Int32, MaskedTextResultHint)

Sets the formatted string to the specified input string, and then outputs the removal position and descriptive information.

Set(String)

Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs

Sets the formatted string to the specified input string.

public:
 bool Set(System::String ^ input);
public bool Set (string input);
member this.Set : string -> bool
Public Function Set (input As String) As Boolean

Parameters

input
String

The String value used to set the formatted string.

Returns

true if all the characters were successfully set; otherwise, false.

Exceptions

The input parameter is null.

Remarks

The Set method clears the existing contents of the formatted string and then applies the mask against the input string to update the contents of the formatted string.

The following conditions are considered errors. When an error occurs, the formatted string remains unaltered and Set returns false.

  • There are not enough editable positions in the formatted string to hold the contents of the replacement string.

  • One of the replacement character values is not valid because it is not printable or does not match its corresponding mask element.

See also

Applies to

Set(String, Int32, MaskedTextResultHint)

Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs

Sets the formatted string to the specified input string, and then outputs the removal position and descriptive information.

public:
 bool Set(System::String ^ input, [Runtime::InteropServices::Out] int % testPosition, [Runtime::InteropServices::Out] System::ComponentModel::MaskedTextResultHint % resultHint);
public bool Set (string input, out int testPosition, out System.ComponentModel.MaskedTextResultHint resultHint);
member this.Set : string * int * MaskedTextResultHint -> bool
Public Function Set (input As String, ByRef testPosition As Integer, ByRef resultHint As MaskedTextResultHint) As Boolean

Parameters

input
String

The String value used to set the formatted string.

testPosition
Int32

If successful, the zero-based position in the formatted string where the last character was actually set; otherwise, the first position where the operation failed. An output parameter.

resultHint
MaskedTextResultHint

A MaskedTextResultHint that succinctly describes the result of the set operation. An output parameter.

Returns

true if all the characters were successfully set; otherwise, false.

Exceptions

The input parameter is null.

Remarks

The Set method clears the existing contents of the formatted string and then applies the mask against the input string to update the contents of the formatted string.

The following conditions are considered errors. When an error occurs, the formatted string remains unaltered and Set returns false.

  • There are not enough editable positions in the formatted string to hold the contents of the replacement string.

  • One of the replacement character values is not valid because it is not printable or does not match its corresponding mask element.

This version of Set provides two additional output parameters to convey more information about the operation of the method.

See also

Applies to