anycmd пре 4 година
родитељ
комит
40e9dc0706

+ 1 - 1
src/AppModels/AppRoot.partials.CoinGroupViewModels.cs

@@ -20,7 +20,7 @@ namespace NTMiner {
                         _listByGroupId.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         // 什么也不做,因为该集合没有什么属性
                     });

+ 1 - 3
src/AppModels/AppRoot.partials.CoinKernelViewModels.cs

@@ -18,7 +18,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         OnPropertyChanged(nameof(AllCoinKernels));
                     });
@@ -34,7 +34,6 @@ namespace NTMiner {
                             kernelVm.OnPropertyChanged(nameof(kernelVm.SupportedCoinVms));
                             kernelVm.OnPropertyChanged(nameof(kernelVm.SupportedCoins));
                         }
-                        VirtualRoot.RaiseEvent(new CoinKernelVmAddedEvent(message));
                     });
                 BuildEventPath<CoinKernelUpdatedEvent>("刷新VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
                     path: (message) => {
@@ -65,7 +64,6 @@ namespace NTMiner {
                             kernelVm.OnPropertyChanged(nameof(kernelVm.CoinVms));
                             kernelVm.OnPropertyChanged(nameof(kernelVm.SupportedCoinVms));
                             kernelVm.OnPropertyChanged(nameof(kernelVm.SupportedCoins));
-                            VirtualRoot.RaiseEvent(new CoinKernelVmRemovedEvent(message));
                         }
                     });
                 Init();

+ 5 - 7
src/AppModels/AppRoot.partials.CoinViewModels.cs

@@ -21,7 +21,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         AllPropertyChanged();
                     });
@@ -29,23 +29,21 @@ namespace NTMiner {
                     path: (message) => {
                         _dicById.Add(message.Source.GetId(), new CoinViewModel(message.Source));
                         AllPropertyChanged();
-                        VirtualRoot.RaiseEvent(new CoinVmAddedEvent(message));
                     });
                 BuildEventPath<CoinRemovedEvent>("刷新VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
                     path: message => {
                         _dicById.Remove(message.Source.GetId());
                         AllPropertyChanged();
-                        VirtualRoot.RaiseEvent(new CoinVmRemovedEvent(message));
                     });
-                BuildEventPath<CoinKernelVmAddedEvent>("刷新币种Vm集的关联内存", LogEnum.DevConsole, this.GetType(), PathPriority.Normal, path: message => {
-                    if (_dicById.TryGetValue(message.Event.Source.CoinId, out CoinViewModel coinVm)) {
+                BuildEventPath<CoinKernelAddedEvent>("刷新币种Vm集的关联内存", LogEnum.DevConsole, this.GetType(), PathPriority.BelowNormal, path: message => {
+                    if (_dicById.TryGetValue(message.Source.CoinId, out CoinViewModel coinVm)) {
                         coinVm.OnPropertyChanged(nameof(CoinViewModel.CoinKernel));
                         coinVm.OnPropertyChanged(nameof(CoinViewModel.CoinKernels));
                         coinVm.OnPropertyChanged(nameof(CoinViewModel.IsSupported));
                     }
                 });
-                BuildEventPath<CoinKernelVmRemovedEvent>("刷新币种Vm集的关联内存", LogEnum.DevConsole, this.GetType(), PathPriority.Normal, path: message => {
-                    if (_dicById.TryGetValue(message.Event.Source.CoinId, out CoinViewModel coinVm)) {
+                BuildEventPath<CoinKernelRemovedEvent>("刷新币种Vm集的关联内存", LogEnum.DevConsole, this.GetType(), PathPriority.BelowNormal, path: message => {
+                    if (_dicById.TryGetValue(message.Source.CoinId, out CoinViewModel coinVm)) {
                         coinVm.OnPropertyChanged(nameof(CoinViewModel.CoinKernel));
                         coinVm.OnPropertyChanged(nameof(CoinViewModel.CoinKernels));
                         coinVm.OnPropertyChanged(nameof(CoinViewModel.IsSupported));

+ 1 - 1
src/AppModels/AppRoot.partials.FileWriterViewModels.cs

@@ -22,7 +22,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         OnPropertyChangeds();
                     });

+ 1 - 1
src/AppModels/AppRoot.partials.FragmentWriterViewModels.cs

@@ -22,7 +22,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         OnPropertyChangeds();
                     });

+ 1 - 1
src/AppModels/AppRoot.partials.GroupViewModels.cs

@@ -24,7 +24,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         OnPropertyChangeds();
                     });

+ 1 - 1
src/AppModels/AppRoot.partials.KernelInputViewModels.cs

@@ -18,7 +18,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         OnPropertyChangeds();
                     });

+ 1 - 1
src/AppModels/AppRoot.partials.KernelOutputTranslaterViewModels.cs

@@ -20,7 +20,7 @@ namespace NTMiner {
                         _dicByKernelOutputId.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         OnPropertyChanged(nameof(AllKernelOutputTranslaterVms));
                     });

