public override void Link() { VirtualRoot.BuildCmdPath <ShowDialogWindowCommand>(action: message => { UIThread.Execute(() => { DialogWindow.ShowDialog(new DialogWindowViewModel(message: message.Message, title: message.Title, onYes: message.OnYes, icon: message.Icon)); }); }); VirtualRoot.BuildCmdPath <ShowQQGroupQrCodeCommand>(action: message => { UIThread.Execute(() => { QQGroupQrCode.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowCalcCommand>(action: message => { UIThread.Execute(() => { Calc.ShowWindow(message.CoinVm); }); }); VirtualRoot.BuildCmdPath <ShowLocalIpsCommand>(action: message => { UIThread.Execute(() => { LocalIpConfig.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowEthNoDevFeeCommand>(action: message => { UIThread.Execute(() => { EthNoDevFeeEdit.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowCalcConfigCommand>(action: message => { UIThread.Execute(() => { CalcConfig.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowMinerClientsWindowCommand>(action: message => { UIThread.Execute(() => { MinerClientsWindow.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowNTMinerUpdaterConfigCommand>(action: message => { UIThread.Execute(() => { NTMinerUpdaterConfig.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowAboutPageCommand>(action: message => { UIThread.Execute(() => { AboutPage.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowKernelOutputPageCommand>(action: message => { UIThread.Execute(() => { KernelOutputPage.ShowWindow(message.SelectedKernelOutputVm); }); }); VirtualRoot.BuildCmdPath <ShowKernelInputPageCommand>(action: message => { UIThread.Execute(() => { KernelInputPage.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowTagBrandCommand>(action: message => { if (NTMinerRoot.IsBrandSpecified) { return; } BrandTag.ShowWindow(); }); VirtualRoot.BuildCmdPath <ShowCoinPageCommand>(action: message => { UIThread.Execute(() => { CoinPage.ShowWindow(message.CurrentCoin, message.TabType); }); }); VirtualRoot.BuildCmdPath <ShowGroupPageCommand>(action: message => { UIThread.Execute(() => { GroupPage.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowSysDicPageCommand>(action: message => { UIThread.Execute(() => { SysDicPage.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowVirtualMemoryCommand>(action: message => { UIThread.Execute(() => { VirtualMemory.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowRestartWindowsCommand>(action: message => { UIThread.Execute(() => { RestartWindows.ShowDialog(); }); }); VirtualRoot.BuildCmdPath <ShowNotificationSampleCommand>(action: message => { UIThread.Execute(() => { NotificationSample.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowPropertyCommand>(action: message => { UIThread.Execute(() => { Property.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowChartsWindowCommand>(action: message => { UIThread.Execute(() => { ChartsWindow.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowOverClockDataPageCommand>(action: message => { UIThread.Execute(() => { OverClockDataPage.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowNTMinerWalletPageCommand>(action: message => { UIThread.Execute(() => { NTMinerWalletPage.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowMessagePathIdsCommand>(action: message => { UIThread.Execute(() => { MessagePathIds.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowUserPageCommand>(action: message => { UIThread.Execute(() => { UserPage.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowRemoteDesktopLoginDialogCommand>(action: message => { RemoteDesktopLogin.ShowWindow(message.Vm); }); VirtualRoot.BuildCmdPath <ShowKernelsWindowCommand>(action: message => { UIThread.Execute(() => { KernelsWindow.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowKernelDownloaderCommand>(action: message => { UIThread.Execute(() => { KernelDownloading.ShowWindow(message.KernelId, message.DownloadComplete); }); }); VirtualRoot.BuildCmdPath <EnvironmentVariableEditCommand>(action: message => { UIThread.Execute(() => { EnvironmentVariableEdit.ShowWindow(message.CoinKernelVm, message.EnvironmentVariable); }); }); VirtualRoot.BuildCmdPath <InputSegmentEditCommand>(action: message => { UIThread.Execute(() => { InputSegmentEdit.ShowWindow(message.CoinKernelVm, message.Segment); }); }); VirtualRoot.BuildCmdPath <CoinKernelEditCommand>(action: message => { UIThread.Execute(() => { CoinKernelEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <CoinEditCommand>(action: message => { UIThread.Execute(() => { CoinEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <ColumnsShowEditCommand>(action: message => { UIThread.Execute(() => { ColumnsShowEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <ShowContainerWindowCommand>(action: message => { UIThread.Execute(() => { ContainerWindow window = ContainerWindow.GetWindow(message.Vm); window?.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowSpeedChartsCommand>(action: message => { UIThread.Execute(() => { SpeedCharts.ShowWindow(message.GpuSpeedVm); }); }); VirtualRoot.BuildCmdPath <ShowFileWriterPageCommand>(action: message => { UIThread.Execute(() => { FileWriterPage.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <FileWriterEditCommand>(action: message => { UIThread.Execute(() => { FileWriterEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <ShowFragmentWriterPageCommand>(action: message => { UIThread.Execute(() => { FragmentWriterPage.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <FragmentWriterEditCommand>(action: message => { UIThread.Execute(() => { FragmentWriterEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <GroupEditCommand>(action: message => { UIThread.Execute(() => { GroupEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <KernelInputEditCommand>(action: message => { UIThread.Execute(() => { KernelInputEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <KernelOutputFilterEditCommand>(action: message => { UIThread.Execute(() => { KernelOutputFilterEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <KernelOutputTranslaterEditCommand>(action: message => { UIThread.Execute(() => { KernelOutputTranslaterEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <KernelOutputEditCommand>(action: message => { UIThread.Execute(() => { KernelOutputEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <ShowPackagesWindowCommand>(action: message => { UIThread.Execute(() => { PackagesWindow.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <KernelEditCommand>(action: message => { UIThread.Execute(() => { KernelEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <ShowLogColorCommand>(action: message => { UIThread.Execute(() => { LogColor.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <ShowMinerClientSettingCommand>(action: message => { UIThread.Execute(() => { MinerClientSetting.ShowWindow(message.Vm); }); }); VirtualRoot.BuildCmdPath <ShowMinerNamesSeterCommand>(action: message => { UIThread.Execute(() => { MinerNamesSeter.ShowWindow(message.Vm); }); }); VirtualRoot.BuildCmdPath <ShowGpuProfilesPageCommand>(action: message => { UIThread.Execute(() => { GpuProfilesPage.ShowWindow(message.MinerClientsWindowVm); }); }); VirtualRoot.BuildCmdPath <ShowMinerClientAddCommand>(action: message => { UIThread.Execute(() => { MinerClientAdd.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <MinerGroupEditCommand>(action: message => { UIThread.Execute(() => { MinerGroupEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <NTMinerWalletEditCommand>(action: message => { UIThread.Execute(() => { NTMinerWalletEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <MineWorkEditCommand>(action: message => { UIThread.Execute(() => { MineWorkEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <OverClockDataEditCommand>(action: message => { UIThread.Execute(() => { OverClockDataEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <PackageEditCommand>(action: message => { UIThread.Execute(() => { PackageEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <PoolKernelEditCommand>(action: message => { UIThread.Execute(() => { PoolKernelEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <PoolEditCommand>(action: message => { UIThread.Execute(() => { PoolEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <ShowControlCenterHostConfigCommand>(action: message => { UIThread.Execute(() => { ControlCenterHostConfig.ShowWindow(); }); }); VirtualRoot.BuildCmdPath <SysDicItemEditCommand>(action: message => { UIThread.Execute(() => { SysDicItemEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <SysDicEditCommand>(action: message => { UIThread.Execute(() => { SysDicEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <UserEditCommand>(action: message => { UIThread.Execute(() => { UserEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.BuildCmdPath <WalletEditCommand>(action: message => { UIThread.Execute(() => { WalletEdit.ShowWindow(message.FormType, message.Source); }); }); }
public override void Link() { VirtualRoot.Window <ShowDialogWindowCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { DialogWindow.ShowDialog(message: message.Message, title: message.Title, onYes: message.OnYes, icon: message.Icon); }); }); VirtualRoot.Window <ShowQQGroupQrCodeCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { QQGroupQrCode.ShowWindow(); }); }); VirtualRoot.Window <ShowCalcCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { Calc.ShowWindow(message.CoinVm); }); }); VirtualRoot.Window <ShowFileDownloaderCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { FileDownloader.ShowWindow(message.DownloadFileUrl, message.FileTitle, message.DownloadComplete); }); }); VirtualRoot.Window <ShowCalcConfigCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { CalcConfig.ShowWindow(); }); }); VirtualRoot.Window <ShowMinerClientsWindowCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { MinerClientsWindow.ShowWindow(); }); }); VirtualRoot.Window <ShowNTMinerUpdaterConfigCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { NTMinerUpdaterConfig.ShowWindow(); }); }); VirtualRoot.Window <ShowAboutPageCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { AboutPage.ShowWindow(); }); }); VirtualRoot.Window <ShowKernelOutputPageCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { KernelOutputPage.ShowWindow(message.SelectedKernelOutputVm); }); }); VirtualRoot.Window <ShowKernelInputPageCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { KernelInputPage.ShowWindow(); }); }); VirtualRoot.Window <ShowColumnsShowPageCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { ColumnsShowPage.ShowWindow(); }); }); VirtualRoot.Window <ShowCoinPageCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { CoinPage.ShowWindow(message.CurrentCoin, message.TabType); }); }); VirtualRoot.Window <ShowGroupPageCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { GroupPage.ShowWindow(); }); }); VirtualRoot.Window <ShowSysDicPageCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { SysDicPage.ShowWindow(); }); }); VirtualRoot.Window <ShowVirtualMemoryCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { VirtualMemory.ShowWindow(); }); }); VirtualRoot.Window <ShowRestartWindowsCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { RestartWindows.ShowDialog(); }); }); VirtualRoot.Window <ShowNotificationSampleCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { NotificationSample.ShowWindow(); }); }); VirtualRoot.Window <ShowInnerPropertyCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { InnerProperty.ShowWindow(); }); }); VirtualRoot.Window <ShowChartsWindowCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { ChartsWindow.ShowWindow(); }); }); VirtualRoot.Window <ShowOverClockDataPageCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { OverClockDataPage.ShowWindow(); }); }); VirtualRoot.Window <ShowUserPageCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { UserPage.ShowWindow(); }); }); VirtualRoot.Window <ShowKernelsWindowCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { KernelsWindow.ShowWindow(); }); }); VirtualRoot.Window <ShowKernelDownloaderCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { KernelDownloading.ShowWindow(message.KernelId, message.DownloadComplete); }); }); VirtualRoot.Window <EnvironmentVariableEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { EnvironmentVariableEdit.ShowWindow(message.CoinKernelVm, message.EnvironmentVariable); }); }); VirtualRoot.Window <InputSegmentEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { InputSegmentEdit.ShowWindow(message.CoinKernelVm, message.Segment); }); }); VirtualRoot.Window <CoinKernelEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { CoinKernelEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <CoinEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { CoinEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <ColumnsShowEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { ColumnsShowEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <ShowContainerWindowCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { ContainerWindow window = ContainerWindow.GetWindow(message.Vm); window?.ShowWindow(); }); }); VirtualRoot.Window <ShowSpeedChartsCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { SpeedCharts.ShowWindow(message.GpuSpeedVm); }); }); VirtualRoot.Window <ShowFileWriterPageCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { FileWriterPage.ShowWindow(); }); }); VirtualRoot.Window <FileWriterEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { FileWriterEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <GroupEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { GroupEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <KernelInputEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { KernelInputEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <KernelOutputFilterEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { KernelOutputFilterEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <KernelOutputTranslaterEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { KernelOutputTranslaterEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <KernelOutputEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { KernelOutputEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <ShowPackagesWindowCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { PackagesWindow.ShowWindow(); }); }); VirtualRoot.Window <KernelEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { KernelEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <ShowLogColorCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { LogColor.ShowWindow(); }); }); VirtualRoot.Window <ShowMinerClientSettingCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { MinerClientSetting.ShowWindow(message.Vm); }); }); VirtualRoot.Window <ShowMinerNamesSeterCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { MinerNamesSeter.ShowWindow(message.Vm); }); }); VirtualRoot.Window <ShowGpuProfilesPageCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { GpuProfilesPage.ShowWindow(message.MinerClientsWindowVm); }); }); VirtualRoot.Window <ShowMinerClientAddCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { MinerClientAdd.ShowWindow(); }); }); VirtualRoot.Window <MinerGroupEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { MinerGroupEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <MineWorkEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { MineWorkEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <OverClockDataEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { OverClockDataEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <PackageEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { PackageEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <PoolKernelEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { PoolKernelEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <PoolEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { PoolEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <ShowControlCenterHostConfigCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { ControlCenterHostConfig.ShowWindow(); }); }); VirtualRoot.Window <SysDicItemEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { SysDicItemEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <SysDicEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { SysDicEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <UserEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { UserEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <WalletEditCommand>(LogEnum.DevConsole, action: message => { UIThread.Execute(() => { WalletEdit.ShowWindow(message.FormType, message.Source); }); }); VirtualRoot.Window <UpgradeCommand>(LogEnum.DevConsole, action: message => { Upgrade(message.FileName, message.Callback); }); }
private MinerClientsWindowViewModel() { if (Design.IsInDesignMode) { return; } var appSettings = NTMinerRoot.Current.AppSettingSet; Guid columnsShowId = ColumnsShowData.PleaseSelect.Id; if (appSettings.TryGetAppSetting("ColumnsShowId", out IAppSetting columnsShowAppSetting) && columnsShowAppSetting.Value != null) { if (Guid.TryParse(columnsShowAppSetting.Value.ToString(), out Guid guid)) { columnsShowId = guid; } } if (appSettings.TryGetAppSetting("FrozenColumnCount", out IAppSetting frozenColumnCountAppSetting) && frozenColumnCountAppSetting.Value != null) { if (int.TryParse(frozenColumnCountAppSetting.Value.ToString(), out int frozenColumnCount)) { _frozenColumnCount = frozenColumnCount; } } if (appSettings.TryGetAppSetting("MaxTemp", out IAppSetting maxTempAppSetting) && maxTempAppSetting.Value != null) { if (uint.TryParse(maxTempAppSetting.Value.ToString(), out uint maxTemp)) { _maxTemp = maxTemp; } } if (appSettings.TryGetAppSetting("MinTemp", out IAppSetting minTempAppSetting) && minTempAppSetting.Value != null) { if (uint.TryParse(minTempAppSetting.Value.ToString(), out uint minTemp)) { _minTemp = minTemp; } } if (appSettings.TryGetAppSetting("RejectPercent", out IAppSetting rejectPercentAppSetting) && rejectPercentAppSetting.Value != null) { if (int.TryParse(rejectPercentAppSetting.Value.ToString(), out int rejectPercent)) { _rejectPercent = rejectPercent; } } this._columnsShow = this.ColumnsShows.List.FirstOrDefault(a => a.Id == columnsShowId); if (this._columnsShow == null) { this._columnsShow = this.ColumnsShows.List.FirstOrDefault(); } this._mineStatusEnumItem = AppStatic.MineStatusEnumItems.FirstOrDefault(a => a.Value == MineStatus.All); this._coinVm = CoinViewModel.PleaseSelect; this._selectedMineWork = MineWorkViewModel.PleaseSelect; this._selectedMinerGroup = MinerGroupViewModel.PleaseSelect; this._pool = string.Empty; this._poolVm = _coinVm.OptionPools.First(); this._wallet = string.Empty; this.OneKeySetting = new DelegateCommand(() => { MinerClientSetting.ShowWindow(new MinerClientSettingViewModel(this.SelectedMinerClients)); }, CanCommand); this.OneKeyMinerNames = new DelegateCommand(() => { if (this.SelectedMinerClients.Length == 1) { var selectedMinerClient = this.SelectedMinerClients[0]; InputWindow.ShowDialog("作业矿工名 注意:重新开始挖矿时生效", selectedMinerClient.MinerName, null, minerName => { selectedMinerClient.MinerName = minerName; NotiCenterWindowViewModel.Current.Manager.ShowSuccessMessage("设置作业矿工名成功,重新开始挖矿时生效。"); }); return; } MinerNamesSeterViewModel vm = new MinerNamesSeterViewModel( prefix: "miner", suffix: "01", namesByObjectId: this.SelectedMinerClients.Select(a => new Tuple <string, string>(a.Id, string.Empty)).ToList()); MinerNamesSeter.ShowWindow(vm); if (vm.IsOk) { this.CountDown = 10; Server.ControlCenterService.UpdateClientsAsync(nameof(MinerClientViewModel.MinerName), vm.NamesByObjectId.ToDictionary(a => a.Item1, a => (object)a.Item2), callback: (response, e) => { if (!response.IsSuccess()) { if (response != null) { Write.UserLine(response.Description, ConsoleColor.Red); } } else { foreach (var kv in vm.NamesByObjectId) { var item = this.SelectedMinerClients.FirstOrDefault(a => a.Id == kv.Item1); if (item != null) { item.UpdateMinerName(kv.Item2); } } QueryMinerClients(); } }); } }, CanCommand); this.RemoteDesktop = new DelegateCommand(() => { if (this.SelectedMinerClients != null && this.SelectedMinerClients.Length == 1) { this.SelectedMinerClients[0].RemoteDesktop.Execute(null); } }, OnlySelectedOne); this.EditMineWork = new DelegateCommand(() => { this.SelectedMinerClients[0].SelectedMineWork.Edit.Execute(null); }, () => OnlySelectedOne() && this.SelectedMinerClients[0].SelectedMineWork != null && this.SelectedMinerClients[0].SelectedMineWork != MineWorkViewModel.PleaseSelect); this.OneKeyWork = new DelegateCommand <MineWorkViewModel>((work) => { foreach (var item in SelectedMinerClients) { item.SelectedMineWork = work; } }); this.OneKeyGroup = new DelegateCommand <MinerGroupViewModel>((group) => { foreach (var item in SelectedMinerClients) { item.SelectedMinerGroup = group; } }); this.OneKeyOverClock = new DelegateCommand(() => { if (this.SelectedMinerClients.Length == 1) { GpuProfilesPage.ShowWindow(this); } }, OnlySelectedOne); this.OneKeyUpgrade = new DelegateCommand <NTMinerFileData>((ntminerFileData) => { DialogWindow.ShowDialog(message: "确定升级到该版本吗?", title: "确认", onYes: () => { foreach (var item in SelectedMinerClients) { Server.MinerClientService.UpgradeNTMinerAsync(item, ntminerFileData.FileName, (response, e) => { if (!response.IsSuccess()) { if (response != null) { Write.UserLine($"{item.MinerName} {item.MinerIp} {response.Description}", ConsoleColor.Red); } } }); } }, icon: IconConst.IconConfirm); }, (ntminerFileData) => { return(this.SelectedMinerClients != null && this.SelectedMinerClients.Length != 0); }); this.AddMinerClient = new DelegateCommand(() => { MinerClientAdd.ShowWindow(); }); this.RemoveMinerClients = new DelegateCommand(() => { if (SelectedMinerClients.Length == 0) { ShowNoRecordSelected(); } else { DialogWindow.ShowDialog(message: $"确定删除选中的矿机吗?", title: "确认", onYes: () => { this.CountDown = 10; Server.ControlCenterService.RemoveClientsAsync(SelectedMinerClients.Select(a => a.Id).ToList(), (response, e) => { if (!response.IsSuccess()) { if (response != null) { Write.UserLine(response.Description, ConsoleColor.Red); } } else { QueryMinerClients(); } }); }, icon: IconConst.IconConfirm); } }, CanCommand); this.RefreshMinerClients = new DelegateCommand(() => { if (SelectedMinerClients.Length == 0) { ShowNoRecordSelected(); } else { Server.ControlCenterService.RefreshClientsAsync(SelectedMinerClients.Select(a => a.Id).ToList(), (response, e) => { if (!response.IsSuccess()) { if (response != null) { Write.UserLine(response.Description, ConsoleColor.Red); } } else { foreach (var data in response.Data) { var item = MinerClients.FirstOrDefault(a => a.Id == data.Id); if (item != null) { item.Update(data); } } } }); } }, CanCommand); this.RestartWindows = new DelegateCommand(() => { if (SelectedMinerClients.Length == 0) { ShowNoRecordSelected(); } else { DialogWindow.ShowDialog(message: $"确定重启选中的电脑吗?", title: "确认", onYes: () => { foreach (var item in SelectedMinerClients) { Server.MinerClientService.RestartWindowsAsync(item, (response, e) => { if (!response.IsSuccess()) { if (response != null) { Write.UserLine(response.Description, ConsoleColor.Red); } } }); } }, icon: IconConst.IconConfirm); } }, CanCommand); this.ShutdownWindows = new DelegateCommand(() => { if (SelectedMinerClients.Length == 0) { ShowNoRecordSelected(); } else { DialogWindow.ShowDialog(message: $"确定关闭选中的电脑吗?", title: "确认", onYes: () => { foreach (var item in SelectedMinerClients) { Server.MinerClientService.ShutdownWindowsAsync(item, (response, e) => { if (!response.IsSuccess()) { if (response != null) { Write.UserLine(response.Description, ConsoleColor.Red); } } }); } }, icon: IconConst.IconConfirm); } }, CanCommand); this.RestartNTMiner = new DelegateCommand(() => { if (SelectedMinerClients.Length == 0) { ShowNoRecordSelected(); } else { DialogWindow.ShowDialog(message: $"确定重启选中的挖矿客户端吗?", title: "确认", onYes: () => { foreach (var item in SelectedMinerClients) { Server.MinerClientService.RestartNTMinerAsync(item, (response, e) => { if (!response.IsSuccess()) { if (response != null) { Write.UserLine(response.Description, ConsoleColor.Red); } } }); } }, icon: IconConst.IconConfirm); } }, CanCommand); this.StartMine = new DelegateCommand(() => { if (SelectedMinerClients.Length == 0) { ShowNoRecordSelected(); } else { foreach (var item in SelectedMinerClients) { item.IsMining = true; Server.MinerClientService.StartMineAsync(item, item.WorkId, (response, e) => { if (!response.IsSuccess()) { string message = $"{item.MinerIp} {response?.Description}"; Write.UserLine(message, ConsoleColor.Red); } }); Server.ControlCenterService.UpdateClientAsync(item.Id, nameof(item.IsMining), item.IsMining, null); } } }, CanCommand); this.StopMine = new DelegateCommand(() => { if (SelectedMinerClients.Length == 0) { ShowNoRecordSelected(); } else { DialogWindow.ShowDialog(message: $"确定停止挖矿选中的挖矿端吗?", title: "确认", onYes: () => { foreach (var item in SelectedMinerClients) { item.IsMining = false; Server.MinerClientService.StopMineAsync(item, (response, e) => { if (!response.IsSuccess()) { string message = $"{item.MinerIp} {response?.Description}"; Write.UserLine(message, ConsoleColor.Red); } }); Server.ControlCenterService.UpdateClientAsync(item.Id, nameof(item.IsMining), item.IsMining, null); } }, icon: IconConst.IconConfirm); } }, CanCommand); this.PageUp = new DelegateCommand(() => { this.MinerClientPageIndex = this.MinerClientPageIndex - 1; }); this.PageDown = new DelegateCommand(() => { this.MinerClientPageIndex = this.MinerClientPageIndex + 1; }); this.PageFirst = new DelegateCommand(() => { this.MinerClientPageIndex = 1; }); this.PageLast = new DelegateCommand(() => { this.MinerClientPageIndex = MinerClientPageCount; }); this.PageRefresh = new DelegateCommand(QueryMinerClients); }