Table of Contents

Class AudioModuleBuilder

Namespace
Kook
Assembly
Kook.Net.Core.dll

Represents an audio module builder for creating an AudioModule.

public class AudioModuleBuilder : IModuleBuilder, IEquatable<AudioModuleBuilder>, IEquatable<IModuleBuilder>
Inheritance
AudioModuleBuilder
Implements
Inherited Members

Constructors

AudioModuleBuilder()

Initializes a new instance of the AudioModuleBuilder class.

public AudioModuleBuilder()

AudioModuleBuilder(string, string?, string?)

Initializes a new instance of the AudioModuleBuilder class.

public AudioModuleBuilder(string source, string? cover = null, string? title = null)

Parameters

source string

The source URL of the video.

cover string

The cover URL of the video.

title string

The title of the video.

Properties

Cover

Gets or sets the cover URL of the video.

public string? Cover { get; set; }

Property Value

string

The cover URL of the video.

Source

Gets or sets the source URL of the video.

public string? Source { get; set; }

Property Value

string

The source URL of the video.

Title

Gets or sets the title of the video.

public string? Title { get; set; }

Property Value

string

The title of the video.

Type

Specifies the module type of the IModule this builder creates.

public ModuleType Type { get; }

Property Value

ModuleType

A ModuleType representing the module type of the IModule this builder creates.

Methods

Build()

Builds this builder into an AudioModule.

public AudioModule Build()

Returns

AudioModule

An AudioModule representing the built audio module object.

Exceptions

ArgumentNullException

Source cannot be null

ArgumentException

Source cannot be empty

UriFormatException

Source is not a valid URL

UriFormatException

Cover is not a valid URL

Equals(AudioModuleBuilder?)

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

public bool Equals(AudioModuleBuilder? audioModuleBuilder)

Parameters

audioModuleBuilder AudioModuleBuilder

The AudioModuleBuilder to compare with the current AudioModuleBuilder.

Returns

bool

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

Equals(object?)

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

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current AudioModuleBuilder.

Returns

bool

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

Remarks

If the object passes is an AudioModuleBuilder, Equals(AudioModuleBuilder?) will be called to compare the 2 instances.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

WithCover(string?)

Sets the cover URL of the video.

public AudioModuleBuilder WithCover(string? cover)

Parameters

cover string

The cover URL of the video to be set.

Returns

AudioModuleBuilder

The current builder.

WithSource(string?)

Sets the source URL of the video.

public AudioModuleBuilder WithSource(string? source)

Parameters

source string

The source URL of the video to be set.

Returns

AudioModuleBuilder

The current builder.

WithTitle(string?)

Sets the title of the video.

public AudioModuleBuilder WithTitle(string? title)

Parameters

title string

The title of the video to be set.

Returns

AudioModuleBuilder

The current builder.

Operators

operator ==(AudioModuleBuilder?, AudioModuleBuilder?)

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

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

Parameters

left AudioModuleBuilder
right AudioModuleBuilder

Returns

bool

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

operator !=(AudioModuleBuilder?, AudioModuleBuilder?)

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

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

Parameters

left AudioModuleBuilder
right AudioModuleBuilder

Returns

bool

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