+ 1 - 1
src/AppModels/AppRoot.partials.KernelOutputViewModels.cs

@@ -18,7 +18,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         AllPropertyChanged();
                     });

+ 1 - 1
src/AppModels/AppRoot.partials.KernelViewModels.cs

@@ -24,7 +24,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         OnPropertyChanged(nameof(AllKernels));
                     });

+ 1 - 1
src/AppModels/AppRoot.partials.PackageViewModels.cs

@@ -18,7 +18,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         OnPropertyChanged(nameof(AllPackages));
                     });

+ 1 - 1
src/AppModels/AppRoot.partials.PoolKernelViewModels.cs

@@ -19,7 +19,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         OnPropertyChanged(nameof(AllPoolKernels));
                     });

+ 1 - 1
src/AppModels/AppRoot.partials.PoolViewModels.cs

@@ -17,7 +17,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         OnPropertyChanged(nameof(AllPools));
                     });

+ 1 - 1
src/AppModels/AppRoot.partials.SysDicItemViewModels.cs

@@ -18,7 +18,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         AllPropertyChanged();
                     });

+ 1 - 1
src/AppModels/AppRoot.partials.SysDicViewModels.cs

@@ -22,7 +22,7 @@ namespace NTMiner {
                         _dicById.Clear();
                         Init();
                     });
-                VirtualRoot.BuildEventPath<ServerContextReInitedEventHandledEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
+                VirtualRoot.BuildEventPath<ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal,
                     path: message => {
                         OnPropertyChangeds();
                     });

+ 0 - 2
src/AppModels/AppRoot.partials.WalletViewModels.cs

@@ -26,7 +26,6 @@ namespace NTMiner {
                             coin.OnPropertyChanged(nameof(CoinViewModel.WalletItems));
                             coin.CoinKernel?.CoinKernelProfile?.SelectedDualCoin?.OnPropertyChanged(nameof(CoinViewModel.Wallets));
                         }
