本文整理汇总了C#中SettingsStorage.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# SettingsStorage.ContainsKey方法的具体用法?C# SettingsStorage.ContainsKey怎么用?C# SettingsStorage.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SettingsStorage
的用法示例。
在下文中一共展示了SettingsStorage.ContainsKey方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Load
public override void Load(SettingsStorage storage)
{
_isLoading = true;
try
{
((IPersistable)MarketDataGrid).Load(storage.GetValue<SettingsStorage>("MarketDataGrid") ?? storage.GetValue<SettingsStorage>("Grid"));
var selectedSettings = storage.GetValue("SelectedSettings", Guid.Empty);
var settings = ConfigManager.GetService<MarketDataSettingsCache>().Settings;
if (selectedSettings != Guid.Empty)
SelectedSettings = settings.FirstOrDefault(s => s.Id == selectedSettings)
?? settings.FirstOrDefault(s => s.Id != Guid.Empty);
if (storage.ContainsKey("Security"))
SecurityPicker.SelectedSecurity = ConfigManager.GetService<IEntityRegistry>().Securities.ReadById(storage.GetValue<string>("Security"));
FormatCtrl.SelectedFormat = storage.GetValue<StorageFormats>("SelectedFormat");
}
finally
{
_isLoading = false;
}
RefreshGrid();
}
示例2: Load
public void Load(SettingsStorage storage)
{
Path = storage.GetValue<string>("Path");
ColumnSeparator = storage.GetValue<string>("ColumnSeparator");
//RowSeparator = storage.GetValue<string>("RowSeparator");
SkipFromHeader = storage.GetValue<int>("SkipFromHeader");
//SkipFromFooter = storage.GetValue<int>("SkipFromFooter");
Format = storage.GetValue<StorageFormats>("Format");
if (storage.ContainsKey("Drive"))
Drive = DriveCache.Instance.GetDrive(storage.GetValue<string>("Drive"));
TimeZone = TimeZoneInfo.FindSystemTimeZoneById(storage.GetValue<string>("TimeZone"));
CandleSettings = storage.GetValue("CandleSettings", CandleSettings);
}
示例3: Load
/// <summary>
/// Load settings.
/// </summary>
/// <param name="storage">Settings storage.</param>
public void Load(SettingsStorage storage)
{
if (storage.ContainsKey("WorkingTime"))
WorkingTime.Load(storage.GetValue<SettingsStorage>("WorkingTime"));
Interval = storage.GetValue<TimeSpan>("Interval");
AttemptCount = storage.GetValue<int>("AttemptCount");
ReAttemptCount = storage.GetValue<int>("ReAttemptCount");
TimeOutInterval = storage.GetValue<TimeSpan>("TimeOutInterval");
}
示例4: Load
public virtual void Load(SettingsStorage storage)
{
if (storage.ContainsKey("SelectedSecurity"))
SelectedSecurity = ConfigManager.GetService<IEntityRegistry>().Securities.ReadById(storage.GetValue<string>("SelectedSecurity"));
From = storage.GetValue<DateTime?>("From");
To = storage.GetValue<DateTime?>("To");
if (storage.ContainsKey("Drive"))
Drive = DriveCache.Instance.GetDrive(storage.GetValue<string>("Drive"));
StorageFormat = storage.GetValue<StorageFormats>("StorageFormat");
}
示例5:
void IPersistable.Load(SettingsStorage storage)
{
if (storage.ContainsKey("Drive"))
DrivePanel.SelectedDrive = DriveCache.Instance.GetDrive(storage.GetValue<string>("Drive"));
DrivePanel.StorageFormat = storage.GetValue<StorageFormats>("StorageFormat");
MarketData.Load(storage.GetValue<SettingsStorage>("MarketData"));
SecurityPicker.Load(storage.GetValue<SettingsStorage>("SecurityPicker"));
DataTypeComboBox.SelectedIndex = storage.GetValue<int>("DataTypeComboBox");
}
示例6: Load
public override void Load(SettingsStorage storage)
{
if (storage.ContainsKey("UnderlyingAsset"))
UnderlyingAsset.SelectedSecurity = ConfigManager.GetService<IEntityRegistry>().Securities.ReadById(storage.GetValue<string>("UnderlyingAsset"));
Desk.Load(storage.GetValue<SettingsStorage>("Desk"));
if (storage.ContainsKey("ExpiryDate"))
ExpiryDate.Value = storage.GetValue<DateTime>("ExpiryDate");
MinStrike.Value = storage.GetValue<decimal?>("MinStrike");
MaxStrike.Value = storage.GetValue<decimal?>("MaxStrike");
UseBlackMode.IsChecked = Desk.UseBlackModel;
if (storage.ContainsKey("CurrentDate"))
CurrentDate.Value = storage.GetValue<DateTime>("CurrentDate");
AssetPrice.Value = storage.GetValue<decimal?>("AssetPrice");
}
示例7: Load
public override void Load(SettingsStorage storage)
{
if (storage.ContainsKey("UnderlyingAsset"))
UnderlyingAsset.SelectedSecurity = ConfigManager.GetService<IEntityRegistry>().Securities.ReadById(storage.GetValue<string>("UnderlyingAsset"));
if (storage.ContainsKey("CurrentDate"))
CurrentDate.Value = storage.GetValue<DateTime>("CurrentDate");
AssetPrice.Value = storage.GetValue<decimal?>("AssetPrice");
}
示例8: Load
public override void Load(SettingsStorage storage)
{
base.Load(storage);
DepthGrid.Load(storage.GetValue<SettingsStorage>("DepthGrid"));
Depth.SelectedIndex = storage.GetValue<int>("Depth");
if (storage.ContainsKey("DepthGenerationInterval"))
DepthGenerationInterval.Value = storage.GetValue<int>("DepthGenerationInterval");
BuildFrom.SelectedIndex = storage.GetValue<int>("BuildFrom");
}
示例9: Load
public override void Load(SettingsStorage storage)
{
_isLoading = true;
try
{
((IPersistable)Grid).Load(storage.GetValue<SettingsStorage>("Grid"));
if (storage.ContainsKey("Security"))
SecurityPicker.SelectedSecurity = ConfigManager.GetService<IEntityRegistry>().Securities.ReadById(storage.GetValue<string>("Security"));
FormatCtrl.SelectedFormat = storage.GetValue<StorageFormats>("SelectedFormat");
}
finally
{
_isLoading = false;
}
RefreshGrid();
}
示例10: Load
/// <summary>
/// Load settings.
/// </summary>
/// <param name="storage">Settings storage.</param>
public void Load(SettingsStorage storage)
{
if (storage.ContainsKey(nameof(WorkingTime)))
WorkingTime.Load(storage.GetValue<SettingsStorage>(nameof(WorkingTime)));
Interval = storage.GetValue<TimeSpan>(nameof(Interval));
AttemptCount = storage.GetValue<int>(nameof(AttemptCount));
ReAttemptCount = storage.GetValue<int>(nameof(ReAttemptCount));
TimeOutInterval = storage.GetValue<TimeSpan>(nameof(TimeOutInterval));
}
示例11: Load
public override void Load(SettingsStorage storage)
{
base.Load(storage);
if (storage.ContainsKey("SelectedLevel1Fields"))
{
Level1FieldsCtrl.SelectedFields = storage
.GetValue<string>("SelectedLevel1Fields")
.Split(",")
.Select(s => s.To<Level1Fields>())
.ToArray();
}
FindedChanges.Load(storage.GetValue<SettingsStorage>("FindedChanges"));
}
示例12: Load
public void Load(SettingsStorage storage)
{
if (storage.ContainsKey(nameof(Security)))
Security = ConfigManager.GetService<IEntityRegistry>().Securities.ReadById(storage.GetValue<string>("Security"));
From = storage.GetValue<DateTime>(nameof(From));
To = storage.GetValue<DateTime>(nameof(To));
if (storage.ContainsKey(nameof(Drive)))
Drive = DriveCache.Instance.GetDrive(storage.GetValue<string>(nameof(Drive)));
StorageFormat = storage.GetValue<StorageFormats>(nameof(StorageFormat));
}
示例13: Load
public override void Load(SettingsStorage storage)
{
base.Load(storage);
DepthGrid.Load(storage.GetValue<SettingsStorage>("DepthGrid"));
Depth.SelectedIndex = storage.GetValue<int>("Depth");
if (storage.ContainsKey("DepthGenerationInterval"))
DepthGenerationInterval.Value = storage.GetValue<int>("DepthGenerationInterval");
if (storage.ContainsKey("IsBuildFromOrderLog"))
IsBuildFromOrderLog.IsChecked = storage.GetValue<bool>("IsBuildFromOrderLog");
}
示例14: Load
public override void Load(SettingsStorage storage)
{
base.Load(storage);
if (storage.ContainsKey("SelectedLevel1Fields"))
{
Level1FieldsCtrl.SelectedFields = storage
.GetValue<string>("SelectedLevel1Fields")
.Split(",")
.Select(s => s.To<Level1Fields>())
.ToArray();
}
FindedChanges.Load(storage.GetValue<SettingsStorage>("FindedChanges"));
var selectedFields = Level1FieldsCtrl.SelectedFields.ToArray();
foreach (var pair in _columns)
{
pair.Value.Visibility = selectedFields.Contains(pair.Key) ? Visibility.Visible : Visibility.Collapsed;
}
}
示例15:
void IPersistable.Load(SettingsStorage storage)
{
if (storage.ContainsKey("LogMonitor"))
MonitorControl.Load(storage.GetValue<SettingsStorage>("LogMonitor"));
}