Generated by DocFX

Class ColorString

Implements a color string replacemnt class using ANSI formatting escape codes

Inheritance
System.Object
ColorString
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Dotnet.Shell.UI
Assembly: dotnet-shell-lib.dll
Syntax
public class ColorString

Constructors

| Improve this Doc View Source

ColorString(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.

| Improve this Doc View Source

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 Source

Item[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.

| Improve this Doc View Source

Length

Gets the length.

Declaration
public int Length { get; }
Property Value
Type Description
System.Int32

The length.

| Improve this Doc View Source

Text

Gets the string representation but without formatting characters

Declaration
public string Text { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

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 Source

Equals(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

true if the specified System.Object is equal to this instance; otherwise, false.

Overrides
System.Object.Equals(System.Object)
| Improve this Doc View Source

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
| Improve this Doc View Source

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
System.Object.GetHashCode()
| Improve this Doc View Source

ToString()

Converts to string.

Declaration
public override string ToString()
Returns
Type Description
System.String

A System.String that represents this instance.

Overrides
System.Object.ToString()

Operators

| Improve this Doc View Source

Addition(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.

| Improve this Doc View Source

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.