private void ConfigureStrategies() { StrategiesForm strategiesForm = new StrategiesForm(engineConfiguration.StrategyConfiguration, knownCoins, applicationConfiguration); DialogResult dialogResult = strategiesForm.ShowDialog(); if (dialogResult == System.Windows.Forms.DialogResult.OK) { Application.DoEvents(); engineConfiguration.SaveStrategyConfiguration(); applicationConfiguration.SaveApplicationConfiguration(); SetupCoinStatsTimer(); //so updated profitability is shown RefreshCoinStats(); RefreshStrategiesLabel(); LoadListViewValuesFromCoinStats(); UpdateMiningButtons(); Application.DoEvents(); } else { engineConfiguration.LoadStrategyConfiguration(pathConfiguration.SharedConfigPath); applicationConfiguration.LoadApplicationConfiguration(pathConfiguration.SharedConfigPath); } }
private void ConfigureStrategiesLocally() { StrategiesForm strategiesForm = new StrategiesForm(engineConfiguration.StrategyConfiguration, knownCoins, applicationConfiguration); DialogResult dialogResult = strategiesForm.ShowDialog(); if (dialogResult == System.Windows.Forms.DialogResult.OK) { engineConfiguration.SaveStrategyConfiguration(); applicationConfiguration.SaveApplicationConfiguration(); RefreshViewForConfigurationChanges(); } else { engineConfiguration.LoadStrategyConfiguration(pathConfiguration.SharedConfigPath); applicationConfiguration.LoadApplicationConfiguration(pathConfiguration.SharedConfigPath); } }
private void ConfigureStrategiesRemotely() { ApplicationConfiguration workingApplicationConfiguration = new ApplicationConfiguration(); EngineConfiguration workingEngineConfiguration = new EngineConfiguration(); GetRemoteApplicationConfiguration(this.selectedRemoteInstance); ObjectCopier.CopyObject(this.remoteApplicationConfig, workingApplicationConfiguration); ObjectCopier.CopyObject(this.remoteEngineConfig, workingEngineConfiguration); StrategiesForm strategiesForm = new StrategiesForm(workingEngineConfiguration.StrategyConfiguration, knownCoins, workingApplicationConfiguration); strategiesForm.Text = String.Format("{0}: {1}", strategiesForm.Text, this.selectedRemoteInstance.MachineName); DialogResult dialogResult = strategiesForm.ShowDialog(); if (dialogResult == System.Windows.Forms.DialogResult.OK) { ObjectCopier.CopyObject(workingApplicationConfiguration, this.remoteApplicationConfig); ObjectCopier.CopyObject(workingEngineConfiguration, this.remoteEngineConfig); SetConfigurationRemotely(this.selectedRemoteInstance, this.remoteApplicationConfig, this.remoteEngineConfig, null, null); } }
private void ConfigureStrategies() { StrategiesForm strategiesForm = new StrategiesForm(engineConfiguration.StrategyConfiguration, knownCoins, applicationConfiguration); DialogResult dialogResult = strategiesForm.ShowDialog(); if (dialogResult == System.Windows.Forms.DialogResult.OK) { Application.DoEvents(); engineConfiguration.SaveStrategyConfiguration(); applicationConfiguration.SaveApplicationConfiguration(); SetupCoinStatsTimer(); coinColumn.ReadOnly = engineConfiguration.StrategyConfiguration.AutomaticallyMineCoins; coinColumn.DisplayStyle = coinColumn.ReadOnly ? DataGridViewComboBoxDisplayStyle.Nothing : DataGridViewComboBoxDisplayStyle.DropDownButton; //so updated profitability is shown RefreshCoinStats(); RefreshStrategiesLabel(); LoadGridValuesFromCoinStats(); UpdateMiningButtons(); Application.DoEvents(); RestartMiningIfMining(); } else { engineConfiguration.LoadStrategyConfiguration(); applicationConfiguration.LoadApplicationConfiguration(); } }