-                        VirtualRoot.RaiseEvent(new WalletVmAddedEvent(message));
                     });
                 BuildEventPath<WalletRemovedEvent>("调整VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
                     path: (message) => {
@@ -38,7 +37,6 @@ namespace NTMiner {
                             coin.CoinProfile?.OnPropertyChanged(nameof(CoinProfileViewModel.SelectedWallet));
                             coin.CoinKernel?.CoinKernelProfile?.SelectedDualCoin?.OnPropertyChanged(nameof(CoinViewModel.Wallets));
                         }
-                        VirtualRoot.RaiseEvent(new WalletVmRemovedEvent(message));
                     });
                 BuildEventPath<WalletUpdatedEvent>("调整VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
                     path: (message) => {

+ 0 - 36
src/AppModels/Messages.cs

@@ -345,40 +345,4 @@ namespace NTMiner {
         public EditWalletCommand(FormType formType, WalletViewModel source) : base(formType, source) {
         }
     }
-
-    [MessageType(description: "添加了币种后")]
-    public class CoinVmAddedEvent : VmEventBase<CoinAddedEvent> {
-        public CoinVmAddedEvent(CoinAddedEvent evt) : base(evt) {
-        }
-    }
-
-    [MessageType(description: "移除了币种后")]
-    public class CoinVmRemovedEvent : VmEventBase<CoinRemovedEvent> {
-        public CoinVmRemovedEvent(CoinRemovedEvent evt) : base(evt) {
-        }
-    }
-
-    [MessageType(description: "添加了钱包后")]
-    public class WalletVmAddedEvent : VmEventBase<WalletAddedEvent> {
-        public WalletVmAddedEvent(WalletAddedEvent evt) : base(evt) {
-        }
-    }
-
-    [MessageType(description: "移除了钱包后")]
-    public class WalletVmRemovedEvent : VmEventBase<WalletRemovedEvent> {
-        public WalletVmRemovedEvent(WalletRemovedEvent evt) : base(evt) {
-        }
-    }
-
-    [MessageType(description: "添加了币种级内核后")]
-    public class CoinKernelVmAddedEvent : VmEventBase<CoinKernelAddedEvent> {
-        public CoinKernelVmAddedEvent(CoinKernelAddedEvent evt) : base(evt) {
-        }
-    }
-
-    [MessageType(description: "移除了币种级内核后")]
-    public class CoinKernelVmRemovedEvent : VmEventBase<CoinKernelRemovedEvent> {
-        public CoinKernelVmRemovedEvent(CoinKernelRemovedEvent evt) : base(evt) {
-        }
-    }
 }

+ 2 - 2
src/AppModels/Vms/MinerProfileViewModel.cs

@@ -165,10 +165,10 @@ namespace NTMiner.Vms {
                         CoinVm.CoinKernel?.CoinKernelProfile.SelectedDualCoin?.CoinProfile?.OnPropertyChanged(nameof(CoinVm.CoinProfile.SelectedDualCoinWallet));
                     }
                 });
