Пример #1
0
        public SettingsForm(CompleteSettings completeSettings)
        {
            InitializeComponent();

            InitCurrencyDisplayTypeRadioMap();
            InitializeSettings(completeSettings);
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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;
        }
Пример #4
0
        public static CompleteSettingsModel ToModel(this CompleteSettings instance)
        {
            if (instance.IsNull())
            {
                return(null);
            }

            return(new CompleteSettingsModel(instance.Settings.Select(x => x.ToModel())));
        }
Пример #5
0
        private void SaveCompleteSettings()
        {
            var completeSettings = new CompleteSettings();

            SaveLayoutSettings(completeSettings);
            SaveMonitoringSettings(completeSettings);

            _settingsManager.SaveCompleteSettings(completeSettings);
        }
Пример #6
0
 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
     };
 }