Class Token
Represents the old and new values to be used for string replacements.
Implements
Inherited Members
Namespace: Nevatech.Vsb.Repository
Assembly: Nevatech.Vsb.Repository.dll
Syntax
public sealed class Token : IEquatable<Token>
Constructors
Token(String, String)
Initializes a new instance with provided old and new values.
Declaration
public Token(string oldValue, string newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| String | oldValue | A string to be replaced. |
| String | newValue | A string to replace all occurrences of old value. |
Token(String, String, StringComparison)
Initializes a new instance with provided old and new values and string comparison.
Declaration
public Token(string oldValue, string newValue, StringComparison comparison)
Parameters
| Type | Name | Description |
|---|---|---|
| String | oldValue | A string to be replaced. |
| String | newValue | A string to replace all occurrences of old value. |
| StringComparison | comparison | String comparison rules to be used for finding old values. |
Properties
Comparison
Gets string comparison rules to be used for finding old values.
Declaration
public StringComparison Comparison { get; }
Property Value
| Type | Description |
|---|---|
| StringComparison |
Index
Gets or sets the last position of the token in the source string. This property is used internally and is not supposed to be set by the caller.
Declaration
public int Index { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
NewValue
Gets a string to replace all occurrences of old value.
Declaration
public string NewValue { get; }
Property Value
| Type | Description |
|---|---|
| String |
OldValue
Gets a string to be replaced.
Declaration
public string OldValue { get; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
Equals(Token)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(Token other)
Parameters
| Type | Name | Description |
|---|---|---|
| Token | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| Boolean | true if the current object is equal to the other parameter; otherwise, false. |
Equals(Object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| Boolean | true if the specified object is equal to the current object; otherwise, false. |
Overrides
GetHashCode()
Serves as a hash function for a particular type.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 | A hash code for the current object. |
Overrides
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String | A string that represents the current object. |