Table of Contents

Class Extensions

Namespace
StockSharp.Configuration
Assembly
StockSharp.Configuration.dll

Extension class.

public static class Extensions
Inheritance
Extensions
Inherited Members

Methods

FindAdapters(string, Action<Exception>)

Finds and returns adapter types in the specified directory. Scans for assemblies starting with "StockSharp." (except a known exclusion list), loads them, and collects types implementing IMessageAdapter (excluding dialects) that have a public constructor accepting IdGenerator.

public static IEnumerable<Type> FindAdapters(this string dir, Action<Exception> errorHandler)

Parameters

dir string

The directory path to scan for adapter assemblies (.dll files).

errorHandler Action<Exception>

An action to handle exceptions that occur during assembly loading.

Returns

IEnumerable<Type>

An enumeration of adapter Types found in the directory.

GetAdapters(Assembly)

Gets adapter types from the specified assembly. Filters types implementing IMessageAdapter (excluding dialects) that have a public constructor accepting IdGenerator.

public static IEnumerable<Type> GetAdapters(this Assembly assembly)

Parameters

assembly Assembly

Assembly to scan.

Returns

IEnumerable<Type>

An enumeration of adapter Types found in the assembly.

HasValidAdapterConstructor(Type)

Checks if the type has a public constructor accepting IdGenerator.

public static bool HasValidAdapterConstructor(this Type type)

Parameters

type Type

Type to check.

Returns

bool

true if the type has a valid adapter constructor.

RegisterChannels(IEnumerable<ITelegramChannel>)

Register collection of Telegram channels for subsequent access through configuration container.

public static void RegisterChannels(this IEnumerable<ITelegramChannel> channels)

Parameters

channels IEnumerable<ITelegramChannel>

Collection of channels to register.

TryFindChannel(long)

Try to find the channel by the specified identifier.

public static ITelegramChannel TryFindChannel(this long channelId)

Parameters

channelId long

Channel id.

Returns

ITelegramChannel

Found channel or null if channel not found.

TryGetChannels()

Try to get registered Telegram channels.

public static IEnumerable<ITelegramChannel> TryGetChannels()

Returns

IEnumerable<ITelegramChannel>

Collection of channels or null if service is not registered.

TryGetProductId()

public static long? TryGetProductId()

Returns

long?