예제 #1
0
        public SettingsForm(UX.Data.Configuration.Application applicationConfiguration, MultiMiner.Engine.Data.Configuration.Xgminer minerConfiguration,
            Paths pathConfiguration, Perks perksConfiguration)
        {
            InitializeComponent();

            this.minerConfiguration = minerConfiguration;
            this.applicationConfiguration = applicationConfiguration;
            this.pathConfiguration = pathConfiguration;
            this.perksConfiguration = perksConfiguration;
        }
예제 #2
0
        public MinerSettingsForm(MultiMiner.Engine.Data.Configuration.Xgminer minerConfiguration, Application applicationConfiguration,
            Perks perksConfiguration)
        {
            InitializeComponent();
            this.minerConfiguration = minerConfiguration;
            this.workingMinerConfiguration = ObjectCopier.CloneObject<MultiMiner.Engine.Data.Configuration.Xgminer, MultiMiner.Engine.Data.Configuration.Xgminer>(minerConfiguration);

            this.applicationConfiguration = applicationConfiguration;
            this.workingApplicationConfiguration = ObjectCopier.CloneObject<Application, Application>(applicationConfiguration);

            this.perksConfiguration = perksConfiguration;
        }
예제 #3
0
        private void ConfigurePerksRemotely()
        {
            Perks workingPerksConfiguration = new Perks();

            GetRemoteApplicationConfiguration(SelectedRemoteInstance);

            ObjectCopier.CopyObject(remotePerksConfig, workingPerksConfiguration);

            ConfigurationEventArgs eventArgs = new ConfigurationEventArgs
            {
                Perks = workingPerksConfiguration
            };
            if (OnConfigurePerks != null) OnConfigurePerks(this, eventArgs);

            if (eventArgs.ConfigurationModified)
            {
                ObjectCopier.CopyObject(workingPerksConfiguration, remotePerksConfig);
                SetConfigurationRemotely(SelectedRemoteInstance, null, null, null, remotePerksConfig);
            }
        }
예제 #4
0
        private void ConfigureSettingsRemotely()
        {
            Application workingApplicationConfiguration = new Application();
            Engine.Data.Configuration.Engine workingEngineConfiguration = new Engine.Data.Configuration.Engine();
            Paths workingPathConfiguration = new Paths();
            Perks workingPerksConfiguration = new Perks();

            GetRemoteApplicationConfiguration(SelectedRemoteInstance);

            ObjectCopier.CopyObject(remoteApplicationConfig.ToModelObject(), workingApplicationConfiguration);
            ObjectCopier.CopyObject(remoteEngineConfig.ToModelObject(), workingEngineConfiguration);
            ObjectCopier.CopyObject(remotePathConfig, workingPathConfiguration);
            ObjectCopier.CopyObject(remotePerksConfig, workingPerksConfiguration);

            ConfigurationEventArgs eventArgs = new ConfigurationEventArgs
            {
                Application = workingApplicationConfiguration,
                Engine = workingEngineConfiguration,
                Paths = workingPathConfiguration,
                Perks = workingPerksConfiguration
            };
            if (OnConfigureSettings != null) OnConfigureSettings(this, eventArgs);

            if (eventArgs.ConfigurationModified)
            {
                ObjectCopier.CopyObject(workingApplicationConfiguration.ToTransferObject(), remoteApplicationConfig);
                ObjectCopier.CopyObject(workingEngineConfiguration.ToTransferObject(), remoteEngineConfig);
                ObjectCopier.CopyObject(workingPathConfiguration, remotePathConfig);
                ObjectCopier.CopyObject(workingPerksConfiguration, remotePerksConfig);

                SetConfigurationRemotely(SelectedRemoteInstance, remoteApplicationConfig, remoteEngineConfig, remotePathConfig, null);
            }
        }
예제 #5
0
 public PerksForm(Perks perksConfiguration)
 {
     InitializeComponent();
     this.perksConfigurationBindingSource.DataSource = perksConfiguration;
 }
예제 #6
0
        private Perks CreatePerksConfiguration()
        {
            Perks result = new Perks();

            result.PerksEnabled = perksCheckBox.Checked;
            result.ShowExchangeRates = exchangeApiCheckbox.Checked;
            result.ShowIncomeRates = incomeCheckBox.Checked;
            result.EnableRemoting = remotingCheckBox.Checked;
            result.RemotingPassword = remotingPasswordEdit.Text;

            return result;
        }
예제 #7
0
 public void CreateConfigurations(out Engine.Data.Configuration.Engine engineConfiguration,
     out UX.Data.Configuration.Application applicationConfiguraion,
     out Perks perksConfiguration)
 {
     engineConfiguration = CreateEngineConfiguration();
     applicationConfiguraion = CreateApplicationConfiguration();
     perksConfiguration = CreatePerksConfiguration();
 }