コード例 #1
0
        public void SetApplicationConfiguration(
            RemotingService sender,
            string clientAddress,
            string signature,
            Data.Transfer.Configuration.Application application,
            Data.Transfer.Configuration.Engine engine,
            Data.Transfer.Configuration.Path path,
            Data.Transfer.Configuration.Perks perks)
        {
            ConfigurationEventArgs ea = new ConfigurationEventArgs()
            {
                IpAddress   = clientAddress,
                Signature   = signature,
                Application = application,
                Engine      = engine,
                Path        = path,
                Perks       = perks
            };

            if (SetConfigurationRequested != null)
            {
                SetConfigurationRequested(sender, ea);
            }
        }
コード例 #2
0
        public void GetApplicationConfiguration(
            RemotingService sender,
            string clientAddress,
            string signature,
            out Data.Transfer.Configuration.Application application,
            out Data.Transfer.Configuration.Engine engine,
            out Data.Transfer.Configuration.Path path,
            out Data.Transfer.Configuration.Perks perks)
        {
            ConfigurationEventArgs ea = new ConfigurationEventArgs();

            ea.IpAddress = clientAddress;
            ea.Signature = signature;

            if (GetConfigurationRequested != null)
            {
                GetConfigurationRequested(sender, ea);
            }

            application = ea.Application;
            engine      = ea.Engine;
            path        = ea.Path;
            perks       = ea.Perks;
        }
コード例 #3
0
        public void SetApplicationConfiguration(
            RemotingService sender, 
            string clientAddress, 
            string signature, 
            Data.Transfer.Configuration.Application application, 
            Data.Transfer.Configuration.Engine engine, 
            Data.Transfer.Configuration.Path path, 
            Data.Transfer.Configuration.Perks perks)
        {
            ConfigurationEventArgs ea = new ConfigurationEventArgs() 
            { 
                IpAddress = clientAddress, 
                Signature = signature, 
                Application = application, 
                Engine = engine, 
                Path = path, 
                Perks = perks 
            };

            if (SetConfigurationRequested != null)
                SetConfigurationRequested(sender, ea);
        }
コード例 #4
0
        public void GetApplicationConfiguration(
            RemotingService sender, 
            string clientAddress, 
            string signature, 
            out Data.Transfer.Configuration.Application application, 
            out Data.Transfer.Configuration.Engine engine, 
            out Data.Transfer.Configuration.Path path, 
            out Data.Transfer.Configuration.Perks perks)
        {
            ConfigurationEventArgs ea = new ConfigurationEventArgs();
            ea.IpAddress = clientAddress;
            ea.Signature = signature;

            if (GetConfigurationRequested != null)
                GetConfigurationRequested(sender, ea);

            application = ea.Application;
            engine = ea.Engine;
            path = ea.Path;
            perks = ea.Perks;
        }
コード例 #5
0
ファイル: MinerForm.cs プロジェクト: reza300/MultiMiner
        private void SetConfigurationRequested(object sender, ConfigurationEventArgs ea)
        {
            PerformRequestedCommand(ea.IpAddress, ea.Signature, () =>
            {
                string oldConfigPath = this.pathConfiguration.SharedConfigPath;

                if (ea.Application != null)
                {
                    ObjectCopier.CopyObject(ea.Application.ToModelObject(), this.applicationConfiguration);
                    this.applicationConfiguration.SaveApplicationConfiguration();
                }

                if (ea.Engine != null)
                {
                    ObjectCopier.CopyObject(ea.Engine.ToModelObject(), this.engineConfiguration);
                    this.engineConfiguration.SaveCoinConfigurations();
                    this.engineConfiguration.SaveMinerConfiguration();
                    this.engineConfiguration.SaveStrategyConfiguration();
                    this.engineConfiguration.SaveDeviceConfigurations();
                }

                if (ea.Path != null)
                {
                    ObjectCopier.CopyObject(ea.Path, this.pathConfiguration);
                    this.pathConfiguration.SavePathConfiguration();
                }

                if (ea.Perks != null)
                {
                    ObjectCopier.CopyObject(ea.Perks, this.perksConfiguration);
                    this.perksConfiguration.SavePerksConfiguration();
                }

                //save settings as the "shared" config path may have changed
                //these are settings not considered machine/device-specific
                //e.g. no device settings, no miner settings
                string newConfigPath = pathConfiguration.SharedConfigPath;
                MigrateSettingsToNewFolder(oldConfigPath, newConfigPath);

                BeginInvoke((Action)(() =>
                {
                    //code to update UI
                    localViewModel.ApplyCoinConfigurationModels(engineConfiguration.CoinConfigurations);
                    localViewModel.ApplyDeviceConfigurationModels(engineConfiguration.DeviceConfigurations,
                        engineConfiguration.CoinConfigurations);
                    RefreshViewForConfigurationChanges();
                }));
            });
        }
コード例 #6
0
ファイル: MinerForm.cs プロジェクト: reza300/MultiMiner
 private void GetConfigurationRequested(object sender, ConfigurationEventArgs ea)
 {
     PerformRequestedCommand(ea.IpAddress, ea.Signature, () =>
     {
         ObjectCopier.CopyObject(applicationConfiguration.ToTransferObject(), ea.Application);
         ObjectCopier.CopyObject(engineConfiguration.ToTransferObject(), ea.Engine);
         ObjectCopier.CopyObject(pathConfiguration, ea.Path);
         ObjectCopier.CopyObject(perksConfiguration, ea.Perks);
     });
 }