Class WebApiHelper
- Namespace
- StockSharp.Studio.WebApi
- Assembly
- StockSharp.Studio.WebApi.dll
public static class WebApiHelper
- Inheritance
-
WebApiHelper
- Inherited Members
Properties
ClientSocialsSource
StockSharp.Web.DomainModel.ClientSocial items source.
public static IList<ClientSocial> ClientSocialsSource { get; }
Property Value
- IList<ClientSocial>
CurrentDomain
Current domain id.
public static long CurrentDomain { get; }
Property Value
DefaultClientSocial
public static ClientSocial DefaultClientSocial { get; set; }
Property Value
- ClientSocial
ProductId
Current product id.
public static long ProductId { get; }
Property Value
Profile
Profile.
public static Client Profile { get; set; }
Property Value
- Client
TryClientSocialsSource
StockSharp.Web.DomainModel.ClientSocial items source.
public static IList<ClientSocial> TryClientSocialsSource { get; }
Property Value
- IList<ClientSocial>
Methods
CreateApp(long)
public static Func<App> CreateApp(long pictureId)
Parameters
pictureIdlong
Returns
- Func<App>
CreateStockSharpAdapters(IdGenerator, string, SecureString)
Create adapters for StockSharp server connections.
public static IEnumerable<IMessageAdapter> CreateStockSharpAdapters(this IdGenerator transactionIdGenerator, string login, SecureString password)
Parameters
transactionIdGeneratorIdGeneratorTransaction id generator.
loginstringLogin.
passwordSecureStringPassword.
Returns
- IEnumerable<IMessageAdapter>
Adapters for StockSharp server connections.
GetCurrency(ProductDomain)
public static CurrencyTypes GetCurrency(this ProductDomain domain)
Parameters
domainProductDomain
Returns
GetCurrentDomain(Product)
Get product domain info.
public static ProductDomain GetCurrentDomain(this Product product)
Parameters
productProductProduct.
Returns
- ProductDomain
Product domain info.
GetCurrentDomain(ProductGroup)
Get product group domain info.
public static ProductGroupDomain GetCurrentDomain(this ProductGroup group)
Parameters
groupProductGroupProduct group.
Returns
- ProductGroupDomain
Product group domain info.
GetName(Product)
Get product's name.
public static string GetName(this Product product)
Parameters
productProductProduct.
Returns
- string
Name.
GetName(ProductGroup)
Get group's name.
public static string GetName(this ProductGroup group)
Parameters
groupProductGroupProduct group.
Returns
- string
Name.
GetSystemInfo()
public static string GetSystemInfo()
Returns
GetUrlAbsolute(Product)
public static string GetUrlAbsolute(this Product product)
Parameters
productProduct
Returns
GetUrlRelative(Product)
public static string GetUrlRelative(this Product product)
Parameters
productProduct
Returns
InitAdapter(IMessageAdapter, string, string, string, SecureString)
Create community adapter.
public static IMessageAdapter InitAdapter(this IMessageAdapter adapter, string address, string name, string login, SecureString password)
Parameters
adapterIMessageAdapterAdapter.
addressstringAddress.
namestringServer name.
loginstringLogin.
passwordSecureStringPassword.
Returns
- IMessageAdapter
Adapter.
InitServices(Func<IWebSocketService, CancellationToken, ValueTask>, CancellationToken)
public static Task InitServices(Func<IWebSocketService, CancellationToken, ValueTask> socketConnected, CancellationToken token)
Parameters
socketConnectedFunc<IWebSocketService, CancellationToken, ValueTask>tokenCancellationToken
Returns
IsAvailable(Product)
public static bool IsAvailable(this Product product)
Parameters
productProduct
Returns
PrepareLogsFile(TimeSpan, Action<Exception>, CancellationToken)
public static Task<string> PrepareLogsFile(this TimeSpan duration, Action<Exception> errorHandler, CancellationToken cancellationToken)
Parameters
durationTimeSpanerrorHandlerAction<Exception>cancellationTokenCancellationToken
Returns
RefreshAsync(IClientSocialService, CancellationToken)
public static Task RefreshAsync(this IClientSocialService svc, CancellationToken cancellationToken = default)
Parameters
svcIClientSocialServicecancellationTokenCancellationToken
Returns
RegisterWebApiServices(Type, bool?)
public static void RegisterWebApiServices(this Type owner, bool? onlineMode = null)
Parameters
ToContentType(string, out ProductContentTypes2)
Convert file extension to StockSharp.Web.DomainModel.ProductContentTypes2.
public static bool ToContentType(this string extension, out ProductContentTypes2 contentType)
Parameters
extensionstringFile extension.
contentTypeProductContentTypes2StockSharp.Web.DomainModel.ProductContentTypes2
Returns
- bool
Returns true if the extension is recognized and converted to StockSharp.Web.DomainModel.ProductContentTypes2, otherwise false.
TrySendBugReport(LogMessage, CancellationToken)
public static Task<ProductBugReport> TrySendBugReport(this LogMessage log, CancellationToken cancellationToken)
Parameters
logLogMessagecancellationTokenCancellationToken
Returns
- Task<ProductBugReport>
Events
ProfileChanged
Profile changed event.
public static event Action ProfileChanged