public SettingsForm(CompleteSettings completeSettings) { InitializeComponent(); InitCurrencyDisplayTypeRadioMap(); InitializeSettings(completeSettings); }
private void SaveLayoutSettings(CompleteSettings completeSettings) { completeSettings.Layout = new LayoutSettings { GridHoldingsColumns = new List <HoldingsDataGridViewColumnSettings>(), GridMarketColumns = new List <MarketDataGridViewColumnSettings>(), GridContainerSplitterPosition = _cntnrGridData.SplitterDistance, Height = Size.Height, LocationX = Location.X, LocationY = Location.Y, Width = Size.Width, WindowState = WindowState }; foreach (var column in _holdingsDataGridViewColumns) { var settings = new HoldingsDataGridViewColumnSettings { FillWeight = column.FillWeight, Tag = (HoldingsDataColumnType)column.Tag, Width = column.Width }; completeSettings.Layout.GridHoldingsColumns.Add(settings); } foreach (var column in _marketDataGridViewColumns) { var settings = new MarketDataGridViewColumnSettings { FillWeight = column.FillWeight, Tag = (MarketDataColumnType)column.Tag, Width = column.Width }; completeSettings.Layout.GridMarketColumns.Add(settings); } }
private void InitializeSettings(CompleteSettings completeSettings) { //Refresh Interval RefreshInterval = completeSettings.Monitoring.RefreshInterval; _txtRefreshInterval.Text = completeSettings.Monitoring.RefreshInterval.ToString(); //Currency Display _currencyDisplayTypeRadioMap[completeSettings.Monitoring.CurrencyDisplayType].Checked = true; }
public static CompleteSettingsModel ToModel(this CompleteSettings instance) { if (instance.IsNull()) { return(null); } return(new CompleteSettingsModel(instance.Settings.Select(x => x.ToModel()))); }
private void SaveCompleteSettings() { var completeSettings = new CompleteSettings(); SaveLayoutSettings(completeSettings); SaveMonitoringSettings(completeSettings); _settingsManager.SaveCompleteSettings(completeSettings); }
private void SaveMonitoringSettings(CompleteSettings completeSettings) { completeSettings.Monitoring = new MonitoringSettings { CurrencyDisplayType = _completeSettings.Monitoring.CurrencyDisplayType, Holdings = _holdingsDataGridViewRows.Select(r => new HoldingsDataGridViewCellSettings { RowTag = (int)r.Tag, Value = r.Cells[_clmnHoldingsQuantity.Index].Value.ToString() }).ToList(), MarketCurrencyTypes = _marketDataGridViewRows.Select(r => (int)r.Tag).ToList(), RefreshInterval = _prgrssGlobalRefresh.Maximum }; }