Table of Contents

Class KMarkdownElementBuilder

Namespace
Kook
Assembly
Kook.Net.Core.dll

An element builder to build a KMarkdownElement.

public class KMarkdownElementBuilder : IElementBuilder, IEquatable<KMarkdownElementBuilder>, IEquatable<IElementBuilder>
Inheritance
KMarkdownElementBuilder
Implements
Inherited Members

Constructors

KMarkdownElementBuilder()

Initializes a new instance of the KMarkdownElementBuilder class.

public KMarkdownElementBuilder()

KMarkdownElementBuilder(string?)

Initializes a new instance of the KMarkdownElementBuilder class.

public KMarkdownElementBuilder(string? content)

Parameters

content string

Fields

MaxKMarkdownLength

Gets the maximum KMarkdown length allowed by Kook.

public const int MaxKMarkdownLength = 5000

Field Value

int

Properties

Content

Gets or sets the content of a KMarkdownElementBuilder.

public string? Content { get; set; }

Property Value

string

The content of the KMarkdownElementBuilder.

Type

Gets the type of the element that this builder builds.

public ElementType Type { get; }

Property Value

ElementType

An ElementType that represents the type of element that this builder builds.

Methods

Build()

public KMarkdownElement Build()

Returns

KMarkdownElement

A KMarkdownElement represents the built element object.

Exceptions

ArgumentNullException

The Content is null.

ArgumentException

The length of Content is greater than MaxKMarkdownLength.

Equals(KMarkdownElementBuilder?)

Determines whether the specified KMarkdownElementBuilder is equal to the current KMarkdownElementBuilder.

public bool Equals(KMarkdownElementBuilder? kMarkdownElementBuilder)

Parameters

kMarkdownElementBuilder KMarkdownElementBuilder

The KMarkdownElementBuilder to compare with the current KMarkdownElementBuilder.

Returns

bool

true if the specified KMarkdownElementBuilder is equal to the current KMarkdownElementBuilder; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current KMarkdownElementBuilder.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current KMarkdownElementBuilder.

Returns

bool

true if the specified object is equal to the current KMarkdownElementBuilder; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

WithContent(string)

Sets the content of a KMarkdownElementBuilder.

public KMarkdownElementBuilder WithContent(string content)

Parameters

content string

The text to be set as the content.

Returns

KMarkdownElementBuilder

The current builder.

Operators

operator ==(KMarkdownElementBuilder?, KMarkdownElementBuilder?)

Determines whether the specified KMarkdownElementBuilder is equal to the current KMarkdownElementBuilder.

public static bool operator ==(KMarkdownElementBuilder? left, KMarkdownElementBuilder? right)

Parameters

left KMarkdownElementBuilder
right KMarkdownElementBuilder

Returns

bool

true if the specified KMarkdownElementBuilder is equal to the current KMarkdownElementBuilder; otherwise, false.

implicit operator KMarkdownElementBuilder(string)

Initialized a new instance of the KMarkdownElementBuilder class with the specified content.

public static implicit operator KMarkdownElementBuilder(string content)

Parameters

content string

The content of the KMarkdownElement.

Returns

KMarkdownElementBuilder

A KMarkdownElementBuilder object that is initialized with the specified content.

operator !=(KMarkdownElementBuilder?, KMarkdownElementBuilder?)

Determines whether the specified KMarkdownElementBuilder is not equal to the current KMarkdownElementBuilder.

public static bool operator !=(KMarkdownElementBuilder? left, KMarkdownElementBuilder? right)

Parameters

left KMarkdownElementBuilder
right KMarkdownElementBuilder

Returns

bool

true if the specified KMarkdownElementBuilder is not equal to the current KMarkdownElementBuilder; otherwise, false.