Class ColorString
Implements a color string replacemnt class using ANSI formatting escape codes
Inheritance
Inherited Members
Namespace: Dotnet.Shell.UI
Assembly: dotnet-shell-lib.dll
Syntax
public class ColorString
Constructors
| Improve this Doc View SourceColorString(String, Color)
Initializes a new instance of the ColorString class.
Declaration
public ColorString(string s, Color c)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | s | The s. |
| System.Drawing.Color | c | The c. |
ColorString(String, Color, Color)
Initializes a new instance of the ColorString class.
Declaration
public ColorString(string s, Color c, Color d)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | s | The s. |
| System.Drawing.Color | c | The c. |
| System.Drawing.Color | d | The d. |
Properties
| Improve this Doc View SourceItem[Int32]
Gets the System.Char with the specified i.
Declaration
public char this[int i] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | i | The i. |
Property Value
| Type | Description |
|---|---|
| System.Char | The System.Char. |
Length
Gets the length.
Declaration
public int Length { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The length. |
Text
Gets the string representation but without formatting characters
Declaration
public string Text { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
TextWithFormattingCharacters
Gets the string representation but WITH formatting characters
Declaration
public string TextWithFormattingCharacters { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
| Improve this Doc View SourceEquals(Object)
Determines whether the specified System.Object, is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | The System.Object to compare with this instance. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Overrides
FromRawANSI(String)
Convert to a color string from an ANSI string with escape sequences
Declaration
public static ColorString FromRawANSI(string ansi)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | ansi |
Returns
| Type | Description |
|---|---|
| ColorString |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
ToString()
Converts to string.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A System.String that represents this instance. |
Overrides
Operators
| Improve this Doc View SourceAddition(ColorString, ColorString)
Implements the operator +.
Declaration
public static ColorString operator +(ColorString a, ColorString b)
Parameters
| Type | Name | Description |
|---|---|---|
| ColorString | a | a. |
| ColorString | b | The b. |
Returns
| Type | Description |
|---|---|
| ColorString | The result of the operator. |
Implicit(String to ColorString)
Performs an implicit conversion from System.String to ColorString.
Declaration
public static implicit operator ColorString(string t)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | t | The t. |
Returns
| Type | Description |
|---|---|
| ColorString | The result of the conversion. |