Table of Contents

Struct Fragment

Namespace
Dassie.Text
Assembly
dstx.dll

Represents a fragment of text in an editor. Used for context-specific syntax highlighting.

[Serializable]
public struct Fragment : IEquatable<Fragment>
Implements
Inherited Members
Extension Methods

Constructors

Fragment(int, int, int, Color, bool, NavigationKind)

Creates a new instance of the Fragment structure.

public Fragment(int line, int column, int length, Color color, bool navigable = false, Fragment.NavigationKind navigationKind = NavigationKind.Default)

Parameters

line int

The line which contains the first character of the fragment.

column int

The column that is the first character of the fragment.

length int

The length of the fragment.

color Color

The color of the fragment.

navigable bool

Specifies wheter the fragment can be reached by a navigation command.

navigationKind Fragment.NavigationKind

Specifies the type of navigation target.

Properties

Color

The color of the fragment.

public Color Color { readonly get; set; }

Property Value

Color

Column

The column that is the first character of the fragment.

public int Column { readonly get; set; }

Property Value

int

IsNavigationTarget

Specifies wheter the fragment can be reached by a navigation command. Supports the "Go to definition" feature of many editors.

public bool IsNavigationTarget { readonly get; set; }

Property Value

bool

Length

The length of the fragment.

public int Length { readonly get; set; }

Property Value

int

Line

The line which contains the first character of the fragment.

public int Line { readonly get; set; }

Property Value

int

NavigationTargetKind

For navigation targets that could have different roles based on their fragment color, specifies the kind of navigation target.

public Fragment.NavigationKind NavigationTargetKind { readonly get; set; }

Property Value

Fragment.NavigationKind

SpecialColor

If the desired color is not contained in the Color enumeration, this property is used to set a specific color.

public string SpecialColor { readonly get; set; }

Property Value

string

ToolTip

A tooltip corresponding to the fragment.

public Tooltip ToolTip { readonly get; set; }

Property Value

Tooltip

Methods

Equals(Fragment)

Indicates whether the current object is equal to another object of the same type.

public readonly bool Equals(Fragment other)

Parameters

other Fragment

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether the current object is equal to another object of the same type.

public override readonly bool Equals(object obj)

Parameters

obj object

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override readonly int GetHashCode()

Returns

int

A hash representing the current object.

Operators

operator ==(Fragment, Fragment)

Compares two instances of Fragment.

public static bool operator ==(Fragment a, Fragment b)

Parameters

a Fragment

The first instance to compare.

b Fragment

The second instance to compare.

Returns

bool

true if a is equal to b; otherwise, false.

operator !=(Fragment, Fragment)

Compares two instances of Fragment.

public static bool operator !=(Fragment a, Fragment b)

Parameters

a Fragment

The first instance to compare.

b Fragment

The second instance to compare.

Returns

bool

true if a is not equal to b; otherwise, false.