示例#1
0
 private void CancelChangesRequested(object sender, RemoteCommandEventArgs ea)
 {
     PerformRequestedCommand(ea.IpAddress, ea.Signature, () =>
     {
         BeginInvoke((Action)(() =>
         {
             //code to update UI
             CancelChangesLocally();
         }));
     });
 }
示例#2
0
        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();
            }));
        }
示例#3
0
        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();
            }));
        }
示例#4
0
 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);
         }));
     });
 }
示例#5
0
 private void ToggleDynamicIntensityRequested(object sender, bool enabled, RemoteCommandEventArgs ea)
 {
     PerformRequestedCommand(ea.IpAddress, ea.Signature, () =>
     {
         BeginInvoke((Action)(() =>
         {
             //code to update UI
             ToggleDynamicIntensityLocally(enabled);
         }));
     });
 }
示例#6
0
        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();
                }));
            });
        }
示例#7
0
 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);
         }));
     });
 }
示例#8
0
 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);
     });
 }