-            VirtualRoot.BuildEventPath<CoinVmAddedEvent>("Vm集添加了新币种后刷新MinerProfileVm内存", LogEnum.DevConsole, this.GetType(), PathPriority.Normal, path: message => {
+            VirtualRoot.BuildEventPath<CoinAddedEvent>("Vm集添加了新币种后刷新MinerProfileVm内存", LogEnum.DevConsole, this.GetType(), PathPriority.BelowNormal, path: message => {
                 OnPropertyChanged(nameof(CoinVm));
             });
-            VirtualRoot.BuildEventPath<CoinVmRemovedEvent>("Vm集删除了新币种后刷新MinerProfileVm内存", LogEnum.DevConsole, this.GetType(), PathPriority.Normal, path: message => {
+            VirtualRoot.BuildEventPath<CoinRemovedEvent>("Vm集删除了新币种后刷新MinerProfileVm内存", LogEnum.DevConsole, this.GetType(), PathPriority.BelowNormal, path: message => {
                 OnPropertyChanged(nameof(CoinVm));
             });
         }

+ 4 - 4
src/AppViews0/Views/Ucs/CoinKernelSelect.xaml.cs

@@ -9,13 +9,13 @@ namespace NTMiner.Views.Ucs {
             this.Init(vm);
             InitializeComponent();
             this.OnLoaded(window => {
-                window.BuildEventPath<CoinKernelVmAddedEvent>("添加了币种内核后,如果添加的币种内核是当前选中的币种的币种内核则刷新币种内核选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.Normal, path: message => {
-                    if (message.Event.Source.CoinId == vm.Coin.Id) {
+                window.BuildEventPath<CoinKernelAddedEvent>("添加了币种内核后,如果添加的币种内核是当前选中的币种的币种内核则刷新币种内核选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.BelowNormal, path: message => {
+                    if (message.Source.CoinId == vm.Coin.Id) {
                         vm.OnPropertyChanged(nameof(vm.QueryResults));
                     }
                 });
-                window.BuildEventPath<CoinKernelVmRemovedEvent>("删除了币种内核后,如果删除的币种内核是当前选中的币种的币种内核则刷新币种内核选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.Normal, path: message => {
-                    if (message.Event.Source.CoinId == vm.Coin.Id) {
+                window.BuildEventPath<CoinKernelRemovedEvent>("删除了币种内核后,如果删除的币种内核是当前选中的币种的币种内核则刷新币种内核选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.BelowNormal, path: message => {
+                    if (message.Source.CoinId == vm.Coin.Id) {
                         vm.OnPropertyChanged(nameof(vm.QueryResults));
                     }
                 });

+ 2 - 2
src/AppViews0/Views/Ucs/CoinSelect.xaml.cs

@@ -9,11 +9,11 @@ namespace NTMiner.Views.Ucs {
             this.Init(vm);
             InitializeComponent();
             this.OnLoaded(window => {
-                window.BuildEventPath<CoinVmAddedEvent>("添加了币种后,刷新币种选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.Normal, path: message => {
+                window.BuildEventPath<CoinAddedEvent>("添加了币种后,刷新币种选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.BelowNormal, path: message => {
                     vm.OnPropertyChanged(nameof(vm.QueryResults));
                     vm.OnPropertyChanged(nameof(vm.HotCoins));
                 });
-                window.BuildEventPath<CoinVmRemovedEvent>("删除了币种后,刷新币种选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.Normal, path: message => {
+                window.BuildEventPath<CoinRemovedEvent>("删除了币种后,刷新币种选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.BelowNormal, path: message => {
                     vm.OnPropertyChanged(nameof(vm.QueryResults));
                     vm.OnPropertyChanged(nameof(vm.HotCoins));
                 });

+ 5 - 6
src/AppViews0/Views/Ucs/WalletSelect.xaml.cs

@@ -1,5 +1,4 @@
-using NTMiner.Core;
-using NTMiner.Vms;
+using NTMiner.Vms;
 using System.Windows.Controls;
 
 namespace NTMiner.Views.Ucs {
@@ -10,13 +9,13 @@ namespace NTMiner.Views.Ucs {
             this.Init(vm);
             InitializeComponent();
             this.OnLoaded(window => {
-                window.BuildEventPath<WalletVmAddedEvent>("添加了钱包后,如果添加的钱包是当前选中的币种的钱包则刷新钱包选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.Normal, path: message => {
-                    if (message.Event.Source.CoinId == vm.Coin.Id) {
+                window.BuildEventPath<WalletAddedEvent>("添加了钱包后,如果添加的钱包是当前选中的币种的钱包则刷新钱包选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.BelowNormal, path: message => {
+                    if (message.Source.CoinId == vm.Coin.Id) {
                         vm.OnPropertyChanged(nameof(vm.QueryResults));
                     }
                 });
-                window.BuildEventPath<WalletVmRemovedEvent>("删除了钱包后,如果删除的钱包是当前选中的币种的钱包则刷新钱包选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.Normal, path: message => {
-                    if (message.Event.Source.CoinId == vm.Coin.Id) {
+                window.BuildEventPath<WalletRemovedEvent>("删除了钱包后,如果删除的钱包是当前选中的币种的钱包则刷新钱包选择下拉列表的Vm内存", LogEnum.DevConsole, this.GetType(), PathPriority.BelowNormal, path: message => {
+                    if (message.Source.CoinId == vm.Coin.Id) {
                         vm.OnPropertyChanged(nameof(vm.QueryResults));
                     }
                 });

+ 0 - 2
src/NTMinerClient/Core/Impl/ServerContext.cs

@@ -39,8 +39,6 @@ namespace NTMiner.Core.Impl {
             // CoreContext的视图模型集在此事件时刷新
             // 注意,ServerContext有15个Core层集合,所以必定有15个对应的Vm集合订阅该事件
             VirtualRoot.RaiseEvent(new ServerContextReInitedEvent());
-            // CoreContext的视图模型集已全部刷新,此时刷新视图界面
-            VirtualRoot.RaiseEvent(new ServerContextReInitedEventHandledEvent());
         }
 
         /// <summary>

+ 0 - 5
src/NTMinerClient/Messages.cs

@@ -61,11 +61,6 @@ namespace NTMiner {
         public ServerContextReInitedEvent() { }
     }
 
-    [MessageType(description: "处理了ServerContext重新初始化后事件后")]
-    public class ServerContextReInitedEventHandledEvent : EventBase {
-        public ServerContextReInitedEventHandledEvent() { }
-    }
-
     [MessageType(description: "LocalContext重新初始化后")]
     public class LocalContextReInitedEvent : EventBase {
         public LocalContextReInitedEvent() { }