Extensions

StockSharp.Configuration

Extension class.

Methods

FindAdapters
public static IEnumerable<Type> FindAdapters(string dir, Action<Exception> errorHandler)
result = Extensions.FindAdapters(dir, errorHandler)

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.

dir
The directory path to scan for adapter assemblies (.dll files).
errorHandler
An action to handle exceptions that occur during assembly loading.

Returns: An enumeration of adapter Types found in the directory.

GetAdapters
public static IEnumerable<Type> GetAdapters(Assembly assembly)
result = Extensions.GetAdapters(assembly)

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

assembly
Assembly to scan.

Returns: An enumeration of adapter Types found in the assembly.

HasValidAdapterConstructor
public static bool HasValidAdapterConstructor(Type type)
result = Extensions.HasValidAdapterConstructor(type)

Checks if the type has a public constructor accepting IdGenerator.

type
Type to check.

Returns: if the type has a valid adapter constructor.

RegisterChannels
public static void RegisterChannels(IEnumerable<ITelegramChannel> channels)
Extensions.RegisterChannels(channels)

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

channels
Collection of channels to register.
TryFindChannel
public static ITelegramChannel TryFindChannel(long channelId)
result = Extensions.TryFindChannel(channelId)

Try to find the channel by the specified identifier.

channelId
Channel id.

Returns: Found channel or if channel not found.

TryGetChannels
public static IEnumerable<ITelegramChannel> TryGetChannels()
result = Extensions.TryGetChannels()

Try to get registered Telegram channels.

Returns: Collection of channels or if service is not registered.

TryGetProductId
public static long? TryGetProductId()
result = Extensions.TryGetProductId()