Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        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();
            }
        }