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); } }
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; }
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); }
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; }
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(); })); }); }
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); }); }