private void CancelChangesRequested(object sender, RemoteCommandEventArgs ea) { PerformRequestedCommand(ea.IpAddress, ea.Signature, () => { BeginInvoke((Action)(() => { //code to update UI CancelChangesLocally(); })); }); }
private void UpgradeBackendMinerRequested(object sender, RemoteCommandEventArgs ea) { string installedVersion, availableVersion; bool updatesAvailable = BackendMinerHasUpdates(out availableVersion, out installedVersion); if (!updatesAvailable) return; BeginInvoke((Action)(() => { //code to update UI bool wasMining = miningEngine.Mining; if (wasMining) StopMiningLocally(); InstallBackendMinerLocally(MinerFactory.Instance.GetDefaultMiner()); //only start mining if we stopped mining if (wasMining) StartMiningLocally(); })); }
private void UpgradeMultiMinerRequested(object sender, RemoteCommandEventArgs ea) { string installedVersion, availableVersion; bool updatesAvailable = MultiMinerHasUpdates(out availableVersion, out installedVersion); if (!updatesAvailable) return; BeginInvoke((Action)(() => { //code to update UI bool wasMining = miningEngine.Mining; if (wasMining) StopMiningLocally(); //this will restart the app InstallMultiMinerLocally(); })); }
private void ToggleDevicesRequested(object sender, IEnumerable<DeviceDescriptor> devices, bool enabled, RemoteCommandEventArgs ea) { PerformRequestedCommand(ea.IpAddress, ea.Signature, () => { BeginInvoke((Action)(() => { //code to update UI ToggleDevicesLocally(devices, enabled); })); }); }
private void ToggleDynamicIntensityRequested(object sender, bool enabled, RemoteCommandEventArgs ea) { PerformRequestedCommand(ea.IpAddress, ea.Signature, () => { BeginInvoke((Action)(() => { //code to update UI ToggleDynamicIntensityLocally(enabled); })); }); }
private void SetCoinConfigurationsRequested(object sender, Engine.Data.Configuration.Coin[] coinConfigurations, RemoteCommandEventArgs ea) { PerformRequestedCommand(ea.IpAddress, ea.Signature, () => { ObjectCopier.CopyObject(coinConfigurations, this.engineConfiguration.CoinConfigurations); this.engineConfiguration.SaveCoinConfigurations(); BeginInvoke((Action)(() => { //code to update UI localViewModel.ApplyCoinConfigurationModels(engineConfiguration.CoinConfigurations); localViewModel.ApplyDeviceConfigurationModels(engineConfiguration.DeviceConfigurations, engineConfiguration.CoinConfigurations); RefreshViewForConfigurationChanges(); })); }); }
private void SetDeviceToCoinRequested(object sender, IEnumerable<DeviceDescriptor> devices, string coinSymbol, RemoteCommandEventArgs ea) { PerformRequestedCommand(ea.IpAddress, ea.Signature, () => { BeginInvoke((Action)(() => { //code to update UI SetDevicesToCoinLocally(devices, coinSymbol); })); }); }
private void SetAllDevicesToCoinRequested(object sender, string coinSymbol, bool disableStrategies, RemoteCommandEventArgs ea) { PerformRequestedCommand(ea.IpAddress, ea.Signature, () => { BeginInvoke((Action)(() => { //code to update UI SetAllDevicesToCoinLocally(coinSymbol, disableStrategies); })); }); }
private void SetCoinConfigurationsRequested(object sender, Coin[] coinConfigurations, RemoteCommandEventArgs ea) { PerformRequestedCommand(ea.IpAddress, ea.Signature, () => { ObjectCopier.CopyObject(coinConfigurations, EngineConfiguration.CoinConfigurations); EngineConfiguration.SaveCoinConfigurations(); Context.BeginInvoke((Action)(() => { //code to update UI LocalViewModel.ApplyCoinConfigurationModels(EngineConfiguration.CoinConfigurations); LocalViewModel.ApplyDeviceConfigurationModels(EngineConfiguration.DeviceConfigurations, EngineConfiguration.CoinConfigurations); if (ConfigurationModified != null) ConfigurationModified(this, new EventArgs()); }), null); }); }
private void CancelChangesRequested(object sender, RemoteCommandEventArgs ea) { PerformRequestedCommand(ea.IpAddress, ea.Signature, () => { Context.BeginInvoke((Action)(CancelChangesLocally), null); }); }
private void ScanHardwareRequested(object sender, RemoteCommandEventArgs ea) { PerformRequestedCommand(ea.IpAddress, ea.Signature, () => { Context.BeginInvoke((Action)(() => { //code to update UI ScanHardwareLocally(); }), null); }); }
private void RestartMiningRequested(object sender, RemoteCommandEventArgs ea) { PerformRequestedCommand(ea.IpAddress, ea.Signature, () => { Context.BeginInvoke((Action)(RestartMiningLocally), null); }); }