Table of Contents

Class GatewayHandlerServiceCollectionExtensions

Namespace
NetCord.Hosting.Gateway
Assembly
NetCord.Hosting.dll
public static class GatewayHandlerServiceCollectionExtensions
Inheritance
GatewayHandlerServiceCollectionExtensions
Inherited Members

Methods

AddGatewayHandler(IServiceCollection, GatewayEvent, Delegate)

Adds an IGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayHandler(this IServiceCollection services, GatewayEvent gatewayEvent, Delegate handler)

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayHandler to.

gatewayEvent GatewayEvent

The gateway event.

handler Delegate

The delegate that represents the handler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

AddGatewayHandler<T>(IServiceCollection)

Adds an IGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayHandler<T>(this IServiceCollection services) where T : class, IGatewayHandler

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayHandler to.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IGatewayHandler to add.

AddGatewayHandler<T>(IServiceCollection, GatewayEvent<T>, Delegate)

Adds an IGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayHandler<T>(this IServiceCollection services, GatewayEvent<T> gatewayEvent, Delegate handler)

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayHandler to.

gatewayEvent GatewayEvent<T>

The gateway event.

handler Delegate

The delegate that represents the handler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the event handler argument.

AddGatewayHandler<T>(IServiceCollection, Func<IServiceProvider, T>)

Adds an IGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayHandler<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class, IGatewayHandler

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayHandler to.

implementationFactory Func<IServiceProvider, T>

The factory that creates the IGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IGatewayHandler to add.

AddGatewayHandlers(IServiceCollection, Assembly)

Adds all public IGatewayHandler implementations from the specified assembly to the IServiceCollection.

public static IServiceCollection AddGatewayHandlers(this IServiceCollection services, Assembly assembly)

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayHandler implementations to.

assembly Assembly

The assembly to scan for IGatewayHandler implementations.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

AddShardedGatewayHandler(IServiceCollection, GatewayEvent, Delegate)

Adds an IShardedGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddShardedGatewayHandler(this IServiceCollection services, GatewayEvent gatewayEvent, Delegate handler)

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayHandler to.

gatewayEvent GatewayEvent

The gateway event.

handler Delegate

The delegate that represents the handler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

AddShardedGatewayHandler<T>(IServiceCollection)

Adds an IShardedGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddShardedGatewayHandler<T>(this IServiceCollection services) where T : class, IShardedGatewayHandler

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayHandler to.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IShardedGatewayHandler to add.

AddShardedGatewayHandler<T>(IServiceCollection, GatewayEvent<T>, Delegate)

Adds an IShardedGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddShardedGatewayHandler<T>(this IServiceCollection services, GatewayEvent<T> gatewayEvent, Delegate handler)

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayHandler to.

gatewayEvent GatewayEvent<T>

The gateway event.

handler Delegate

The delegate that represents the handler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the event handler argument.

AddShardedGatewayHandler<T>(IServiceCollection, Func<IServiceProvider, T>)

Adds an IShardedGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddShardedGatewayHandler<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class, IShardedGatewayHandler

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayHandler to.

implementationFactory Func<IServiceProvider, T>

The factory that creates the IShardedGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IShardedGatewayHandler to add.

AddShardedGatewayHandlers(IServiceCollection, Assembly)

Adds all public IShardedGatewayHandler implementations from the specified assembly to the IServiceCollection.

public static IServiceCollection AddShardedGatewayHandlers(this IServiceCollection services, Assembly assembly)

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayHandler implementations to.

assembly Assembly

The assembly to scan for IShardedGatewayHandler implementations.

Returns

IServiceCollection

A reference to this instance after the operation has completed.