Table of Contents

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

long

DefaultClientSocial

public static ClientSocial DefaultClientSocial { get; set; }

Property Value

ClientSocial

ProductId

Current product id.

public static long ProductId { get; }

Property Value

long

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

pictureId long

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

transactionIdGenerator IdGenerator

Transaction id generator.

login string

Login.

password SecureString

Password.

Returns

IEnumerable<IMessageAdapter>

Adapters for StockSharp server connections.

GetCurrency(ProductDomain)

public static CurrencyTypes GetCurrency(this ProductDomain domain)

Parameters

domain ProductDomain

Returns

CurrencyTypes

GetCurrentDomain(Product)

Get product domain info.

public static ProductDomain GetCurrentDomain(this Product product)

Parameters

product Product

Product.

Returns

ProductDomain

Product domain info.

GetCurrentDomain(ProductGroup)

Get product group domain info.

public static ProductGroupDomain GetCurrentDomain(this ProductGroup group)

Parameters

group ProductGroup

Product group.

Returns

ProductGroupDomain

Product group domain info.

GetName(Product)

Get product's name.

public static string GetName(this Product product)

Parameters

product Product

Product.

Returns

string

Name.

GetName(ProductGroup)

Get group's name.

public static string GetName(this ProductGroup group)

Parameters

group ProductGroup

Product group.

Returns

string

Name.

GetSystemInfo()

public static string GetSystemInfo()

Returns

string

GetUrlAbsolute(Product)

public static string GetUrlAbsolute(this Product product)

Parameters

product Product

Returns

string

GetUrlRelative(Product)

public static string GetUrlRelative(this Product product)

Parameters

product Product

Returns

string

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

adapter IMessageAdapter

Adapter.

address string

Address.

name string

Server name.

login string

Login.

password SecureString

Password.

Returns

IMessageAdapter

Adapter.

InitServices(Func<IWebSocketService, CancellationToken, ValueTask>, CancellationToken)

public static Task InitServices(Func<IWebSocketService, CancellationToken, ValueTask> socketConnected, CancellationToken token)

Parameters

socketConnected Func<IWebSocketService, CancellationToken, ValueTask>
token CancellationToken

Returns

Task

IsAvailable(Product)

public static bool IsAvailable(this Product product)

Parameters

product Product

Returns

bool

PrepareLogsFile(TimeSpan, Action<Exception>)

public static string PrepareLogsFile(this TimeSpan duration, Action<Exception> errorHandler)

Parameters

duration TimeSpan
errorHandler Action<Exception>

Returns

string

RefreshAsync(IClientSocialService, CancellationToken)

public static Task RefreshAsync(this IClientSocialService svc, CancellationToken cancellationToken = default)

Parameters

svc IClientSocialService
cancellationToken CancellationToken

Returns

Task

RegisterWebApiServices(Type, bool?)

public static void RegisterWebApiServices(this Type owner, bool? onlineMode = null)

Parameters

owner Type
onlineMode bool?

ToContentType(string)

Convert file extension to StockSharp.Web.DomainModel.ProductContentTypes2.

public static ProductContentTypes2 ToContentType(this string extension)

Parameters

extension string

File extension.

Returns

ProductContentTypes2

StockSharp.Web.DomainModel.ProductContentTypes2

ToExtension(ProductContentTypes2)

Convert StockSharp.Web.DomainModel.ProductContentTypes2 to file extension.

public static string ToExtension(this ProductContentTypes2 contentType)

Parameters

contentType ProductContentTypes2

Returns

string

File extension.

TrySendBugReport(LogMessage)

public static ProductBugReport TrySendBugReport(this LogMessage log)

Parameters

log LogMessage

Returns

ProductBugReport

Events

ProfileChanged

Profile changed event.

public static event Action ProfileChanged

Event Type

Action