Table of Contents

Class GatewayEventHandlerServiceCollectionExtensions

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

Methods

AddGatewayEventHandler(IServiceCollection, string, Delegate)

Adds an IGatewayEventHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayEventHandler(this IServiceCollection services, string name, Delegate handler)

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayEventHandler to.

name string

The name of the event handler.

handler Delegate

The delegate that represents the handler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

AddGatewayEventHandler<T>(IServiceCollection)

Adds an IGatewayEventHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayEventHandler<T>(this IServiceCollection services) where T : class, IGatewayEventHandlerBase

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayEventHandler to.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IGatewayEventHandler to add.

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

Adds an IGatewayEventHandler to the specified IServiceCollection.

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

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayEventHandler to.

implementationFactory Func<IServiceProvider, T>

The factory that creates the IGatewayEventHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IGatewayEventHandler to add.

AddGatewayEventHandler<T>(IServiceCollection, string, Delegate)

Adds an IGatewayEventHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayEventHandler<T>(this IServiceCollection services, string name, Delegate handler)

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayEventHandler to.

name string

The name of the event handler.

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.

AddGatewayEventHandlers(IServiceCollection, Assembly)

Adds all IGatewayEventHandler implementations from the specified assembly to the IServiceCollection.

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

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayEventHandler implementations to.

assembly Assembly

The assembly to scan for IGatewayEventHandler implementations.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

AddShardedGatewayEventHandler(IServiceCollection, string, Delegate)

public static IServiceCollection AddShardedGatewayEventHandler(this IServiceCollection services, string name, Delegate handler)

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayEventHandler to.

name string

The name of the event handler.

handler Delegate

The delegate that represents the handler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

AddShardedGatewayEventHandler<T>(IServiceCollection)

public static IServiceCollection AddShardedGatewayEventHandler<T>(this IServiceCollection services) where T : class, IShardedGatewayEventHandlerBase

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayEventHandler to.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IShardedGatewayEventHandler to add.

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

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

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayEventHandler to.

implementationFactory Func<IServiceProvider, T>

The factory that creates the IShardedGatewayEventHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IShardedGatewayEventHandler to add.

AddShardedGatewayEventHandler<T>(IServiceCollection, string, Delegate)

public static IServiceCollection AddShardedGatewayEventHandler<T>(this IServiceCollection services, string name, Delegate handler)

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayEventHandler to.

name string

The name of the event handler.

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.

AddShardedGatewayEventHandlers(IServiceCollection, Assembly)

Adds all IShardedGatewayEventHandler implementations from the specified assembly to the IServiceCollection.

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

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayEventHandler implementations to.

assembly Assembly

The assembly to scan for IShardedGatewayEventHandler implementations.

Returns

IServiceCollection

A reference to this instance after the operation has completed.