本文整理汇总了C#中SecurityId.IsDefault方法的典型用法代码示例。如果您正苦于以下问题:C# SecurityId.IsDefault方法的具体用法?C# SecurityId.IsDefault怎么用?C# SecurityId.IsDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SecurityId
的用法示例。
在下文中一共展示了SecurityId.IsDefault方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSecurityPath
/// <summary>
/// Получить путь к папке с маркет-данными для инструмента.
/// </summary>
/// <param name="securityId">Идентификатор инструмента.</param>
/// <returns>Путь к папке с маркет-данными.</returns>
public string GetSecurityPath(SecurityId securityId)
{
if (securityId.IsDefault())
throw new ArgumentNullException("securityId");
var id = securityId.SecurityCode + "@" + securityId.BoardCode;
var folderName = id.SecurityIdToFolderName();
return UseAlphabeticPath
? IOPath.Combine(Path, id.Substring(0, 1), folderName)
: IOPath.Combine(Path, folderName);
}
示例2: CancelOrders
public void CancelOrders(bool? isStopOrder, string portfolioName, Sides? side, SecurityId securityId, SecurityTypes? securityType)
{
_adapter.AddDebugLog("CancelOrders: stop={0}, portf={1}, side={2}, id={3}", isStopOrder, portfolioName, side, securityId);
var isBuySell = (side == null) ? null : side.Value.ToAlfaDirect();
var account = portfolioName.IsEmpty() ? null : portfolioName.AccountFromPortfolioName();
var pCode = securityId.SecurityCode.IsEmpty() ? null : securityId.SecurityCode;
var treaties = new List<string>();
var treaty = account.IsEmpty() ? null : account.TreatyFromAccount();
if (!treaty.IsEmpty())
treaties.Add(treaty);
else
{
var data = _tableAccounts.GetLocalDbData();
treaties.AddRange(data.Select(row => FieldsAccounts.Treaty.GetStrValue(row.ToColumns())));
}
if (!treaties.Any())
throw new InvalidOperationException(LocalizedStrings.Str2277Params.Put(portfolioName));
string placeCode = null;
if (!securityId.IsDefault())
{
placeCode = _adapter.SecurityClassInfo.GetSecurityClass(securityType, securityId.BoardCode);
if (placeCode == null)
throw new InvalidOperationException(LocalizedStrings.Str2278);
}
foreach (var t in treaties)
_ad.DropOrder(null, isBuySell, t, account, placeCode, pCode, -1);
}
示例3: GetStorageDrive
/// <summary>
/// Создать хранилище для <see cref="IMarketDataStorage"/>.
/// </summary>
/// <param name="securityId">Идентификатор инструмента.</param>
/// <param name="dataType">Тип маркет-данных.</param>
/// <param name="arg">Параметр, ассоциированный с типом <paramref name="dataType"/>. Например, <see cref="CandleMessage.Arg"/>.</param>
/// <param name="format">Тип формата.</param>
/// <returns>Хранилище для <see cref="IMarketDataStorage"/>.</returns>
public override IMarketDataStorageDrive GetStorageDrive(SecurityId securityId, Type dataType, object arg, StorageFormats format)
{
if (securityId.IsDefault())
throw new ArgumentNullException("securityId");
return _drives.SafeAdd(Tuple.Create(securityId, dataType, arg, format),
key => new LocalMarketDataStorageDrive(CreateFileName(dataType, arg), GetSecurityPath(securityId), format, this));
}
示例4: GetSecurityPath
//#pragma warning disable 612
///// <summary>
///// Load settings.
///// </summary>
///// <param name="storage">Settings storage.</param>
//public override void Load(SettingsStorage storage)
//{
// base.Load(storage);
// UseAlphabeticPath = storage.GetValue<bool>(nameof(UseAlphabeticPath));
//}
///// <summary>
///// Save settings.
///// </summary>
///// <param name="storage">Settings storage.</param>
//public override void Save(SettingsStorage storage)
//{
// base.Save(storage);
// storage.SetValue(nameof(UseAlphabeticPath), UseAlphabeticPath);
//}
/// <summary>
/// To get the path to the folder with market data for the instrument.
/// </summary>
/// <param name="securityId">Security ID.</param>
/// <returns>The path to the folder with market data.</returns>
public string GetSecurityPath(SecurityId securityId)
{
if (securityId.IsDefault())
throw new ArgumentNullException(nameof(securityId));
var id = securityId.ToStringId();
var folderName = id.SecurityIdToFolderName();
return //UseAlphabeticPath
IOPath.Combine(Path, id.Substring(0, 1), folderName);
//: IOPath.Combine(Path, folderName);
}