Table of Contents

Class ContainerModuleBuilder

Namespace
Kook
Assembly
Kook.Net.Core.dll

Represents a container module builder for creating a ContainerModule.

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

Constructors

ContainerModuleBuilder()

Initializes a new instance of the ContainerModuleBuilder class.

public ContainerModuleBuilder()

ContainerModuleBuilder(IList<ImageElementBuilder>)

Initializes a new instance of the ContainerModuleBuilder class.

public ContainerModuleBuilder(IList<ImageElementBuilder> elements)

Parameters

elements IList<ImageElementBuilder>

Fields

MaxElementCount

Returns the maximum number of elements allowed by Kook.

public const int MaxElementCount = 9

Field Value

int

Properties

Elements

Gets or sets the image elements in the container module.

public IList<ImageElementBuilder> Elements { get; set; }

Property Value

IList<ImageElementBuilder>

An IList<T> containing the image elements in this image container module.

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

AddElement(ImageElementBuilder)

Adds an image element to the container module.

public ContainerModuleBuilder AddElement(ImageElementBuilder field)

Parameters

field ImageElementBuilder

The image element to add.

Returns

ContainerModuleBuilder

The current builder.

AddElement(Action<ImageElementBuilder>?)

Adds an image element to the container module.

public ContainerModuleBuilder AddElement(Action<ImageElementBuilder>? action = null)

Parameters

action Action<ImageElementBuilder>

The action to add an image element to the container module.

Returns

ContainerModuleBuilder

The current builder.

Build()

Builds this builder into a ContainerModule.

public ContainerModule Build()

Returns

ContainerModule

A ContainerModule representing the built container module object.

Exceptions

ArgumentNullException

Elements cannot be null.

ArgumentException

Elements cannot be an empty list.

ArgumentException

Elements count must be less than or equal to MaxElementCount.

Equals(ContainerModuleBuilder?)

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

public bool Equals(ContainerModuleBuilder? containerModuleBuilder)

Parameters

containerModuleBuilder ContainerModuleBuilder

The ContainerModuleBuilder to compare with the current ContainerModuleBuilder.

Returns

bool

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

Equals(object?)

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

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current ContainerModuleBuilder.

Returns

bool

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

Remarks

If the object passes is an ContainerModuleBuilder, Equals(ContainerModuleBuilder?) 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.

Operators

operator ==(ContainerModuleBuilder?, ContainerModuleBuilder?)

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

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

Parameters

left ContainerModuleBuilder
right ContainerModuleBuilder

Returns

bool

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

operator !=(ContainerModuleBuilder?, ContainerModuleBuilder?)

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

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

Parameters

left ContainerModuleBuilder
right ContainerModuleBuilder

Returns

bool

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