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
dirstringThe directory path to scan for adapter assemblies (.dll files).
errorHandlerAction<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
assemblyAssemblyAssembly 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
typeTypeType to check.
Returns
RegisterChannels(IEnumerable<ITelegramChannel>)
Register collection of Telegram channels for subsequent access through configuration container.
public static void RegisterChannels(this IEnumerable<ITelegramChannel> channels)
Parameters
channelsIEnumerable<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
channelIdlongChannel 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?