ntminer 6 years ago
parent
commit
bc84072a16
99 changed files with 495 additions and 544 deletions
  1. 4 4
      src/AppModels/AppContext.cs
  2. 5 5
      src/AppModels/AppContext.partials.CoinGroupViewModels.cs
  3. 8 8
      src/AppModels/AppContext.partials.CoinKernelViewModels.cs
  4. 5 5
      src/AppModels/AppContext.partials.CoinProfileViewModels.cs
  5. 10 10
      src/AppModels/AppContext.partials.CoinViewModels.cs
  6. 6 6
      src/AppModels/AppContext.partials.ColumnsShowViewModels.cs
  7. 8 8
      src/AppModels/AppContext.partials.FileWriterViewModels.cs
  8. 8 8
      src/AppModels/AppContext.partials.FragmentWriterViewModels.cs
  9. 3 3
      src/AppModels/AppContext.partials.GpuProfileViewModels.cs
  10. 14 14
      src/AppModels/AppContext.partials.GpuSpeedViewModels.cs
  11. 8 8
      src/AppModels/AppContext.partials.GpuViewModels.cs
  12. 8 8
      src/AppModels/AppContext.partials.GroupViewModels.cs
  13. 8 8
      src/AppModels/AppContext.partials.KernelInputViewModels.cs
  14. 8 8
      src/AppModels/AppContext.partials.KernelOutputKeywordViewModels.cs
  15. 8 8
      src/AppModels/AppContext.partials.KernelOutputTranslaterViewModels.cs
  16. 8 8
      src/AppModels/AppContext.partials.KernelOutputViewModels.cs
  17. 8 8
      src/AppModels/AppContext.partials.KernelViewModels.cs
  18. 6 6
      src/AppModels/AppContext.partials.MineWorkViewModels.cs
  19. 6 6
      src/AppModels/AppContext.partials.MinerGroupViewModels.cs
  20. 8 8
      src/AppModels/AppContext.partials.NTMinerWalletViewModels.cs
  21. 8 8
      src/AppModels/AppContext.partials.OverClockDataViewModels.cs
  22. 8 8
      src/AppModels/AppContext.partials.PackageViewModels.cs
  23. 8 10
      src/AppModels/AppContext.partials.PoolKernelViewModels.cs
  24. 4 5
      src/AppModels/AppContext.partials.PoolProfileViewModels.cs
  25. 8 8
      src/AppModels/AppContext.partials.PoolViewModels.cs
  26. 2 2
      src/AppModels/AppContext.partials.ShareViewModels.cs
  27. 8 8
      src/AppModels/AppContext.partials.SysDicItemViewModels.cs
  28. 8 8
      src/AppModels/AppContext.partials.SysDicViewModels.cs
  29. 6 6
      src/AppModels/AppContext.partials.UserViewModels.cs
  30. 7 7
      src/AppModels/AppContext.partials.WalletViewModels.cs
  31. 0 1
      src/AppModels/View/AbstractAppViewFactory.cs
  32. 1 1
      src/AppModels/Vms/KernelOutputKeywordsViewModel.cs
  33. 3 3
      src/AppModels/Vms/LocalMessagesViewModel.cs
  34. 6 6
      src/AppModels/Vms/MinerProfileViewModel.cs
  35. 3 3
      src/AppModels/Vms/ServerMessagesViewModel.cs
  36. 1 1
      src/AppModels/Vms/StartStopMineButtonViewModel.cs
  37. 62 61
      src/AppViews0/AppViewFactory.cs
  38. 2 2
      src/AppViews0/ChartsWindow.xaml.cs
  39. 4 4
      src/AppViews0/KernelsWindow.xaml.cs
  40. 11 11
      src/AppViews0/MainWindow.xaml.cs
  41. 4 4
      src/AppViews0/MinerClientsWindow.xaml.cs
  42. 4 4
      src/AppViews0/Ucs/Calc.xaml.cs
  43. 2 2
      src/AppViews0/Ucs/CalcConfig.xaml.cs
  44. 2 2
      src/AppViews0/Ucs/InnerProperty.xaml.cs
  45. 2 2
      src/AppViews0/Ucs/LocalIpConfig.xaml.cs
  46. 2 2
      src/AppViews0/Ucs/MinerClientUc.xaml.cs
  47. 2 2
      src/AppViews0/Ucs/MinerProfileDual.xaml.cs
  48. 2 2
      src/AppViews0/Ucs/MinerProfileIndex.xaml.cs
  49. 2 2
      src/AppViews0/Ucs/ServerMessages.xaml.cs
  50. 2 2
      src/AppViews0/Ucs/SpeedCharts.xaml.cs
  51. 12 12
      src/AppViews0/Ucs/StateBar.xaml.cs
  52. 1 1
      src/CalcConfigUpdater/Program.cs
  53. 14 14
      src/MinerClient/App.xaml.cs
  54. 4 4
      src/MinerStudio/App.xaml.cs
  55. 1 1
      src/NTMinerClient/Core/Cpus/Impl/CpuPackage.cs
  56. 3 3
      src/NTMinerClient/Core/Gpus/Impl/GpusSpeed.cs
  57. 3 3
      src/NTMinerClient/Core/Gpus/Impl/TempGruarder.cs
  58. 2 2
      src/NTMinerClient/Core/Impl/CalcConfigSet.cs
  59. 2 2
      src/NTMinerClient/Core/Impl/CoinGroupSet.cs
  60. 3 3
      src/NTMinerClient/Core/Impl/CoinSet.cs
  61. 3 3
      src/NTMinerClient/Core/Impl/FileWriterSet.cs
  62. 3 3
      src/NTMinerClient/Core/Impl/FragmentWriterSet.cs
  63. 3 3
      src/NTMinerClient/Core/Impl/GroupSet.cs
  64. 4 4
      src/NTMinerClient/Core/Impl/PoolSet.cs
  65. 4 4
      src/NTMinerClient/Core/Impl/ServerContext.cs
  66. 3 3
      src/NTMinerClient/Core/Impl/SysDicItemSet.cs
  67. 3 3
      src/NTMinerClient/Core/Impl/SysDicSet.cs
  68. 5 5
      src/NTMinerClient/Core/Kernels/Impl/CoinKernelSet.cs
  69. 3 3
      src/NTMinerClient/Core/Kernels/Impl/KernelInputSet.cs
  70. 3 3
      src/NTMinerClient/Core/Kernels/Impl/KernelOutputSet.cs
  71. 3 3
      src/NTMinerClient/Core/Kernels/Impl/KernelOutputTranslaterSet.cs
  72. 3 3
      src/NTMinerClient/Core/Kernels/Impl/KernelSet.cs
  73. 3 3
      src/NTMinerClient/Core/Kernels/Impl/PackageSet.cs
  74. 3 3
      src/NTMinerClient/Core/Kernels/Impl/PoolKernelSet.cs
  75. 3 3
      src/NTMinerClient/Core/MinerServer/Impl/ColumnsShowSet.cs
  76. 3 3
      src/NTMinerClient/Core/MinerServer/Impl/MineWorkSet.cs
  77. 3 3
      src/NTMinerClient/Core/MinerServer/Impl/MinerGroupSet.cs
  78. 3 3
      src/NTMinerClient/Core/MinerServer/Impl/NTMinerWalletSet.cs
  79. 3 3
      src/NTMinerClient/Core/MinerServer/Impl/OverClockDataSet.cs
  80. 2 3
      src/NTMinerClient/Core/MinerServer/Impl/ServerAppSettingSet.cs
  81. 3 3
      src/NTMinerClient/Core/MinerServer/Impl/UserSet.cs
  82. 2 2
      src/NTMinerClient/Core/Profiles/Impl/GpuProfileSet.cs
  83. 3 3
      src/NTMinerClient/Core/Profiles/Impl/WalletSet.cs
  84. 2 2
      src/NTMinerClient/IServerContext.cs
  85. 0 6
      src/NTMinerClient/Messages.cs
  86. 6 6
      src/NTMinerClient/NTMinerRoot.cs
  87. 3 3
      src/NTMinerClient/NTMinerRoot.partials.MinerProcess.cs
  88. 5 5
      src/NTMinerClient/Report.cs
  89. 1 1
      src/NTMinerDaemon/HostRoot.cs
  90. 3 3
      src/NTMinerRpcClient/KernelOutputKeyword/KernelOutputKeywordSet.cs
  91. 5 5
      src/NTMinerRpcClient/ServerMessage/ServerMessageSet.cs
  92. 1 1
      src/NTMinerServices/Data/Impl/ClientSet.cs
  93. 4 6
      src/NTMinerServices/Data/Impl/CoinSnapshotSet.cs
  94. 3 4
      src/NTMinerServices/Data/Impl/UserSet.cs
  95. 4 4
      src/NTMinerWpf/WindowExtension.cs
  96. 1 1
      src/NTMinerlib/AppSetting/LocalAppSettingSet.cs
  97. 2 2
      src/NTMinerlib/LocalMessage/LocalMessageSet.cs
  98. 1 1
      src/NTMinerlib/Net/LocalIpSet.cs
  99. 7 43
      src/NTMinerlib/VirtualRoot.partials.Hub.cs

+ 4 - 4
src/AppModels/AppContext.cs

@@ -24,16 +24,16 @@ namespace NTMiner {
 
         #region static methods
         // 因为是上下文路径,无需返回路径标识
-        public static void BuildCmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action)
+        public static void AddCmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action, Type location)
             where TCmd : ICmd {
-            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, borderType: typeof(AppContext));
+            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, location);
             _contextHandlers.Add(messagePathId);
         }
 
         // 因为是上下文路径,无需返回路径标识
-        public static void BuildEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action)
+        public static void AddEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action, Type location)
             where TEvent : IEvent {
-            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, borderType: typeof(AppContext));
+            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, location);
             _contextHandlers.Add(messagePathId);
         }
 

+ 5 - 5
src/AppModels/AppContext.partials.CoinGroupViewModels.cs

@@ -20,8 +20,8 @@ namespace NTMiner {
                         _dicById.Clear();
                         _listByGroupId.Clear();
                         Init();
-                    });
-                BuildEventPath<CoinGroupAddedEvent>("添加了币组后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<CoinGroupAddedEvent>("添加了币组后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             CoinGroupViewModel coinGroupVm = new CoinGroupViewModel(message.Target);
@@ -32,8 +32,8 @@ namespace NTMiner {
                             _listByGroupId[coinGroupVm.GroupId].Add(coinGroupVm);
                             OnGroupPropertyChanged(coinGroupVm.GroupId);
                         }
-                    });
-                BuildEventPath<CoinGroupRemovedEvent>("删除了币组后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<CoinGroupRemovedEvent>("删除了币组后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             var entity = _dicById[message.Target.GetId()];
@@ -43,7 +43,7 @@ namespace NTMiner {
                             }
                             OnGroupPropertyChanged(entity.GroupId);
                         }
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 8 - 8
src/AppModels/AppContext.partials.CoinKernelViewModels.cs

@@ -18,12 +18,12 @@ namespace NTMiner {
                     action: message => {
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         OnPropertyChanged(nameof(AllCoinKernels));
-                    });
-                BuildEventPath<CoinKernelAddedEvent>("添加了币种内核后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<CoinKernelAddedEvent>("添加了币种内核后刷新VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         var coinKernelVm = new CoinKernelViewModel(message.Target);
                         _dicById.Add(message.Target.GetId(), coinKernelVm);
@@ -40,8 +40,8 @@ namespace NTMiner {
                             kernelVm.OnPropertyChanged(nameof(kernelVm.SupportedCoinVms));
                             kernelVm.OnPropertyChanged(nameof(kernelVm.SupportedCoins));
                         }
-                    });
-                BuildEventPath<CoinKernelUpdatedEvent>("更新了币种内核后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<CoinKernelUpdatedEvent>("更新了币种内核后刷新VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         CoinKernelViewModel entity = _dicById[message.Target.GetId()];
                         var supportedGpu = entity.SupportedGpu;
@@ -58,8 +58,8 @@ namespace NTMiner {
                             var kernelVm = entity.Kernel;
                             kernelVm.OnPropertyChanged(nameof(kernelVm.CoinKernels));
                         }
-                    });
-                BuildEventPath<CoinKernelRemovedEvent>("移除了币种内核后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<CoinKernelRemovedEvent>("移除了币种内核后刷新VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (_dicById.TryGetValue(message.Target.GetId(), out CoinKernelViewModel coinKernelVm)) {
                             _dicById.Remove(message.Target.GetId());
@@ -75,7 +75,7 @@ namespace NTMiner {
                             kernelVm.OnPropertyChanged(nameof(kernelVm.SupportedCoinVms));
                             kernelVm.OnPropertyChanged(nameof(kernelVm.SupportedCoins));
                         }
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 5 - 5
src/AppModels/AppContext.partials.CoinProfileViewModels.cs

@@ -15,23 +15,23 @@ namespace NTMiner {
 #if DEBUG
                 Write.Stopwatch.Start();
 #endif
-                BuildEventPath<CoinKernelProfilePropertyChangedEvent>("币种内核设置变更后刷新VM内存", LogEnum.DevConsole,
+                AddEventPath<CoinKernelProfilePropertyChangedEvent>("币种内核设置变更后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_coinKernelProfileDicById.ContainsKey(message.CoinKernelId)) {
                             _coinKernelProfileDicById[message.CoinKernelId].OnPropertyChanged(message.PropertyName);
                         }
-                    });
-                BuildEventPath<CoinProfilePropertyChangedEvent>("币种设置变更后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<CoinProfilePropertyChangedEvent>("币种设置变更后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_coinProfileDicById.ContainsKey(message.CoinId)) {
                             _coinProfileDicById[message.CoinId].OnPropertyChanged(message.PropertyName);
                         }
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<LocalContextReInitedEvent>("LocalContext刷新后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         _coinKernelProfileDicById.Clear();
                         _coinProfileDicById.Clear();
-                    });
+                    }, location: this.GetType());
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();
                 if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {

+ 10 - 10
src/AppModels/AppContext.partials.CoinViewModels.cs

@@ -23,24 +23,24 @@ namespace NTMiner {
                     action: message => {
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         AllPropertyChanged();
-                    });
-                BuildEventPath<CoinAddedEvent>("添加了币种后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<CoinAddedEvent>("添加了币种后刷新VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Add(message.Target.GetId(), new CoinViewModel(message.Target));
                         AppContext.Instance.MinerProfileVm.OnPropertyChanged(nameof(NTMiner.AppContext.Instance.MinerProfileVm.CoinVm));
                         AllPropertyChanged();
-                    });
-                BuildEventPath<CoinRemovedEvent>("移除了币种后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<CoinRemovedEvent>("移除了币种后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById.Remove(message.Target.GetId());
                         AppContext.Instance.MinerProfileVm.OnPropertyChanged(nameof(NTMiner.AppContext.Instance.MinerProfileVm.CoinVm));
                         AllPropertyChanged();
-                    });
-                BuildEventPath<CoinUpdatedEvent>("更新了币种后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<CoinUpdatedEvent>("更新了币种后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         CoinViewModel coinVm = _dicById[message.Target.GetId()];
                         bool justAsDualCoin = coinVm.JustAsDualCoin;
@@ -60,8 +60,8 @@ namespace NTMiner {
                         if (justAsDualCoin != coinVm.JustAsDualCoin) {
                             OnPropertyChanged(nameof(MainCoins));
                         }
-                    });
-                BuildEventPath<CoinIconDownloadedEvent>("下载了币种图标后", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<CoinIconDownloadedEvent>("下载了币种图标后", LogEnum.DevConsole,
                     action: message => {
                         try {
                             if (string.IsNullOrEmpty(message.Target.Icon)) {
@@ -84,7 +84,7 @@ namespace NTMiner {
                         catch (Exception e) {
                             Logger.ErrorDebugLine(e);
                         }
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 6 - 6
src/AppModels/AppContext.partials.ColumnsShowViewModels.cs

@@ -21,7 +21,7 @@ namespace NTMiner {
                 this.Add = new DelegateCommand(() => {
                     new ColumnsShowViewModel(Guid.NewGuid()).Edit.Execute(FormType.Add);
                 });
-                BuildEventPath<ColumnsShowAddedEvent>("添加了列显后刷新VM内存", LogEnum.DevConsole,
+                AddEventPath<ColumnsShowAddedEvent>("添加了列显后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             ColumnsShowViewModel vm = new ColumnsShowViewModel(message.Target);
@@ -29,20 +29,20 @@ namespace NTMiner {
                             OnPropertyChanged(nameof(List));
                             AppContext.Instance.MinerClientsWindowVm.ColumnsShow = vm;
                         }
-                    });
-                BuildEventPath<ColumnsShowUpdatedEvent>("更新了列显后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<ColumnsShowUpdatedEvent>("更新了列显后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             ColumnsShowViewModel entity = _dicById[message.Target.GetId()];
                             entity.Update(message.Target);
                         }
-                    });
-                BuildEventPath<ColumnsShowRemovedEvent>("移除了列显后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<ColumnsShowRemovedEvent>("移除了列显后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         AppContext.Instance.MinerClientsWindowVm.ColumnsShow = _dicById.Values.FirstOrDefault();
                         _dicById.Remove(message.Target.GetId());
                         OnPropertyChanged(nameof(List));
-                    });
+                    }, location: this.GetType());
                 foreach (var item in NTMinerRoot.Instance.ColumnsShowSet.AsEnumerable()) {
                     _dicById.Add(item.GetId(), new ColumnsShowViewModel(item));
                 }

+ 8 - 8
src/AppModels/AppContext.partials.FileWriterViewModels.cs

@@ -22,31 +22,31 @@ namespace NTMiner {
                     action: message => {
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         OnPropertyChangeds();
-                    });
-                BuildEventPath<FileWriterAddedEvent>("添加了文件书写器后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<FileWriterAddedEvent>("添加了文件书写器后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             FileWriterViewModel groupVm = new FileWriterViewModel(message.Target);
                             _dicById.Add(message.Target.GetId(), groupVm);
                             OnPropertyChangeds();
                         }
-                    });
-                BuildEventPath<FileWriterUpdatedEvent>("更新了文件书写器后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<FileWriterUpdatedEvent>("更新了文件书写器后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             FileWriterViewModel entity = _dicById[message.Target.GetId()];
                             entity.Update(message.Target);
                         }
-                    });
-                BuildEventPath<FileWriterRemovedEvent>("删除了文件书写器后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<FileWriterRemovedEvent>("删除了文件书写器后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Remove(message.Target.GetId());
                         OnPropertyChangeds();
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 8 - 8
src/AppModels/AppContext.partials.FragmentWriterViewModels.cs

@@ -22,31 +22,31 @@ namespace NTMiner {
                     action: message => {
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         OnPropertyChangeds();
-                    });
-                BuildEventPath<FragmentWriterAddedEvent>("添加了命令行片段书写器后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<FragmentWriterAddedEvent>("添加了命令行片段书写器后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             FragmentWriterViewModel groupVm = new FragmentWriterViewModel(message.Target);
                             _dicById.Add(message.Target.GetId(), groupVm);
                             OnPropertyChangeds();
                         }
-                    });
-                BuildEventPath<FragmentWriterUpdatedEvent>("更新了命令行片段书写器后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<FragmentWriterUpdatedEvent>("更新了命令行片段书写器后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             FragmentWriterViewModel entity = _dicById[message.Target.GetId()];
                             entity.Update(message.Target);
                         }
-                    });
-                BuildEventPath<FragmentWriterRemovedEvent>("删除了命令行片段书写器后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<FragmentWriterRemovedEvent>("删除了命令行片段书写器后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Remove(message.Target.GetId());
                         OnPropertyChangeds();
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 3 - 3
src/AppModels/AppContext.partials.GpuProfileViewModels.cs

@@ -28,8 +28,8 @@ namespace NTMiner {
                             coinVm.OnOverClockPropertiesChanges();
                             VirtualRoot.Execute(new CoinOverClockCommand(coinVm.Id));
                         }
-                    });
-                BuildEventPath<GpuProfileAddedOrUpdatedEvent>("添加或更新了Gpu超频数据后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<GpuProfileAddedOrUpdatedEvent>("添加或更新了Gpu超频数据后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         lock (_locker) {
                             if (_listByCoinId.TryGetValue(message.Target.CoinId, out List<GpuProfileViewModel> list)) {
@@ -61,7 +61,7 @@ namespace NTMiner {
                                 _listByCoinId.Add(message.Target.CoinId, list);
                             }
                         }
-                    });
+                    }, location: this.GetType());
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();
                 if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {

+ 14 - 14
src/AppModels/AppContext.partials.GpuSpeedViewModels.cs

@@ -51,7 +51,7 @@ namespace NTMiner {
                     this._list.Add(new GpuSpeedViewModel(item));
                 }
                 _totalSpeedVm = this._list.FirstOrDefault(a => a.GpuVm.Index == NTMinerRoot.GpuAllId);
-                BuildEventPath<GpuShareChangedEvent>("显卡份额变更后刷新VM内存", LogEnum.DevConsole,
+                AddEventPath<GpuShareChangedEvent>("显卡份额变更后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         ResetIfMainCoinSwitched();
                         int index = message.Target.Gpu.Index;
@@ -61,8 +61,8 @@ namespace NTMiner {
                             gpuSpeedVm.MainCoinSpeed.AcceptShare = message.Target.MainCoinSpeed.AcceptShare;
                             gpuSpeedVm.MainCoinSpeed.RejectShare = message.Target.MainCoinSpeed.RejectShare;
                         }
-                    });
-                BuildEventPath<FoundShareIncreasedEvent>("找到一个份额后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<FoundShareIncreasedEvent>("找到一个份额后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         ResetIfMainCoinSwitched();
                         int index = message.Target.Gpu.Index;
@@ -70,8 +70,8 @@ namespace NTMiner {
                         if (gpuSpeedVm != null) {
                             gpuSpeedVm.MainCoinSpeed.FoundShare = message.Target.MainCoinSpeed.FoundShare;
                         }
-                    });
-                BuildEventPath<AcceptShareIncreasedEvent>("接受一个份额后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<AcceptShareIncreasedEvent>("接受一个份额后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         ResetIfMainCoinSwitched();
                         int index = message.Target.Gpu.Index;
@@ -79,8 +79,8 @@ namespace NTMiner {
                         if (gpuSpeedVm != null) {
                             gpuSpeedVm.MainCoinSpeed.AcceptShare = message.Target.MainCoinSpeed.AcceptShare;
                         }
-                    });
-                BuildEventPath<RejectShareIncreasedEvent>("拒绝一个份额后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<RejectShareIncreasedEvent>("拒绝一个份额后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         ResetIfMainCoinSwitched();
                         int index = message.Target.Gpu.Index;
@@ -88,8 +88,8 @@ namespace NTMiner {
                         if (gpuSpeedVm != null) {
                             gpuSpeedVm.MainCoinSpeed.RejectShare = message.Target.MainCoinSpeed.RejectShare;
                         }
-                    });
-                BuildEventPath<IncorrectShareIncreasedEvent>("产生一个错误份额后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<IncorrectShareIncreasedEvent>("产生一个错误份额后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         ResetIfMainCoinSwitched();
                         int index = message.Target.Gpu.Index;
@@ -97,8 +97,8 @@ namespace NTMiner {
                         if (gpuSpeedVm != null) {
                             gpuSpeedVm.MainCoinSpeed.IncorrectShare = message.Target.MainCoinSpeed.IncorrectShare;
                         }
-                    });
-                BuildEventPath<GpuSpeedChangedEvent>("显卡算力变更后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<GpuSpeedChangedEvent>("显卡算力变更后刷新VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         ResetIfMainCoinSwitched();
                         int index = message.Target.Gpu.Index;
@@ -140,12 +140,12 @@ namespace NTMiner {
                                 }
                             }
                         }
-                    });
-                BuildEventPath<Per1SecondEvent>("每秒钟更新算力活动时间", LogEnum.None,
+                    }, location: this.GetType());
+                AddEventPath<Per1SecondEvent>("每秒钟更新算力活动时间", LogEnum.None,
                     action: message => {
                         TotalSpeedVm.MainCoinSpeed.OnPropertyChanged(nameof(SpeedViewModel.LastSpeedOnText));
                         TotalSpeedVm.DualCoinSpeed.OnPropertyChanged(nameof(SpeedViewModel.LastSpeedOnText));
-                    });
+                    }, location: this.GetType());
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();
                 if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {

+ 8 - 8
src/AppModels/AppContext.partials.GpuViewModels.cs

@@ -31,27 +31,27 @@ namespace NTMiner {
                 else {
                     _gpuAllVm = new GpuViewModel(Gpu.GpuAll);
                 }
-                BuildEventPath<EPriceChangedEvent>("电价变更后更新电费显示", LogEnum.DevConsole,
+                AddEventPath<EPriceChangedEvent>("电价变更后更新电费显示", LogEnum.DevConsole,
                     action: message => {
                         foreach (var gpuVm in _gpuVms.Values) {
                             gpuVm.OnPropertyChanged(nameof(GpuViewModel.EChargeText));
                         }
                         AppContext.Instance.GpuSpeedVms.OnPropertyChanged(nameof(GpuSpeedViewModels.ProfitCnyPerDayText));
-                    });
-                BuildEventPath<MaxTempChangedEvent>("高温红色阈值变更后更新显卡温度颜色", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<MaxTempChangedEvent>("高温红色阈值变更后更新显卡温度颜色", LogEnum.DevConsole,
                     action: message => {
                         foreach (var gpuVm in _gpuVms.Values) {
                             gpuVm.OnPropertyChanged(nameof(GpuViewModel.TemperatureForeground));
                         }
-                    });
-                BuildEventPath<PowerAppendChangedEvent>("功耗补偿变更后更新功耗显示", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<PowerAppendChangedEvent>("功耗补偿变更后更新功耗显示", LogEnum.DevConsole,
                     action: message => {
                         foreach (var gpuVm in _gpuVms.Values) {
                             gpuVm.OnPropertyChanged(nameof(GpuViewModel.PowerUsageWText));
                         }
                         AppContext.Instance.GpuSpeedVms.OnPropertyChanged(nameof(GpuSpeedViewModels.ProfitCnyPerDayText));
-                    });
-                BuildEventPath<GpuStateChangedEvent>("显卡状态变更后刷新VM内存", LogEnum.None,
+                    }, location: this.GetType());
+                AddEventPath<GpuStateChangedEvent>("显卡状态变更后刷新VM内存", LogEnum.None,
                     action: message => {
                         if (_gpuVms.ContainsKey(message.Target.Index)) {
                             GpuViewModel vm = _gpuVms[message.Target.Index];
@@ -95,7 +95,7 @@ namespace NTMiner {
                             }
                             UpdateMinMax();
                         }
-                    });
+                    }, location: this.GetType());
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();
                 if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {

+ 8 - 8
src/AppModels/AppContext.partials.GroupViewModels.cs

@@ -24,20 +24,20 @@ namespace NTMiner {
                     action: message => {
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         OnPropertyChangeds();
-                    });
-                BuildEventPath<GroupAddedEvent>("添加了组后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<GroupAddedEvent>("添加了组后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             GroupViewModel groupVm = new GroupViewModel(message.Target);
                             _dicById.Add(message.Target.GetId(), groupVm);
                             OnPropertyChangeds();
                         }
-                    });
-                BuildEventPath<GroupUpdatedEvent>("更新了组后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<GroupUpdatedEvent>("更新了组后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             GroupViewModel entity = _dicById[message.Target.GetId()];
@@ -48,12 +48,12 @@ namespace NTMiner {
                                 OnPropertyChanged(nameof(SelectionOptions));
                             }
                         }
-                    });
-                BuildEventPath<GroupRemovedEvent>("删除了组后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<GroupRemovedEvent>("删除了组后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Remove(message.Target.GetId());
                         OnPropertyChangeds();
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 8 - 8
src/AppModels/AppContext.partials.KernelInputViewModels.cs

@@ -18,18 +18,18 @@ namespace NTMiner {
                     action: message => {
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         OnPropertyChangeds();
-                    });
-                BuildEventPath<KernelInputAddedEvent>("添加了内核输入后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelInputAddedEvent>("添加了内核输入后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         var vm = new KernelInputViewModel(message.Target);
                         _dicById.Add(message.Target.GetId(), vm);
                         OnPropertyChangeds();
-                    });
-                BuildEventPath<KernelInputUpdatedEvent>("更新了内核输入后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelInputUpdatedEvent>("更新了内核输入后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             var item = _dicById[message.Target.GetId()];
@@ -50,14 +50,14 @@ namespace NTMiner {
                                 }
                             }
                         }
-                    });
-                BuildEventPath<KernelInputRemovedEvent>("移除了内核输入后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelInputRemovedEvent>("移除了内核输入后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             _dicById.Remove(message.Target.GetId());
                             OnPropertyChangeds();
                         }
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 8 - 8
src/AppModels/AppContext.partials.KernelOutputKeywordViewModels.cs

@@ -14,7 +14,7 @@ namespace NTMiner {
 #if DEBUG
                 Write.Stopwatch.Start();
 #endif
-                BuildEventPath<KernelOutputKeywordLoadedEvent>("从服务器加载了内核输入关键字后刷新Vm集", LogEnum.DevConsole,
+                AddEventPath<KernelOutputKeywordLoadedEvent>("从服务器加载了内核输入关键字后刷新Vm集", LogEnum.DevConsole,
                     action: message => {
                         KernelOutputKeywordViewModel[] toRemoves = _dicById.Where(a => a.Value.DataLevel == DataLevel.Global).Select(a => a.Value).ToArray();
                         foreach (var item in toRemoves) {
@@ -42,8 +42,8 @@ namespace NTMiner {
                                 kernelOutputVm.OnPropertyChanged(nameof(kernelOutputVm.KernelOutputKeywords));
                             }
                         }
-                    });
-                BuildEventPath<UserKernelOutputKeywordAddedEvent>("添加了内核输出过滤器后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<UserKernelOutputKeywordAddedEvent>("添加了内核输出过滤器后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             KernelOutputKeywordViewModel vm = new KernelOutputKeywordViewModel(message.Target);
@@ -56,14 +56,14 @@ namespace NTMiner {
                                 kernelOutputVm.OnPropertyChanged(nameof(kernelOutputVm.KernelOutputKeywords));
                             }
                         }
-                    });
-                BuildEventPath<UserKernelOutputKeywordUpdatedEvent>("更新了内核输出过滤器后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<UserKernelOutputKeywordUpdatedEvent>("更新了内核输出过滤器后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_dicById.TryGetValue(message.Target.GetId(), out KernelOutputKeywordViewModel vm)) {
                             vm.Update(message.Target);
                         }
-                    });
-                BuildEventPath<UserKernelOutputKeywordRemovedEvent>("删除了内核输出过滤器后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<UserKernelOutputKeywordRemovedEvent>("删除了内核输出过滤器后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_dicById.TryGetValue(message.Target.GetId(), out KernelOutputKeywordViewModel vm)) {
                             _dicById.Remove(vm.Id);
@@ -72,7 +72,7 @@ namespace NTMiner {
                                 kernelOutputVm.OnPropertyChanged(nameof(kernelOutputVm.KernelOutputKeywords));
                             }
                         }
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 8 - 8
src/AppModels/AppContext.partials.KernelOutputTranslaterViewModels.cs

@@ -20,12 +20,12 @@ namespace NTMiner {
                         _dicById.Clear();
                         _dicByKernelOutputId.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         OnPropertyChanged(nameof(AllKernelOutputTranslaterVms));
-                    });
-                BuildEventPath<KernelOutputTranslaterAddedEvent>("添加了内核输出翻译器后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelOutputTranslaterAddedEvent>("添加了内核输出翻译器后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (AppContext.Instance.KernelOutputVms.TryGetKernelOutputVm(message.Target.KernelOutputId, out KernelOutputViewModel kernelOutputVm)) {
                             if (!_dicByKernelOutputId.ContainsKey(message.Target.KernelOutputId)) {
@@ -36,8 +36,8 @@ namespace NTMiner {
                             _dicById.Add(message.Target.GetId(), vm);
                             kernelOutputVm.OnPropertyChanged(nameof(kernelOutputVm.KernelOutputTranslaters));
                         }
-                    });
-                BuildEventPath<KernelOutputTranslaterUpdatedEvent>("更新了内核输出翻译器后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelOutputTranslaterUpdatedEvent>("更新了内核输出翻译器后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_dicByKernelOutputId.ContainsKey(message.Target.KernelOutputId)) {
                             var item = _dicByKernelOutputId[message.Target.KernelOutputId].FirstOrDefault(a => a.Id == message.Target.GetId());
@@ -45,8 +45,8 @@ namespace NTMiner {
                                 item.Update(message.Target);
                             }
                         }
-                    });
-                BuildEventPath<KernelOutputTranslaterRemovedEvent>("移除了内核输出翻译器后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelOutputTranslaterRemovedEvent>("移除了内核输出翻译器后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_dicByKernelOutputId.ContainsKey(message.Target.KernelOutputId)) {
                             var item = _dicByKernelOutputId[message.Target.KernelOutputId].FirstOrDefault(a => a.Id == message.Target.GetId());
@@ -60,7 +60,7 @@ namespace NTMiner {
                         if (AppContext.Instance.KernelOutputVms.TryGetKernelOutputVm(message.Target.KernelOutputId, out KernelOutputViewModel kernelOutputVm)) {
                             kernelOutputVm.OnPropertyChanged(nameof(kernelOutputVm.KernelOutputTranslaters));
                         }
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 8 - 8
src/AppModels/AppContext.partials.KernelOutputViewModels.cs

@@ -18,19 +18,19 @@ namespace NTMiner {
                     action: message => {
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         AllPropertyChanged();
-                    });
-                BuildEventPath<KernelOutputAddedEvent>("添加了内核输出组后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelOutputAddedEvent>("添加了内核输出组后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         var vm = new KernelOutputViewModel(message.Target);
                         _dicById.Add(message.Target.GetId(), vm);
                         OnPropertyChanged(nameof(AllKernelOutputVms));
                         OnPropertyChanged(nameof(PleaseSelectVms));
-                    });
-                BuildEventPath<KernelOutputUpdatedEvent>("更新了内核输出组后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelOutputUpdatedEvent>("更新了内核输出组后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             var item = _dicById[message.Target.GetId()];
@@ -38,15 +38,15 @@ namespace NTMiner {
                                 item.Update(message.Target);
                             }
                         }
-                    });
-                BuildEventPath<KernelOutputRemovedEvent>("移除了内核输出组后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelOutputRemovedEvent>("移除了内核输出组后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             _dicById.Remove(message.Target.GetId());
                             OnPropertyChanged(nameof(AllKernelOutputVms));
                             OnPropertyChanged(nameof(PleaseSelectVms));
                         }
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 8 - 8
src/AppModels/AppContext.partials.KernelViewModels.cs

@@ -23,28 +23,28 @@ namespace NTMiner {
                     action: message => {
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         OnPropertyChanged(nameof(AllKernels));
-                    });
-                BuildEventPath<KernelAddedEvent>("添加了内核后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelAddedEvent>("添加了内核后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Add(message.Target.GetId(), new KernelViewModel(message.Target));
                         OnPropertyChanged(nameof(AllKernels));
                         foreach (var coinKernelVm in AppContext.Instance.CoinKernelVms.AllCoinKernels.Where(a => a.KernelId == message.Target.GetId())) {
                             coinKernelVm.OnPropertyChanged(nameof(coinKernelVm.IsSupportDualMine));
                         }
-                    });
-                BuildEventPath<KernelRemovedEvent>("删除了内核后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelRemovedEvent>("删除了内核后调整VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById.Remove(message.Target.GetId());
                         OnPropertyChanged(nameof(AllKernels));
                         foreach (var coinKernelVm in AppContext.Instance.CoinKernelVms.AllCoinKernels.Where(a => a.KernelId == message.Target.GetId())) {
                             coinKernelVm.OnPropertyChanged(nameof(coinKernelVm.IsSupportDualMine));
                         }
-                    });
-                BuildEventPath<KernelUpdatedEvent>("更新了内核后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<KernelUpdatedEvent>("更新了内核后调整VM内存", LogEnum.DevConsole,
                     action: message => {
                         var entity = _dicById[message.Target.GetId()];
                         PublishStatus publishStatus = entity.PublishState;
@@ -60,7 +60,7 @@ namespace NTMiner {
                         if (kernelInputId != entity.KernelInputId) {
                             NTMinerRoot.RefreshArgsAssembly.Invoke();
                         }
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 6 - 6
src/AppModels/AppContext.partials.MineWorkViewModels.cs

@@ -25,7 +25,7 @@ namespace NTMiner {
                 this.Add = new DelegateCommand(() => {
                     new MineWorkViewModel(Guid.NewGuid()).Edit.Execute(FormType.Add);
                 });
-                BuildEventPath<MineWorkAddedEvent>("添加作业后刷新VM内存", LogEnum.DevConsole,
+                AddEventPath<MineWorkAddedEvent>("添加作业后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             _dicById.Add(message.Target.GetId(), new MineWorkViewModel(message.Target));
@@ -35,12 +35,12 @@ namespace NTMiner {
                                 AppContext.Instance.MinerClientsWindowVm.SelectedMineWork = MineWorkViewModel.PleaseSelect;
                             }
                         }
-                    });
-                BuildEventPath<MineWorkUpdatedEvent>("更新作业后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<MineWorkUpdatedEvent>("更新作业后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById[message.Target.GetId()].Update(message.Target);
-                    });
-                BuildEventPath<MineWorkRemovedEvent>("删除作业后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<MineWorkRemovedEvent>("删除作业后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById.Remove(message.Target.GetId());
                         OnPropertyChanged(nameof(List));
@@ -48,7 +48,7 @@ namespace NTMiner {
                         if (message.Target.GetId() == AppContext.Instance.MinerClientsWindowVm.SelectedMineWork.GetId()) {
                             AppContext.Instance.MinerClientsWindowVm.SelectedMineWork = MineWorkViewModel.PleaseSelect;
                         }
-                    });
+                    }, location: this.GetType());
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();
                 if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {

+ 6 - 6
src/AppModels/AppContext.partials.MinerGroupViewModels.cs

@@ -26,7 +26,7 @@ namespace NTMiner {
                 this.Add = new DelegateCommand(() => {
                     new MinerGroupViewModel(Guid.NewGuid()).Edit.Execute(FormType.Add);
                 });
-                BuildEventPath<MinerGroupAddedEvent>("添加矿机分组后刷新VM内存", LogEnum.DevConsole,
+                AddEventPath<MinerGroupAddedEvent>("添加矿机分组后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             _dicById.Add(message.Target.GetId(), new MinerGroupViewModel(message.Target));
@@ -34,18 +34,18 @@ namespace NTMiner {
                             OnPropertyChanged(nameof(MinerGroupItems));
                             AppContext.Instance.MinerClientsWindowVm.OnPropertyChanged(nameof(MinerClientsWindowViewModel.SelectedMinerGroup));
                         }
-                    });
-                BuildEventPath<MinerGroupUpdatedEvent>("更新矿机分组后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<MinerGroupUpdatedEvent>("更新矿机分组后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById[message.Target.GetId()].Update(message.Target);
-                    });
-                BuildEventPath<MinerGroupRemovedEvent>("删除矿机分组后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<MinerGroupRemovedEvent>("删除矿机分组后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById.Remove(message.Target.GetId());
                         OnPropertyChanged(nameof(List));
                         OnPropertyChanged(nameof(MinerGroupItems));
                         AppContext.Instance.MinerClientsWindowVm.OnPropertyChanged(nameof(MinerClientsWindowViewModel.SelectedMinerGroup));
-                    });
+                    }, location: this.GetType());
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();
                 if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {

+ 8 - 8
src/AppModels/AppContext.partials.NTMinerWalletViewModels.cs

@@ -20,14 +20,14 @@ namespace NTMiner {
                     return;
                 }
                 Init(refresh: false);
-                BuildEventPath<NTMinerWalletSetInitedEvent>("NTMiner钱包集初始化后", LogEnum.DevConsole,
+                AddEventPath<NTMinerWalletSetInitedEvent>("NTMiner钱包集初始化后", LogEnum.DevConsole,
                     action: message => {
                         Init(refresh: true);
-                    });
+                    }, location: this.GetType());
                 this.Add = new DelegateCommand(() => {
                     new NTMinerWalletViewModel(Guid.NewGuid()).Edit.Execute(FormType.Add);
                 });
-                BuildEventPath<NTMinerWalletAddedEvent>("添加NTMiner钱包后刷新VM内存", LogEnum.DevConsole,
+                AddEventPath<NTMinerWalletAddedEvent>("添加NTMiner钱包后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             _dicById.Add(message.Target.GetId(), new NTMinerWalletViewModel(message.Target));
@@ -35,18 +35,18 @@ namespace NTMiner {
                                 coinVm.OnPropertyChanged(nameof(coinVm.NTMinerWallets));
                             }
                         }
-                    });
-                BuildEventPath<NTMinerWalletUpdatedEvent>("更新NTMiner钱包后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<NTMinerWalletUpdatedEvent>("更新NTMiner钱包后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById[message.Target.GetId()].Update(message.Target);
-                    });
-                BuildEventPath<NTMinerWalletRemovedEvent>("删除NTMiner钱包后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<NTMinerWalletRemovedEvent>("删除NTMiner钱包后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById.Remove(message.Target.GetId());
                         if (AppContext.Instance.CoinVms.TryGetCoinVm(message.Target.CoinId, out CoinViewModel coinVm)) {
                             coinVm.OnPropertyChanged(nameof(coinVm.NTMinerWallets));
                         }
-                    });
+                    }, location: this.GetType());
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();
                 if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {

+ 8 - 8
src/AppModels/AppContext.partials.OverClockDataViewModels.cs

@@ -17,11 +17,11 @@ namespace NTMiner {
                     return;
                 }
                 Init(refresh: false);
-                BuildEventPath<OverClockDataSetInitedEvent>("超频建议集初始化后", LogEnum.DevConsole,
+                AddEventPath<OverClockDataSetInitedEvent>("超频建议集初始化后", LogEnum.DevConsole,
                     action: message => {
                         Init(refresh: true);
-                    });
-                BuildEventPath<OverClockDataAddedEvent>("添加超频建议后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<OverClockDataAddedEvent>("添加超频建议后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             _dicById.Add(message.Target.GetId(), new OverClockDataViewModel(message.Target));
@@ -29,18 +29,18 @@ namespace NTMiner {
                                 coinVm.OnPropertyChanged(nameof(coinVm.OverClockDatas));
                             }
                         }
-                    });
-                BuildEventPath<OverClockDataUpdatedEvent>("更新超频建议后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<OverClockDataUpdatedEvent>("更新超频建议后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById[message.Target.GetId()].Update(message.Target);
-                    });
-                BuildEventPath<OverClockDataRemovedEvent>("删除超频建议后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<OverClockDataRemovedEvent>("删除超频建议后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById.Remove(message.Target.GetId());
                         if (AppContext.Instance.CoinVms.TryGetCoinVm(message.Target.CoinId, out CoinViewModel coinVm)) {
                             coinVm.OnPropertyChanged(nameof(coinVm.OverClockDatas));
                         }
-                    });
+                    }, location: this.GetType());
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();
                 if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {

+ 8 - 8
src/AppModels/AppContext.partials.PackageViewModels.cs

@@ -18,35 +18,35 @@ namespace NTMiner {
                     action: message => {
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         OnPropertyChanged(nameof(AllPackages));
-                    });
-                BuildEventPath<PackageAddedEvent>("添加了包后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<PackageAddedEvent>("添加了包后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Add(message.Target.GetId(), new PackageViewModel(message.Target));
                         OnPropertyChanged(nameof(AllPackages));
                         foreach (var item in AppContext.Instance.KernelVms.AllKernels) {
                             item.OnPropertyChanged(nameof(item.IsPackageValid));
                         }
-                    });
-                BuildEventPath<PackageRemovedEvent>("删除了包后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<PackageRemovedEvent>("删除了包后调整VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById.Remove(message.Target.GetId());
                         OnPropertyChanged(nameof(AllPackages));
                         foreach (var item in AppContext.Instance.KernelVms.AllKernels) {
                             item.OnPropertyChanged(nameof(item.IsPackageValid));
                         }
-                    });
-                BuildEventPath<PackageUpdatedEvent>("更新了包后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<PackageUpdatedEvent>("更新了包后调整VM内存", LogEnum.DevConsole,
                     action: message => {
                         var entity = _dicById[message.Target.GetId()];
                         entity.Update(message.Target);
                         foreach (var item in AppContext.Instance.KernelVms.AllKernels) {
                             item.OnPropertyChanged(nameof(item.IsPackageValid));
                         }
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 8 - 10
src/AppModels/AppContext.partials.PoolKernelViewModels.cs

@@ -14,33 +14,31 @@ namespace NTMiner {
 #if DEBUG
                 Write.Stopwatch.Start();
 #endif
-                BuildEventPath<PoolKernelAddedEvent>("新添了矿池内核后刷新矿池内核VM内存", LogEnum.DevConsole,
+                AddEventPath<PoolKernelAddedEvent>("新添了矿池内核后刷新矿池内核VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
-                            PoolViewModel poolVm;
-                            if (AppContext.Instance.PoolVms.TryGetPoolVm(message.Target.PoolId, out poolVm)) {
+                            if (AppContext.Instance.PoolVms.TryGetPoolVm(message.Target.PoolId, out PoolViewModel poolVm)) {
                                 _dicById.Add(message.Target.GetId(), new PoolKernelViewModel(message.Target));
                                 poolVm.OnPropertyChanged(nameof(poolVm.PoolKernels));
                             }
                         }
-                    });
-                BuildEventPath<PoolKernelRemovedEvent>("移除了币种内核后刷新矿池内核VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<PoolKernelRemovedEvent>("移除了币种内核后刷新矿池内核VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             var vm = _dicById[message.Target.GetId()];
                             _dicById.Remove(message.Target.GetId());
-                            PoolViewModel poolVm;
-                            if (AppContext.Instance.PoolVms.TryGetPoolVm(vm.PoolId, out poolVm)) {
+                            if (AppContext.Instance.PoolVms.TryGetPoolVm(vm.PoolId, out PoolViewModel poolVm)) {
                                 poolVm.OnPropertyChanged(nameof(poolVm.PoolKernels));
                             }
                         }
-                    });
-                BuildEventPath<PoolKernelUpdatedEvent>("更新了矿池内核后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<PoolKernelUpdatedEvent>("更新了矿池内核后刷新VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             _dicById[message.Target.GetId()].Update(message.Target);
                         }
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 4 - 5
src/AppModels/AppContext.partials.PoolProfileViewModels.cs

@@ -13,16 +13,16 @@ namespace NTMiner {
 #if DEBUG
                 Write.Stopwatch.Start();
 #endif
-                BuildEventPath<PoolProfilePropertyChangedEvent>("矿池设置变更后刷新VM内存", LogEnum.DevConsole,
+                AddEventPath<PoolProfilePropertyChangedEvent>("矿池设置变更后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_dicById.TryGetValue(message.PoolId, out PoolProfileViewModel vm)) {
                             vm.OnPropertyChanged(message.PropertyName);
                         }
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<LocalContextReInitedEvent>("LocalContext刷新后刷新VM内存", LogEnum.DevConsole,
                     action: message => {
                         _dicById.Clear();
-                    });
+                    }, location: this.GetType());
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();
                 if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {
@@ -33,8 +33,7 @@ namespace NTMiner {
 
             private readonly object _locker = new object();
             public PoolProfileViewModel GetOrCreatePoolProfile(Guid poolId) {
-                PoolProfileViewModel poolProfile;
-                if (!_dicById.TryGetValue(poolId, out poolProfile)) {
+                if (!_dicById.TryGetValue(poolId, out PoolProfileViewModel poolProfile)) {
                     lock (_locker) {
                         if (!_dicById.TryGetValue(poolId, out poolProfile)) {
                             poolProfile = new PoolProfileViewModel(NTMinerRoot.Instance.MinerProfile.GetPoolProfile(poolId));

+ 8 - 8
src/AppModels/AppContext.partials.PoolViewModels.cs

@@ -17,12 +17,12 @@ namespace NTMiner {
                     action: message => {
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         OnPropertyChanged(nameof(AllPools));
-                    });
-                BuildEventPath<PoolAddedEvent>("添加矿池后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<PoolAddedEvent>("添加矿池后刷新VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Add(message.Target.GetId(), new PoolViewModel(message.Target));
                         OnPropertyChanged(nameof(AllPools));
@@ -32,8 +32,8 @@ namespace NTMiner {
                             coinVm.OnPropertyChanged(nameof(CoinViewModel.Pools));
                             coinVm.OnPropertyChanged(nameof(NTMiner.Vms.CoinViewModel.OptionPools));
                         }
-                    });
-                BuildEventPath<PoolRemovedEvent>("删除矿池后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<PoolRemovedEvent>("删除矿池后刷新VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Remove(message.Target.GetId());
                         OnPropertyChanged(nameof(AllPools));
@@ -43,11 +43,11 @@ namespace NTMiner {
                             coinVm.OnPropertyChanged(nameof(CoinViewModel.Pools));
                             coinVm.OnPropertyChanged(nameof(CoinViewModel.OptionPools));
                         }
-                    });
-                BuildEventPath<PoolUpdatedEvent>("更新矿池后刷新VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<PoolUpdatedEvent>("更新矿池后刷新VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById[message.Target.GetId()].Update(message.Target);
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 2 - 2
src/AppModels/AppContext.partials.ShareViewModels.cs

@@ -13,12 +13,12 @@ namespace NTMiner {
 #if DEBUG
                 Write.Stopwatch.Start();
 #endif
-                BuildEventPath<ShareChangedEvent>("收益变更后调整VM内存", LogEnum.DevConsole,
+                AddEventPath<ShareChangedEvent>("收益变更后调整VM内存", LogEnum.DevConsole,
                     action: message => {
                         if (_dicByCoinId.TryGetValue(message.Target.CoinId, out ShareViewModel shareVm)) {
                             shareVm.Update(message.Target);
                         }
-                    });
+                    }, location: this.GetType());
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();
                 if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {

+ 8 - 8
src/AppModels/AppContext.partials.SysDicItemViewModels.cs

@@ -18,12 +18,12 @@ namespace NTMiner {
                     action: message => {
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         OnPropertyChangeds();
-                    });
-                BuildEventPath<SysDicItemAddedEvent>("添加了系统字典项后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<SysDicItemAddedEvent>("添加了系统字典项后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             _dicById.Add(message.Target.GetId(), new SysDicItemViewModel(message.Target));
@@ -33,8 +33,8 @@ namespace NTMiner {
                                 sysDicVm.OnPropertyChanged(nameof(sysDicVm.SysDicItemsSelect));
                             }
                         }
-                    });
-                BuildEventPath<SysDicItemUpdatedEvent>("更新了系统字典项后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<SysDicItemUpdatedEvent>("更新了系统字典项后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             SysDicItemViewModel entity = _dicById[message.Target.GetId()];
@@ -47,8 +47,8 @@ namespace NTMiner {
                                 }
                             }
                         }
-                    });
-                BuildEventPath<SysDicItemRemovedEvent>("删除了系统字典项后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<SysDicItemRemovedEvent>("删除了系统字典项后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Remove(message.Target.GetId());
                         OnPropertyChangeds();
@@ -56,7 +56,7 @@ namespace NTMiner {
                             sysDicVm.OnPropertyChanged(nameof(sysDicVm.SysDicItems));
                             sysDicVm.OnPropertyChanged(nameof(sysDicVm.SysDicItemsSelect));
                         }
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 8 - 8
src/AppModels/AppContext.partials.SysDicViewModels.cs

@@ -22,15 +22,15 @@ namespace NTMiner {
                         _dicByCode.Clear();
                         _dicById.Clear();
                         Init();
-                    });
+                    }, location: this.GetType());
                 VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                     action: message => {
                         OnPropertyChangeds();
-                    });
+                    }, location: this.GetType());
                 this.Add = new DelegateCommand(() => {
                     new SysDicViewModel(Guid.NewGuid()).Edit.Execute(null);
                 });
-                BuildEventPath<SysDicAddedEvent>("添加了系统字典后调整VM内存", LogEnum.DevConsole,
+                AddEventPath<SysDicAddedEvent>("添加了系统字典后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (!_dicById.ContainsKey(message.Target.GetId())) {
                             SysDicViewModel sysDicVm = new SysDicViewModel(message.Target);
@@ -40,8 +40,8 @@ namespace NTMiner {
                             }
                             OnPropertyChangeds();
                         }
-                    });
-                BuildEventPath<SysDicUpdatedEvent>("更新了系统字典后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<SysDicUpdatedEvent>("更新了系统字典后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         if (_dicById.ContainsKey(message.Target.GetId())) {
                             SysDicViewModel entity = _dicById[message.Target.GetId()];
@@ -51,13 +51,13 @@ namespace NTMiner {
                                 this.OnPropertyChanged(nameof(List));
                             }
                         }
-                    });
-                BuildEventPath<SysDicRemovedEvent>("删除了系统字典后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<SysDicRemovedEvent>("删除了系统字典后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Remove(message.Target.GetId());
                         _dicByCode.Remove(message.Target.Code);
                         OnPropertyChangeds();
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 6 - 6
src/AppModels/AppContext.partials.UserViewModels.cs

@@ -25,25 +25,25 @@ namespace NTMiner {
                     }
                     new UserViewModel().Edit.Execute(FormType.Add);
                 });
-                BuildEventPath<UserAddedEvent>("添加了用户后", LogEnum.DevConsole,
+                AddEventPath<UserAddedEvent>("添加了用户后", LogEnum.DevConsole,
                     action: message => {
                         if (!_dicByLoginName.ContainsKey(message.Target.LoginName)) {
                             _dicByLoginName.Add(message.Target.LoginName, new UserViewModel(message.Target));
                             OnPropertyChanged(nameof(List));
                         }
-                    });
-                BuildEventPath<UserUpdatedEvent>("更新了用户后", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<UserUpdatedEvent>("更新了用户后", LogEnum.DevConsole,
                     action: message => {
                         UserViewModel vm;
                         if (_dicByLoginName.TryGetValue(message.Target.LoginName, out vm)) {
                             vm.Update(message.Target);
                         }
-                    });
-                BuildEventPath<UserRemovedEvent>("移除了用户后", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<UserRemovedEvent>("移除了用户后", LogEnum.DevConsole,
                     action: message => {
                         _dicByLoginName.Remove(message.Target.LoginName);
                         OnPropertyChanged(nameof(List));
-                    });
+                    }, location: this.GetType());
                 foreach (var item in NTMinerRoot.Instance.UserSet.AsEnumerable()) {
                     _dicByLoginName.Add(item.LoginName, new UserViewModel(item));
                 }

+ 7 - 7
src/AppModels/AppContext.partials.WalletViewModels.cs

@@ -17,8 +17,8 @@ namespace NTMiner {
                     action: message=> {
                         _dicById.Clear();
                         Init();
-                    });
-                BuildEventPath<WalletAddedEvent>("添加了钱包后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<WalletAddedEvent>("添加了钱包后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Add(message.Target.GetId(), new WalletViewModel(message.Target));
                         OnPropertyChanged(nameof(WalletList));
@@ -28,8 +28,8 @@ namespace NTMiner {
                             coin.OnPropertyChanged(nameof(CoinViewModel.WalletItems));
                             coin.CoinKernel?.CoinKernelProfile?.SelectedDualCoin?.OnPropertyChanged(nameof(CoinViewModel.Wallets));
                         }
-                    });
-                BuildEventPath<WalletRemovedEvent>("删除了钱包后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<WalletRemovedEvent>("删除了钱包后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById.Remove(message.Target.GetId());
                         OnPropertyChanged(nameof(WalletList));
@@ -40,11 +40,11 @@ namespace NTMiner {
                             coin.CoinProfile?.OnPropertyChanged(nameof(CoinProfileViewModel.SelectedWallet));
                             coin.CoinKernel?.CoinKernelProfile?.SelectedDualCoin?.OnPropertyChanged(nameof(CoinViewModel.Wallets));
                         }
-                    });
-                BuildEventPath<WalletUpdatedEvent>("更新了钱包后调整VM内存", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                AddEventPath<WalletUpdatedEvent>("更新了钱包后调整VM内存", LogEnum.DevConsole,
                     action: (message) => {
                         _dicById[message.Target.GetId()].Update(message.Target);
-                    });
+                    }, location: this.GetType());
                 Init();
 #if DEBUG
                 var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 0 - 1
src/AppModels/View/AbstractAppViewFactory.cs

@@ -16,7 +16,6 @@ namespace NTMiner.View {
                             _mainWindow.Show();
                             // 激活从而切换NotiCenterWindow的Owner
                             _mainWindow.Activate();
-                            VirtualRoot.RaiseEvent(new MainWindowShowedEvent());
                         }
                     }
                 }

+ 1 - 1
src/AppModels/Vms/KernelOutputKeywordsViewModel.cs

@@ -15,7 +15,7 @@ namespace NTMiner.Vms {
             VirtualRoot.AddEventPath<CurrentMineContextChangedEvent>("挖矿上下文变更后刷新内核输出关键字Vm视图集", LogEnum.DevConsole,
                 action: message => {
                     OnPropertyChanged(nameof(KernelOutputVm));
-                });
+                }, location: this.GetType());
             this.Add = new DelegateCommand(() => {
                 KernelOutputViewModel kernelOutputVm = KernelOutputVm;
                 if (kernelOutputVm == null) {

+ 3 - 3
src/AppModels/Vms/LocalMessagesViewModel.cs

@@ -75,7 +75,7 @@
                     UIThread.Execute(() => {
                         Init();
                     });
-                });
+                }, location: this.GetType());
             VirtualRoot.AddEventPath<LocalMessageAddedEvent>("发生了挖矿事件后刷新Vm内存", LogEnum.DevConsole,
                 action: message => {
                     UIThread.Execute(() => {
@@ -100,7 +100,7 @@
                         }
                         OnPropertyChanged(nameof(IsNoRecord));
                     });
-                });
+                }, location: this.GetType());
             VirtualRoot.AddEventPath<NewDayEvent>("新的一天到来时刷新消息集中的可读性时间戳展示", LogEnum.DevConsole,
                 action: message => {
                     if (QueryResults == null) {
@@ -115,7 +115,7 @@
                             break;
                         }
                     }
-                });
+                }, location: this.GetType());
         }
 
         private void Init() {

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

@@ -242,19 +242,19 @@ namespace NTMiner.Vms {
             VirtualRoot.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole,
                 action: message => {
                     OnPropertyChanged(nameof(CoinVm));
-                });
-            AppContext.BuildCmdPath<RefreshAutoBootStartCommand>("刷新开机启动和自动挖矿的展示", LogEnum.DevConsole,
+                }, location: this.GetType());
+            AppContext.AddCmdPath<RefreshAutoBootStartCommand>("刷新开机启动和自动挖矿的展示", LogEnum.DevConsole,
                 action: message => {
                     MinerProfileData data = NTMinerRoot.CreateLocalRepository<MinerProfileData>().GetByKey(this.Id);
                     if (data != null) {
                         this.IsAutoBoot = data.IsAutoBoot;
                         this.IsAutoStart = data.IsAutoStart;
                     }
-                });
-            AppContext.BuildEventPath<MinerProfilePropertyChangedEvent>("MinerProfile设置变更后刷新VM内存", LogEnum.DevConsole,
+                }, location: this.GetType());
+            AppContext.AddEventPath<MinerProfilePropertyChangedEvent>("MinerProfile设置变更后刷新VM内存", LogEnum.DevConsole,
                 action: message => {
                     OnPropertyChanged(message.PropertyName);
-                });
+                }, location: this.GetType());
 
             VirtualRoot.AddEventPath<LocalContextVmsReInitedEvent>("本地上下文视图模型集刷新后刷新界面", LogEnum.DevConsole,
                 action: message => {
@@ -265,7 +265,7 @@ namespace NTMiner.Vms {
                         CoinVm.CoinProfile.OnPropertyChanged(nameof(CoinVm.CoinProfile.SelectedWallet));
                         CoinVm.CoinKernel?.CoinKernelProfile.SelectedDualCoin?.CoinProfile.OnPropertyChanged(nameof(CoinVm.CoinProfile.SelectedDualCoinWallet));
                     }
-                });
+                }, location: this.GetType());
 #if DEBUG
             var elapsedMilliseconds = Write.Stopwatch.Stop();
             if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {

+ 3 - 3
src/AppModels/Vms/ServerMessagesViewModel.cs

@@ -47,7 +47,7 @@ namespace NTMiner.Vms {
                     UIThread.Execute(() => {
                         Init();
                     });
-                });
+                }, location: this.GetType());
             VirtualRoot.AddEventPath<NewServerMessageLoadedEvent>("从服务器加载了新消息后刷新Vm内存", LogEnum.DevConsole,
                 action: message => {
                     UIThread.Execute(() => {
@@ -72,7 +72,7 @@ namespace NTMiner.Vms {
                         }
                         OnPropertyChanged(nameof(IsNoRecord));
                     });
-                });
+                }, location: this.GetType());
             VirtualRoot.AddEventPath<NewDayEvent>("新的一天到来时刷新消息集中的可读性时间戳展示", LogEnum.DevConsole,
                 action: message => {
                     if (QueryResults == null) {
@@ -87,7 +87,7 @@ namespace NTMiner.Vms {
                             break;
                         }
                     }
-                });
+                }, location: this.GetType());
         }
 
         private void Init() {

+ 1 - 1
src/AppModels/Vms/StartStopMineButtonViewModel.cs

@@ -62,7 +62,7 @@ namespace NTMiner.Vms {
                             NTMinerRoot.Instance.StartMine();
                         }
                     }
-                }, viaLimit: MinerProfile.AutoStartDelaySeconds);
+                }, location: this.GetType(), viaLimit: MinerProfile.AutoStartDelaySeconds);
             }
         }
 

+ 62 - 61
src/AppViews0/AppViewFactory.cs

@@ -12,310 +12,311 @@ namespace NTMiner.Views {
         }
 
         public override void Link() {
+            var location = this.GetType();
             VirtualRoot.AddCmdPath<ShowDialogWindowCommand>(action: message => {
                 UIThread.Execute(() => {
                     DialogWindow.ShowSoftDialog(new DialogWindowViewModel(message: message.Message, title: message.Title, onYes: message.OnYes, icon: message.Icon));
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowQQGroupQrCodeCommand>(action: message => {
                 UIThread.Execute(() => {
                     QQGroupQrCode.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowCalcCommand>(action: message => {
                 UIThread.Execute(() => {
                     Calc.ShowWindow(message.CoinVm);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowLocalIpsCommand>(action: message => {
                 UIThread.Execute(() => {
                     LocalIpConfig.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowEthNoDevFeeCommand>(action: message => {
                 UIThread.Execute(() => {
                     EthNoDevFeeEdit.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowCalcConfigCommand>(action: message => {
                 UIThread.Execute(() => {
                     CalcConfig.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowMinerClientsWindowCommand>(action: message => {
                 UIThread.Execute(() => {
                     MinerClientsWindow.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowNTMinerUpdaterConfigCommand>(action: message => {
                 UIThread.Execute(() => {
                     NTMinerUpdaterConfig.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowAboutPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     AboutPage.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowKernelOutputPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     KernelOutputPage.ShowWindow(message.SelectedKernelOutputVm);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowKernelInputPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     KernelInputPage.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowTagBrandCommand>(action: message => {
                 if (NTMinerRoot.IsBrandSpecified) {
                     return;
                 }
                 BrandTag.ShowWindow();
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowCoinPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     CoinPage.ShowWindow(message.CurrentCoin, message.TabType);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowGroupPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     GroupPage.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowSysDicPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     SysDicPage.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowVirtualMemoryCommand>(action: message => {
                 UIThread.Execute(() => {
                     VirtualMemory.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowRestartWindowsCommand>(action: message => {
                 UIThread.Execute(() => {
                     RestartWindows.ShowDialog();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowNotificationSampleCommand>(action: message => {
                 UIThread.Execute(() => {
                     NotificationSample.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowPropertyCommand>(action: message => {
                 UIThread.Execute(() => {
                     Property.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowChartsWindowCommand>(action: message => {
                 UIThread.Execute(() => {
                     ChartsWindow.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowOverClockDataPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     OverClockDataPage.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowNTMinerWalletPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     NTMinerWalletPage.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowMessagePathIdsCommand>(action: message => {
                 UIThread.Execute(() => {
                     MessagePathIds.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowUserPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     UserPage.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowRemoteDesktopLoginDialogCommand>(action: message => {
                 RemoteDesktopLogin.ShowWindow(message.Vm);
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowKernelsWindowCommand>(action: message => {
                 UIThread.Execute(() => {
                     KernelsWindow.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowKernelDownloaderCommand>(action: message => {
                 UIThread.Execute(() => {
                     KernelDownloading.ShowWindow(message.KernelId, message.DownloadComplete);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<EnvironmentVariableEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     EnvironmentVariableEdit.ShowWindow(message.CoinKernelVm, message.EnvironmentVariable);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<InputSegmentEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     InputSegmentEdit.ShowWindow(message.CoinKernelVm, message.Segment);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<CoinKernelEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     CoinKernelEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<CoinEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     CoinEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ColumnsShowEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     ColumnsShowEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowSpeedChartsCommand>(action: message => {
                 UIThread.Execute(() => {
                     SpeedCharts.ShowWindow(message.GpuSpeedVm);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowFileWriterPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     FileWriterPage.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<FileWriterEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     FileWriterEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowFragmentWriterPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     FragmentWriterPage.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<FragmentWriterEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     FragmentWriterEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<GroupEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     GroupEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ServerMessageEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     ServerMessageEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<KernelInputEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     KernelInputEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<KernelOutputKeywordEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     KernelOutputKeywordEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<KernelOutputTranslaterEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     KernelOutputTranslaterEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<KernelOutputEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     KernelOutputEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowPackagesWindowCommand>(action: message => {
                 UIThread.Execute(() => {
                     PackagesWindow.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<KernelEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     KernelEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowMinerClientSettingCommand>(action: message => {
                 UIThread.Execute(() => {
                     MinerClientSetting.ShowWindow(message.Vm);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowMinerNamesSeterCommand>(action: message => {
                 UIThread.Execute(() => {
                     MinerNamesSeter.ShowWindow(message.Vm);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowGpuProfilesPageCommand>(action: message => {
                 UIThread.Execute(() => {
                     GpuProfilesPage.ShowWindow(message.MinerClientsWindowVm);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowMinerClientAddCommand>(action: message => {
                 UIThread.Execute(() => {
                     MinerClientAdd.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<MinerGroupEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     MinerGroupEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<NTMinerWalletEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     NTMinerWalletEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<MineWorkEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     MineWorkEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<OverClockDataEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     OverClockDataEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<PackageEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     PackageEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<PoolKernelEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     PoolKernelEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<PoolEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     PoolEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<SysDicItemEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     SysDicItemEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<SysDicEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     SysDicEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<ShowKernelOutputKeywordsCommand>(action: message => {
                 UIThread.Execute(() => {
                     KernelOutputKeywords.ShowWindow();
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<UserEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     UserEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
             VirtualRoot.AddCmdPath<WalletEditCommand>(action: message => {
                 UIThread.Execute(() => {
                     WalletEdit.ShowWindow(message.FormType, message.Source);
                 });
-            });
+            }, location: location);
         }
     }
 }

+ 2 - 2
src/AppViews0/ChartsWindow.xaml.cs

@@ -35,10 +35,10 @@ namespace NTMiner.Views {
             InitializeComponent();
             NotiCenterWindow.Bind(this);
             #region 总算力
-            this.BuildEventPath<Per10SecondEvent>("周期刷新总算力图", LogEnum.DevConsole,
+            this.AddEventPath<Per10SecondEvent>("周期刷新总算力图", LogEnum.DevConsole,
                 action: message => {
                     RefreshTotalSpeedChart(limit: 1);
-                });
+                }, location: this.GetType());
             RefreshTotalSpeedChart(limit: 60);
             #endregion
         }

+ 4 - 4
src/AppViews0/KernelsWindow.xaml.cs

@@ -34,18 +34,18 @@ namespace NTMiner.Views {
             if (DevMode.IsDevMode) {
                 this.Width += 600;
             }
-            this.BuildEventPath<MineStopedEvent>("当内核宝库窗口开着时如果是本地手动停止的挖矿则引发UserActionEvent事件", LogEnum.DevConsole,
+            this.AddEventPath<MineStopedEvent>("当内核宝库窗口开着时如果是本地手动停止的挖矿则引发UserActionEvent事件", LogEnum.DevConsole,
                 action: message => {
                     if (message.StopReason == StopMineReason.LocalUserAction) {
                         VirtualRoot.RaiseEvent(new UserActionEvent());
                     }
-                });
-            this.BuildEventPath<ServerContextVmsReInitedEvent>("ServerContext的Vm集刷新后刷新内核宝库", LogEnum.DevConsole,
+                }, location: this.GetType());
+            this.AddEventPath<ServerContextVmsReInitedEvent>("ServerContext的Vm集刷新后刷新内核宝库", LogEnum.DevConsole,
                 action: message => {
                     UIThread.Execute(() => {
                         Vm.OnPropertyChanged(nameof(Vm.QueryResults));
                     });
-                });
+                }, location: this.GetType());
             AppContext.Instance.KernelVms.PropertyChanged += Current_PropertyChanged;
             NotiCenterWindow.Bind(this);
             if (!Vm.MinerProfile.IsMining) {

+ 11 - 11
src/AppViews0/MainWindow.xaml.cs

@@ -172,8 +172,8 @@ namespace NTMiner.Views {
                 UIThread.Execute(() => {
                     this.Close();
                 });
-            });
-            this.BuildEventPath<PoolDelayPickedEvent>("从内核输出中提取了矿池延时时展示到界面", LogEnum.DevConsole,
+            }, location: this.GetType());
+            this.AddEventPath<PoolDelayPickedEvent>("从内核输出中提取了矿池延时时展示到界面", LogEnum.DevConsole,
                 action: message => {
                     UIThread.Execute(() => {
                         if (message.IsDual) {
@@ -183,22 +183,22 @@ namespace NTMiner.Views {
                             Vm.StateBarVm.PoolDelayText = message.PoolDelayText;
                         }
                     });
-                });
-            this.BuildEventPath<MineStartedEvent>("开始挖矿后将清空矿池延时", LogEnum.DevConsole,
+                }, location: this.GetType());
+            this.AddEventPath<MineStartedEvent>("开始挖矿后将清空矿池延时", LogEnum.DevConsole,
                 action: message => {
                     UIThread.Execute(() => {
                         Vm.StateBarVm.PoolDelayText = string.Empty;
                         Vm.StateBarVm.DualPoolDelayText = string.Empty;
                     });
-                });
-            this.BuildEventPath<MineStopedEvent>("停止挖矿后将清空矿池延时", LogEnum.DevConsole,
+                }, location: this.GetType());
+            this.AddEventPath<MineStopedEvent>("停止挖矿后将清空矿池延时", LogEnum.DevConsole,
                 action: message => {
                     UIThread.Execute(() => {
                         Vm.StateBarVm.PoolDelayText = string.Empty;
                         Vm.StateBarVm.DualPoolDelayText = string.Empty;
                     });
-                });
-            this.BuildEventPath<Per1MinuteEvent>("挖矿中时自动切换为无界面模式", LogEnum.DevConsole,
+                }, location: this.GetType());
+            this.AddEventPath<Per1MinuteEvent>("挖矿中时自动切换为无界面模式", LogEnum.DevConsole,
                 action: message => {
                     if (NTMinerRoot.IsUiVisible && NTMinerRoot.Instance.MinerProfile.IsAutoNoUi && NTMinerRoot.Instance.IsMining) {
                         if (NTMinerRoot.MainWindowRendedOn.AddMinutes(NTMinerRoot.Instance.MinerProfile.AutoNoUiMinutes) < message.BornOn) {
@@ -206,11 +206,11 @@ namespace NTMiner.Views {
                             VirtualRoot.Execute(new CloseMainWindowCommand());
                         }
                     }
-                });
-            this.BuildEventPath<CpuPackageStateChangedEvent>("CPU包状态变更后刷新Vm内存", LogEnum.None,
+                }, location: this.GetType());
+            this.AddEventPath<CpuPackageStateChangedEvent>("CPU包状态变更后刷新Vm内存", LogEnum.None,
                 action: message => {
                     UIThread.Execute(UpdateCpuView);
-                });
+                }, location: this.GetType());
 #if DEBUG
             var elapsedMilliseconds = Write.Stopwatch.Stop();
             if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) {

+ 4 - 4
src/AppViews0/MinerClientsWindow.xaml.cs

@@ -44,7 +44,7 @@ namespace NTMiner.Views {
                     }
                 }
             };
-            this.BuildEventPath<Per1SecondEvent>("刷新倒计时秒表", LogEnum.None,
+            this.AddEventPath<Per1SecondEvent>("刷新倒计时秒表", LogEnum.None,
                 action: message => {
                     var minerClients = Vm.MinerClients.ToArray();
                     if (Vm.CountDown > 0) {
@@ -53,11 +53,11 @@ namespace NTMiner.Views {
                             item.OnPropertyChanged(nameof(item.LastActivedOnText));
                         }
                     }
-                });
-            this.BuildEventPath<Per10SecondEvent>("周期刷新在线客户端列表", LogEnum.DevConsole,
+                }, location: this.GetType());
+            this.AddEventPath<Per10SecondEvent>("周期刷新在线客户端列表", LogEnum.DevConsole,
                 action: message => {
                     AppContext.Instance.MinerClientsWindowVm.QueryMinerClients();
-                });
+                }, location: this.GetType());
             NotiCenterWindow.Bind(this);
             AppContext.Instance.MinerClientsWindowVm.QueryMinerClients();
             Write.UserLine("小提示:鼠标配合ctrl和shift可以多选矿机", ConsoleColor.Yellow);

+ 4 - 4
src/AppViews0/Ucs/Calc.xaml.cs

@@ -33,15 +33,15 @@ namespace NTMiner.Views.Ucs {
         private Calc() {
             InitializeComponent();
             this.RunOneceOnLoaded((window) => {
-                window.BuildEventPath<CalcConfigSetInitedEvent>("收益计算器数据集刷新后刷新VM", LogEnum.DevConsole,
+                window.AddEventPath<CalcConfigSetInitedEvent>("收益计算器数据集刷新后刷新VM", LogEnum.DevConsole,
                     action: message => {
                         UIThread.Execute(() => {
                             foreach (var coinVm in Vm.CoinVms.AllCoins) {
                                 coinVm.CoinIncomeVm.Refresh();
                             }
                         });
-                    });
-                window.BuildEventPath<Per1MinuteEvent>("当收益计算器页面打开着的时候周期刷新", LogEnum.None,
+                    }, location: this.GetType());
+                window.AddEventPath<Per1MinuteEvent>("当收益计算器页面打开着的时候周期刷新", LogEnum.None,
                     action: message => {
                         if (Vm.CoinVms.AllCoins.Count == 0) {
                             return;
@@ -49,7 +49,7 @@ namespace NTMiner.Views.Ucs {
                         if (Vm.CoinVms.AllCoins.Max(a => a.CoinIncomeVm.ModifiedOn).AddMinutes(10) < DateTime.Now) {
                             NTMinerRoot.Instance.CalcConfigSet.Init(forceRefresh: true);
                         }
-                    });
+                    }, location: this.GetType());
                 NTMinerRoot.Instance.CalcConfigSet.Init(forceRefresh: true);
             });
         }

+ 2 - 2
src/AppViews0/Ucs/CalcConfig.xaml.cs

@@ -34,10 +34,10 @@ namespace NTMiner.Views.Ucs {
         private CalcConfig() {
             InitializeComponent();
             this.RunOneceOnLoaded((window) => {
-                window.BuildEventPath<CalcConfigSetInitedEvent>("收益计算器数据集刷新后刷新VM", LogEnum.DevConsole,
+                window.AddEventPath<CalcConfigSetInitedEvent>("收益计算器数据集刷新后刷新VM", LogEnum.DevConsole,
                     action: message => {
                         UIThread.Execute(()=> Vm.Refresh());
-                    });
+                    }, location: this.GetType());
             });
         }
 

+ 2 - 2
src/AppViews0/Ucs/InnerProperty.xaml.cs

@@ -13,12 +13,12 @@ namespace NTMiner.Views.Ucs {
         public InnerProperty() {
             InitializeComponent();
             this.RunOneceOnLoaded(window => {
-                window.BuildEventPath<ServerJsonVersionChangedEvent>("刷新展示的ServerJsonVersion", LogEnum.DevConsole,
+                window.AddEventPath<ServerJsonVersionChangedEvent>("刷新展示的ServerJsonVersion", LogEnum.DevConsole,
                 action: message => {
                     UIThread.Execute(() => {
                         Vm.ServerJsonVersion = NTMinerRoot.Instance.GetServerJsonVersion();
                     });
-                });
+                }, location: this.GetType());
             });
         }
 

+ 2 - 2
src/AppViews0/Ucs/LocalIpConfig.xaml.cs

@@ -21,10 +21,10 @@ namespace NTMiner.Views.Ucs {
                         window.DragMove();
                     }
                 };
-                window.BuildEventPath<LocalIpSetInitedEvent>("本机IP集刷新后刷新IP设置页", LogEnum.DevConsole,
+                window.AddEventPath<LocalIpSetInitedEvent>("本机IP集刷新后刷新IP设置页", LogEnum.DevConsole,
                     action: message => {
                         UIThread.Execute(()=> uc.Vm.Refresh());
-                    });
+                    }, location: typeof(LocalIpConfig));
                 return uc;
             }, fixedSize: true);
         }

+ 2 - 2
src/AppViews0/Ucs/MinerClientUc.xaml.cs

@@ -16,10 +16,10 @@ namespace NTMiner.Views.Ucs {
             InitializeComponent();
             this.TbDateTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
             this.RunOneceOnLoaded((window) => {
-                window.BuildEventPath<MinutePartChangedEvent>("整分钟时更新MinerClientUc上的日期时间计时器", LogEnum.None,
+                window.AddEventPath<MinutePartChangedEvent>("整分钟时更新MinerClientUc上的日期时间计时器", LogEnum.None,
                     action: message => {
                         this.TbDateTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
-                    });
+                    }, location: this.GetType());
             });
         }
 

+ 2 - 2
src/AppViews0/Ucs/MinerProfileDual.xaml.cs

@@ -18,7 +18,7 @@ namespace NTMiner.Views.Ucs {
             this.PopupDualCoin.Closed += Popup_Closed;
             this.PopupDualCoinWallet.Closed += Popup_Closed;
             this.RunOneceOnLoaded((window) => {
-                window.BuildEventPath<LocalContextVmsReInitedEvent>("本地上下文视图模型集刷新后刷新界面上的popup", LogEnum.DevConsole,
+                window.AddEventPath<LocalContextVmsReInitedEvent>("本地上下文视图模型集刷新后刷新界面上的popup", LogEnum.DevConsole,
                     action: message => {
                         UIThread.Execute(() => {
                             if (Vm.MineWork != null) {
@@ -37,7 +37,7 @@ namespace NTMiner.Views.Ucs {
                                 OpenDualCoinWalletPopup();
                             }
                         });
-                    });
+                    }, location: this.GetType());
             });
         }
 

+ 2 - 2
src/AppViews0/Ucs/MinerProfileIndex.xaml.cs

@@ -22,7 +22,7 @@ namespace NTMiner.Views.Ucs {
             this.PopupMainCoin.Closed += Popup_Closed;
             this.PopupMainCoinWallet.Closed += Popup_Closed;
             this.RunOneceOnLoaded((window)=> {
-                window.BuildEventPath<ServerContextVmsReInitedEvent>("上下文视图模型集刷新后刷新界面上的popup", LogEnum.DevConsole,
+                window.AddEventPath<ServerContextVmsReInitedEvent>("上下文视图模型集刷新后刷新界面上的popup", LogEnum.DevConsole,
                 action: message => {
                     UIThread.Execute(() => {
                         if (Vm.MinerProfile.MineWork != null) {
@@ -49,7 +49,7 @@ namespace NTMiner.Views.Ucs {
                             OpenMainCoinWalletPopup();
                         }
                     });
-                });
+                }, location: this.GetType());
             });
 #if DEBUG
             var elapsedMilliseconds = Write.Stopwatch.Stop();

+ 2 - 2
src/AppViews0/Ucs/ServerMessages.xaml.cs

@@ -13,10 +13,10 @@ namespace NTMiner.Views.Ucs {
             InitializeComponent();
             this.RunOneceOnLoaded(window => {
                 if (VirtualRoot.IsMinerStudio) {
-                    window.BuildEventPath<Per1MinuteEvent>("周期刷新群控客户端的服务器消息集", LogEnum.DevConsole,
+                    window.AddEventPath<Per1MinuteEvent>("周期刷新群控客户端的服务器消息集", LogEnum.DevConsole,
                     action: message => {
                         VirtualRoot.Execute(new LoadNewServerMessageCommand());
-                    });
+                    }, location: this.GetType());
                 }
             });
         }

+ 2 - 2
src/AppViews0/Ucs/SpeedCharts.xaml.cs

@@ -47,7 +47,7 @@ namespace NTMiner.Views.Ucs {
             }
             Guid mainCoinId = NTMinerRoot.Instance.MinerProfile.CoinId;
             this.RunOneceOnLoaded((window) => {
-                window.BuildEventPath<GpuSpeedChangedEvent>("显卡算力变更后刷新算力图界面", LogEnum.DevConsole,
+                window.AddEventPath<GpuSpeedChangedEvent>("显卡算力变更后刷新算力图界面", LogEnum.DevConsole,
                     action: (message) => {
                         UIThread.Execute(() => {
                             if (mainCoinId != NTMinerRoot.Instance.MinerProfile.CoinId) {
@@ -110,7 +110,7 @@ namespace NTMiner.Views.Ucs {
                                 speedChartVm.SetAxisLimits(now);
                             }
                         });
-                    });
+                    }, location: this.GetType());
             });
 
             Vm.PropertyChanged += (object sender, System.ComponentModel.PropertyChangedEventArgs e) => {

+ 12 - 12
src/AppViews0/Ucs/StateBar.xaml.cs

@@ -25,17 +25,17 @@ namespace NTMiner.Views.Ucs {
                     Vm.OnPropertyChanged(nameof(Vm.IsRemoteDesktopEnabled));
                     Vm.OnPropertyChanged(nameof(Vm.RemoteDesktopToolTip));
                 };
-                window.BuildEventPath<LocalIpSetInitedEvent>("本机IP集刷新后刷新状态栏", LogEnum.DevConsole,
+                window.AddEventPath<LocalIpSetInitedEvent>("本机IP集刷新后刷新状态栏", LogEnum.DevConsole,
                     action: message => {
                         UIThread.Execute(()=> Vm.RefreshLocalIps());
-                    });
-                window.BuildEventPath<MinutePartChangedEvent>("时间的分钟部分变更过更新计时器显示", LogEnum.None,
+                    }, location: this.GetType());
+                window.AddEventPath<MinutePartChangedEvent>("时间的分钟部分变更过更新计时器显示", LogEnum.None,
                     action: message => {
                         UIThread.Execute(() => {
                             Vm.UpdateDateTime();
                         });
-                    });
-                window.BuildEventPath<Per1SecondEvent>("挖矿计时秒表", LogEnum.None,
+                    }, location: this.GetType());
+                window.AddEventPath<Per1SecondEvent>("挖矿计时秒表", LogEnum.None,
                     action: message => {
                         UIThread.Execute(() => {
                             DateTime now = DateTime.Now;
@@ -45,25 +45,25 @@ namespace NTMiner.Views.Ucs {
                                 Vm.UpdateMineTimeSpan(now - mineContext.CreatedOn);
                             }
                         });
-                    });
-                window.BuildEventPath<AppVersionChangedEvent>("发现了服务端新版本", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                window.AddEventPath<AppVersionChangedEvent>("发现了服务端新版本", LogEnum.DevConsole,
                     action: message => {
                         UIThread.Execute(() => {
                             Vm.SetCheckUpdateForeground(isLatest: MainAssemblyInfo.CurrentVersion >= NTMinerRoot.ServerVersion);
                         });
-                    });
-                window.BuildEventPath<KernelSelfRestartedEvent>("内核自我重启时刷新计数器", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                window.AddEventPath<KernelSelfRestartedEvent>("内核自我重启时刷新计数器", LogEnum.DevConsole,
                     action: message => {
                         UIThread.Execute(() => {
                             Vm.OnPropertyChanged(nameof(Vm.KernelSelfRestartCountText));
                         });
-                    });
-                window.BuildEventPath<MineStartedEvent>("挖矿开始后将内核自我重启计数清零", LogEnum.DevConsole,
+                    }, location: this.GetType());
+                window.AddEventPath<MineStartedEvent>("挖矿开始后将内核自我重启计数清零", LogEnum.DevConsole,
                     action: message => {
                         UIThread.Execute(() => {
                             Vm.OnPropertyChanged(nameof(Vm.KernelSelfRestartCountText));
                         });
-                    });
+                    }, location: this.GetType());
             });
             var gpuSet = NTMinerRoot.Instance.GpuSet;
             // 建议每张显卡至少对应4G虚拟内存,否则标红

+ 1 - 1
src/CalcConfigUpdater/Program.cs

@@ -19,7 +19,7 @@ namespace NTMiner {
                 VirtualRoot.AddEventPath<Per10MinuteEvent>("每10分钟更新收益计算器", LogEnum.DevConsole,
                     action: message => {
                         UpdateAsync();
-                    });
+                    }, location: typeof(Program));
                 UpdateAsync();
                 Write.UserInfo("输入exit并回车可以停止服务!");
 

+ 14 - 14
src/MinerClient/App.xaml.cs

@@ -43,10 +43,10 @@ namespace NTMiner {
                 UIThread.Execute(() => {
                     FileDownloader.ShowWindow(message.DownloadFileUrl, message.FileTitle, message.DownloadComplete);
                 });
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<UpgradeCommand>(action: message => {
                 AppStatic.Upgrade(message.FileName, message.Callback);
-            });
+            }, location: this.GetType());
             if (!string.IsNullOrEmpty(CommandLineArgs.Upgrade)) {
                 VirtualRoot.Execute(new UpgradeCommand(CommandLineArgs.Upgrade, () => {
                     UIThread.Execute(() => { Environment.Exit(0); });
@@ -177,11 +177,11 @@ namespace NTMiner {
                 action: message => {
                     AppContext.Instance.MinerProfileVm.IsMining = false;
                     VirtualRoot.Out.ShowError(message.Message);
-                });
+                }, location: this.GetType());
             #region 处理显示主界面命令
             VirtualRoot.AddCmdPath<ShowMainWindowCommand>(action: message => {
                 ShowMainWindow(message.IsToggle);
-            });
+            }, location: this.GetType());
             #endregion
             VirtualRoot.AddCmdPath<CloseNTMinerCommand>(action: message => {
                 // 不能推迟这个日志记录的时机,因为推迟会有windows异常日志
@@ -195,12 +195,12 @@ namespace NTMiner {
                         Environment.Exit(0);
                     }
                 });
-            });
+            }, location: this.GetType());
             #region 周期确保守护进程在运行
             VirtualRoot.AddEventPath<Per1MinuteEvent>("周期确保守护进程在运行", LogEnum.DevConsole,
                 action: message => {
                     Daemon.DaemonUtil.RunNTMinerDaemon();
-                });
+                }, location: this.GetType());
             #endregion
             #region 开始和停止挖矿后
             VirtualRoot.AddEventPath<MineStartedEvent>("启动1080ti小药丸、启动DevConsole? 更新挖矿按钮状态", LogEnum.DevConsole,
@@ -215,37 +215,37 @@ namespace NTMiner {
                         Daemon.DaemonUtil.RunDevConsoleAsync(poolIp, consoleTitle);
                     }
                     OhGodAnETHlargementPill.OhGodAnETHlargementPillUtil.Start();
-                });
+                }, location: this.GetType());
             VirtualRoot.AddEventPath<MineStopedEvent>("停止挖矿后停止1080ti小药丸 挖矿停止后更新界面挖矿状态", LogEnum.DevConsole,
                 action: message => {
                     AppContext.Instance.MinerProfileVm.IsMining = false;
                     StartStopMineButtonViewModel.Instance.BtnStopText = "尚未开始";
                     OhGodAnETHlargementPill.OhGodAnETHlargementPillUtil.Stop();
-                });
+                }, location: this.GetType());
             #endregion
             #region 处理禁用win10系统更新
             VirtualRoot.AddCmdPath<BlockWAUCommand>(action: message => {
                 NTMiner.Windows.WindowsUtil.BlockWAU();
-            });
+            }, location: this.GetType());
             #endregion
             #region 优化windows
             VirtualRoot.AddCmdPath<Win10OptimizeCommand>(action: message => {
                 NTMiner.Windows.WindowsUtil.Win10Optimize();
-            });
+            }, location: this.GetType());
             #endregion
             #region 处理开启A卡计算模式
             VirtualRoot.AddCmdPath<SwitchRadeonGpuCommand>(action: message => {
                 if (NTMinerRoot.Instance.GpuSet.GpuType == GpuType.AMD) {
                     SwitchRadeonGpuMode(message.On);
                 }
-            });
+            }, location: this.GetType());
             #endregion
             #region 处理A卡驱动签名
             VirtualRoot.AddCmdPath<AtikmdagPatcherCommand>(action: message => {
                 if (NTMinerRoot.Instance.GpuSet.GpuType == GpuType.AMD) {
                     AtikmdagPatcher.AtikmdagPatcherUtil.Run();
                 }
-            });
+            }, location: this.GetType());
             #endregion
             #region 启用或禁用windows远程桌面
             VirtualRoot.AddCmdPath<EnableWindowsRemoteDesktopCommand>(action: message => {
@@ -260,7 +260,7 @@ namespace NTMiner {
                         Rdp.SetRdpEnabled(true);
                         Firewall.AddRdpRule();
                     }));
-            });
+            }, location: this.GetType());
             #endregion
             #region 启用或禁用windows开机自动登录
             VirtualRoot.AddCmdPath<EnableOrDisableWindowsAutoLoginCommand>(action: message => {
@@ -268,7 +268,7 @@ namespace NTMiner {
                     return;
                 }
                 NTMiner.Windows.Cmd.RunClose("control", "userpasswords2");
-            });
+            }, location: this.GetType());
             #endregion
         }
 

+ 4 - 4
src/MinerStudio/App.xaml.cs

@@ -44,10 +44,10 @@ namespace NTMiner {
                 UIThread.Execute(() => {
                     FileDownloader.ShowWindow(message.DownloadFileUrl, message.FileTitle, message.DownloadComplete);
                 });
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<UpgradeCommand>(action: message => {
                 AppStatic.Upgrade(message.FileName, message.Callback);
-            });
+            }, location: this.GetType());
             try {
                 appMutex = new Mutex(true, s_appPipName, out createdNew);
             }
@@ -81,7 +81,7 @@ namespace NTMiner {
                             Environment.Exit(0);
                         }
                     });
-                });
+                }, location: this.GetType());
             }
             else {
                 try {
@@ -109,7 +109,7 @@ namespace NTMiner {
                 #region 处理显示主界面命令
                 VirtualRoot.AddCmdPath<ShowMainWindowCommand>(action: message => {
                     VirtualRoot.Execute(new ShowMinerClientsWindowCommand());
-                });
+                }, location: this.GetType());
                 #endregion
                 HttpServer.Start($"http://localhost:{NTKeyword.MinerStudioPort.ToString()}");
                 Rdp.RemoteDesktop = MsRdpRemoteDesktop.OpenRemoteDesktop;

+ 1 - 1
src/NTMinerClient/Core/Cpus/Impl/CpuPackage.cs

@@ -67,7 +67,7 @@ namespace NTMiner.Core.Cpus.Impl {
                             }
                         }
                     }
-                });
+                }, location: this.GetType());
         }
 
         private void Update(int performance, int temperature) {

+ 3 - 3
src/NTMinerClient/Core/Gpus/Impl/GpusSpeed.cs

@@ -16,7 +16,7 @@ namespace NTMiner.Core.Gpus.Impl {
             VirtualRoot.AddEventPath<Per10MinuteEvent>("周期清除过期的历史算力", LogEnum.DevConsole,
                 action: message => {
                     ClearOutOfDateHistory();
-                });
+                }, location: this.GetType());
 
             VirtualRoot.AddEventPath<MineStopedEvent>("停止挖矿后产生一次0算力", LogEnum.DevConsole,
                 action: message => {
@@ -27,7 +27,7 @@ namespace NTMiner.Core.Gpus.Impl {
                             SetCurrentSpeed(gpuIndex: gpu.Index, speed: 0.0, isDual: true, now: now);
                         }
                     }
-                });
+                }, location: this.GetType());
 
             VirtualRoot.AddEventPath<MineStartedEvent>("挖矿开始时产生一次0算力0份额", LogEnum.DevConsole,
                 action: message => {
@@ -43,7 +43,7 @@ namespace NTMiner.Core.Gpus.Impl {
                             SetCurrentSpeed(gpuIndex: gpu.Index, speed: 0.0, isDual: true, now: now);
                         }
                     }
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/Gpus/Impl/TempGruarder.cs

@@ -10,9 +10,9 @@ namespace NTMiner.Core.Gpus.Impl {
 
         private bool _isInited = false;
         // 记录显卡的上一次温度
-        private Dictionary<int, int> _preTempDic = new Dictionary<int, int>();
+        private readonly Dictionary<int, int> _preTempDic = new Dictionary<int, int>();
         // 记录显卡温度抵达防御温度的时间
-        private Dictionary<int, DateTime> _fightedOnDic = new Dictionary<int, DateTime>();
+        private readonly Dictionary<int, DateTime> _fightedOnDic = new Dictionary<int, DateTime>();
         private readonly int _fanSpeedDownSeconds = 20;
         private readonly uint _fanSpeedDownStep = 2;
         private static readonly int _guardTemp = 60;
@@ -89,7 +89,7 @@ namespace NTMiner.Core.Gpus.Impl {
                             Write.DevDebug($"GPU{gpu.Index.ToString()} 风扇转速由{gpu.FanSpeed.ToString()}%调高至{cool.ToString()}%");
                         }
                     }
-                });
+                }, location: this.GetType());
         }
     }
 }

+ 2 - 2
src/NTMinerClient/Core/Impl/CalcConfigSet.cs

@@ -10,10 +10,10 @@ namespace NTMiner.Core.Impl {
 
         public CalcConfigSet(INTMinerRoot root) {
             _root = root;
-            VirtualRoot.AddEventPath<MainWindowShowedEvent>("主界面显示后刷新收益计算器", LogEnum.DevConsole,
+            VirtualRoot.AddOnecePath<HasBoot20SecondEvent>("启动一定时间后初始化收益计算器", LogEnum.DevConsole,
                 action: message => {
                     Init(forceRefresh: true);
-                });
+                }, location: this.GetType(), pathId: Guid.Empty);
         }
 
         private DateTime _initedOn = DateTime.MinValue;

+ 2 - 2
src/NTMinerClient/Core/Impl/CoinGroupSet.cs

@@ -25,7 +25,7 @@ namespace NTMiner.Core.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new CoinGroupAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemoveCoinGroupCommand>("移除币组", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -41,7 +41,7 @@ namespace NTMiner.Core.Impl {
                     repository.Remove(message.EntityId);
 
                     VirtualRoot.RaiseEvent(new CoinGroupRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/Impl/CoinSet.cs

@@ -30,7 +30,7 @@ namespace NTMiner.Core.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new CoinAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdateCoinCommand>("更新币种", LogEnum.DevConsole,
                 action: message => {
                     InitOnece();
@@ -52,7 +52,7 @@ namespace NTMiner.Core.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new CoinUpdatedEvent(message.Id, message.Input));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemoveCoinCommand>("移除币种", LogEnum.DevConsole,
                 action: message => {
                     InitOnece();
@@ -87,7 +87,7 @@ namespace NTMiner.Core.Impl {
                     repository.Remove(entity.Id);
 
                     VirtualRoot.RaiseEvent(new CoinRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/Impl/FileWriterSet.cs

@@ -24,7 +24,7 @@ namespace NTMiner.Core.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new FileWriterAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdateFileWriterCommand>("更新文件书写器", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -46,7 +46,7 @@ namespace NTMiner.Core.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new FileWriterUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemoveFileWriterCommand>("移除文件书写器", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -62,7 +62,7 @@ namespace NTMiner.Core.Impl {
                     repository.Remove(message.EntityId);
 
                     VirtualRoot.RaiseEvent(new FileWriterRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/Impl/FragmentWriterSet.cs

@@ -24,7 +24,7 @@ namespace NTMiner.Core.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new FragmentWriterAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdateFragmentWriterCommand>("更新命令行片段书写器", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -46,7 +46,7 @@ namespace NTMiner.Core.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new FragmentWriterUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemoveFragmentWriterCommand>("移除组", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -62,7 +62,7 @@ namespace NTMiner.Core.Impl {
                     repository.Remove(message.EntityId);
 
                     VirtualRoot.RaiseEvent(new FragmentWriterRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/Impl/GroupSet.cs

@@ -24,7 +24,7 @@ namespace NTMiner.Core.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new GroupAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdateGroupCommand>("更新组", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -46,7 +46,7 @@ namespace NTMiner.Core.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new GroupUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemoveGroupCommand>("移除组", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -66,7 +66,7 @@ namespace NTMiner.Core.Impl {
                     repository.Remove(message.EntityId);
 
                     VirtualRoot.RaiseEvent(new GroupRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 4 - 4
src/NTMinerClient/Core/Impl/PoolSet.cs

@@ -54,7 +54,7 @@ namespace NTMiner.Core.Impl {
                             VirtualRoot.Execute(new AddPoolKernelCommand(poolKernel));
                         }
                     }
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdatePoolCommand>("更新矿池", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -87,7 +87,7 @@ namespace NTMiner.Core.Impl {
                     }
 
                     VirtualRoot.RaiseEvent(new PoolUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemovePoolCommand>("移除矿池", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -112,7 +112,7 @@ namespace NTMiner.Core.Impl {
                     foreach (Guid poolKernelId in toRemoves) {
                         VirtualRoot.Execute(new RemovePoolKernelCommand(poolKernelId));
                     }
-                });
+                }, location: this.GetType());
             VirtualRoot.AddEventPath<PoolDelayPickedEvent>("提取了矿池延时后记录进内存", LogEnum.DevConsole,
                 action: message => {
                     if (message.IsDual) {
@@ -137,7 +137,7 @@ namespace NTMiner.Core.Impl {
                             });
                         }
                     }
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 4 - 4
src/NTMinerClient/Core/Impl/ServerContext.cs

@@ -37,18 +37,18 @@ namespace NTMiner.Core.Impl {
         /// <summary>
         /// 命令窗口。使用该方法的代码行应将前两个参数放在第一行以方便vs查找引用时展示出参数信息
         /// </summary>
-        public void AddCmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action)
+        public void AddCmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action, Type location)
             where TCmd : ICmd {
-            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, borderType: typeof(ServerContext));
+            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, location);
             _serverContextHandlers.Add(messagePathId);
         }
 
         /// <summary>
         /// 事件响应
         /// </summary>
-        public void AddEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action)
+        public void AddEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action, Type location)
             where TEvent : IEvent {
-            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, borderType: typeof(ServerContext));
+            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, location);
             _serverContextHandlers.Add(messagePathId);
         }
 

+ 3 - 3
src/NTMinerClient/Core/Impl/SysDicItemSet.cs

@@ -35,7 +35,7 @@ namespace NTMiner.Core.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new SysDicItemAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             _context.AddCmdPath<UpdateSysDicItemCommand>("更新系统字典项", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -63,7 +63,7 @@ namespace NTMiner.Core.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new SysDicItemUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             _context.AddCmdPath<RemoveSysDicItemCommand>("移除系统字典项", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -84,7 +84,7 @@ namespace NTMiner.Core.Impl {
                     repository.Remove(entity.Id);
 
                     VirtualRoot.RaiseEvent(new SysDicItemRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/Impl/SysDicSet.cs

@@ -30,7 +30,7 @@ namespace NTMiner.Core.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new SysDicAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdateSysDicCommand>("更新系统字典", LogEnum.DevConsole,
                 action: message => {
                     InitOnece();
@@ -52,7 +52,7 @@ namespace NTMiner.Core.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new SysDicUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemoveSysDicCommand>("移除系统字典", LogEnum.DevConsole,
                 action: message => {
                     InitOnece();
@@ -75,7 +75,7 @@ namespace NTMiner.Core.Impl {
                     repository.Remove(entity.Id);
 
                     VirtualRoot.RaiseEvent(new SysDicRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 5 - 5
src/NTMinerClient/Core/Kernels/Impl/CoinKernelSet.cs

@@ -42,7 +42,7 @@ namespace NTMiner.Core.Kernels.Impl {
                             VirtualRoot.Execute(new AddPoolKernelCommand(poolKernel));
                         }
                     }
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdateCoinKernelCommand>("更新币种内核", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -64,7 +64,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new CoinKernelUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemoveCoinKernelCommand>("移除币种内核", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -92,7 +92,7 @@ namespace NTMiner.Core.Kernels.Impl {
                             VirtualRoot.Execute(new RemovePoolKernelCommand(poolKernelId));
                         }
                     }
-                });
+                }, location: this.GetType());
             context.AddEventPath<FileWriterRemovedEvent>("移除文件书写器后移除引用关系", LogEnum.DevConsole,
                 action: message => {
                     var repository = NTMinerRoot.CreateServerRepository<CoinKernelData>();
@@ -102,7 +102,7 @@ namespace NTMiner.Core.Kernels.Impl {
                         repository.Update(entity);
                         VirtualRoot.RaiseEvent(new CoinKernelUpdatedEvent(message.Id, entity));
                     }
-                });
+                }, location: this.GetType());
             context.AddEventPath<FragmentWriterRemovedEvent>("移除命令行片段书写器后移除引用关系", LogEnum.DevConsole,
                 action: message => {
                     var repository = NTMinerRoot.CreateServerRepository<CoinKernelData>();
@@ -112,7 +112,7 @@ namespace NTMiner.Core.Kernels.Impl {
                         repository.Update(entity);
                         VirtualRoot.RaiseEvent(new CoinKernelUpdatedEvent(message.Id, entity));
                     }
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/KernelInputSet.cs

@@ -22,7 +22,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new KernelInputAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdateKernelInputCommand>("更新内核输入组", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -44,7 +44,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new KernelInputUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemoveKernelInputCommand>("移除内核输入组", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -60,7 +60,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Remove(message.EntityId);
 
                     VirtualRoot.RaiseEvent(new KernelInputRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/KernelOutputSet.cs

@@ -25,7 +25,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new KernelOutputAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdateKernelOutputCommand>("更新内核输出组", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -47,7 +47,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new KernelOutputUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemoveKernelOutputCommand>("移除内核输出组", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -71,7 +71,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Remove(message.EntityId);
 
                     VirtualRoot.RaiseEvent(new KernelOutputRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             #endregion
         }
 

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/KernelOutputTranslaterSet.cs

@@ -39,7 +39,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new KernelOutputTranslaterAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdateKernelOutputTranslaterCommand>("更新内核输出翻译器", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -63,7 +63,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new KernelOutputTranslaterUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemoveKernelOutputTranslaterCommand>("移除内核输出翻译器", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -81,7 +81,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Remove(entity.Id);
 
                     VirtualRoot.RaiseEvent(new KernelOutputTranslaterRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/KernelSet.cs

@@ -25,7 +25,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new KernelAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdateKernelCommand>("更新内核", LogEnum.DevConsole,
                 action: message => {
                     InitOnece();
@@ -47,7 +47,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new KernelUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemoveKernelCommand>("移除内核", LogEnum.DevConsole,
                 action: message => {
                     InitOnece();
@@ -67,7 +67,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Remove(entity.Id);
 
                     VirtualRoot.RaiseEvent(new KernelRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/PackageSet.cs

@@ -28,7 +28,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Add(entity);
 
                     VirtualRoot.RaiseEvent(new PackageAddedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<UpdatePackageCommand>("更新包", LogEnum.DevConsole,
                 action: message => {
                     InitOnece();
@@ -53,7 +53,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new PackageUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
             context.AddCmdPath<RemovePackageCommand>("移除包", LogEnum.DevConsole,
                 action: message => {
                     InitOnece();
@@ -69,7 +69,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Remove(entity.Id);
 
                     VirtualRoot.RaiseEvent(new PackageRemovedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/PoolKernelSet.cs

@@ -18,7 +18,7 @@ namespace NTMiner.Core.Kernels.Impl {
                         repository.Add(entity);
                         VirtualRoot.RaiseEvent(new PoolKernelAddedEvent(message.Id, message.Input));
                     }
-                });
+                }, location: this.GetType());
             _context.AddCmdPath<RemovePoolKernelCommand>("处理移除矿池级内核命令", LogEnum.DevConsole,
                 action: message => {
                     if (_dicById.ContainsKey(message.EntityId)) {
@@ -28,7 +28,7 @@ namespace NTMiner.Core.Kernels.Impl {
                         repository.Remove(message.EntityId);
                         VirtualRoot.RaiseEvent(new PoolKernelRemovedEvent(message.Id, entity));
                     }
-                });
+                }, location: this.GetType());
             _context.AddCmdPath<UpdatePoolKernelCommand>("更新矿池内核", LogEnum.DevConsole,
                 action: (message) => {
                     InitOnece();
@@ -50,7 +50,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     repository.Update(entity);
 
                     VirtualRoot.RaiseEvent(new PoolKernelUpdatedEvent(message.Id, entity));
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/MinerServer/Impl/ColumnsShowSet.cs

@@ -25,7 +25,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         Write.UserFail(response.ReadMessage(exception));
                     }
                 });
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<UpdateColumnsShowCommand>(action: (message) => {
                 InitOnece();
                 if (message == null || message.Input == null || message.Input.GetId() == Guid.Empty) {
@@ -45,7 +45,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                     }
                 });
                 VirtualRoot.RaiseEvent(new ColumnsShowUpdatedEvent(message.Id, entity));
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<RemoveColumnsShowCommand>(action: (message) => {
                 InitOnece();
                 if (message == null || message.EntityId == Guid.Empty || message.EntityId == ColumnsShowData.PleaseSelect.Id) {
@@ -64,7 +64,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         Write.UserFail(response.ReadMessage(exception));
                     }
                 });
-            });
+            }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/MinerServer/Impl/MineWorkSet.cs

@@ -24,7 +24,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 else {
                     Write.UserFail(response?.Description);
                 }
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<UpdateMineWorkCommand>(action: (message) => {
                 InitOnece();
                 if (message == null || message.Input == null || message.Input.GetId() == Guid.Empty) {
@@ -44,7 +44,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                     }
                 });
                 VirtualRoot.RaiseEvent(new MineWorkUpdatedEvent(message.Id, entity));
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<RemoveMineWorkCommand>(action: (message) => {
                 InitOnece();
                 if (message == null || message.EntityId == Guid.Empty) {
@@ -63,7 +63,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         Write.UserFail(response.ReadMessage(exception));
                     }
                 });
-            });
+            }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/MinerServer/Impl/MinerGroupSet.cs

@@ -28,7 +28,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         Write.UserFail(response.ReadMessage(exception));
                     }
                 });
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<UpdateMinerGroupCommand>(action: (message) => {
                 InitOnece();
                 if (message == null || message.Input == null || message.Input.GetId() == Guid.Empty) {
@@ -51,7 +51,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                     }
                 });
                 VirtualRoot.RaiseEvent(new MinerGroupUpdatedEvent(message.Id, entity));
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<RemoveMinerGroupCommand>(action: (message) => {
                 InitOnece();
                 if (message == null || message.EntityId == Guid.Empty) {
@@ -70,7 +70,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         Write.UserFail(response.ReadMessage(exception));
                     }
                 });
-            });
+            }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/MinerServer/Impl/NTMinerWalletSet.cs

@@ -27,7 +27,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         Write.UserFail(response.ReadMessage(e));
                     }
                 });
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<UpdateNTMinerWalletCommand>(action: (message) => {
                 if (message == null || message.Input == null || message.Input.GetId() == Guid.Empty) {
                     throw new ArgumentNullException();
@@ -49,7 +49,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                     }
                 });
                 VirtualRoot.RaiseEvent(new NTMinerWalletUpdatedEvent(message.Id, entity));
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<RemoveNTMinerWalletCommand>(action: (message) => {
                 if (message == null || message.EntityId == Guid.Empty) {
                     throw new ArgumentNullException();
@@ -67,7 +67,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         Write.UserFail(response.ReadMessage(e));
                     }
                 });
-            });
+            }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/MinerServer/Impl/OverClockDataSet.cs

@@ -30,7 +30,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         Write.UserFail(response.ReadMessage(e));
                     }
                 });
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<UpdateOverClockDataCommand>(action: (message) => {
                 if (message == null || message.Input == null || message.Input.GetId() == Guid.Empty) {
                     throw new ArgumentNullException();
@@ -52,7 +52,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                     }
                 });
                 VirtualRoot.RaiseEvent(new OverClockDataUpdatedEvent(message.Id, entity));
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<RemoveOverClockDataCommand>(action: (message) => {
                 if (message == null || message.EntityId == Guid.Empty) {
                     throw new ArgumentNullException();
@@ -70,7 +70,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         Write.UserFail(response.ReadMessage(e));
                     }
                 });
-            });
+            }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 2 - 3
src/NTMinerClient/Core/MinerServer/Impl/ServerAppSettingSet.cs

@@ -1,6 +1,5 @@
 using NTMiner.AppSetting;
 using System;
-using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 
@@ -38,7 +37,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                     }
                 });
                 VirtualRoot.RaiseEvent(new ServerAppSettingSetedEvent(message.Id, entity));
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<SetServerAppSettingsCommand>(action: message => {
                 if (message.AppSettings == null) {
                     return;
@@ -61,7 +60,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 }
                 Server.AppSettingService.SetAppSettingsAsync(message.AppSettings.Select(a => AppSettingData.Create(a)).ToList(), (response, exception) => {
                 });
-            });
+            }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 3 - 3
src/NTMinerClient/Core/MinerServer/Impl/UserSet.cs

@@ -27,7 +27,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         }
                     });
                 }
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<UpdateUserCommand>(action: message => {
                 if (_dicByLoginName.ContainsKey(message.User.LoginName)) {
                     UserData entity = _dicByLoginName[message.User.LoginName];
@@ -47,7 +47,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                     });
                     VirtualRoot.RaiseEvent(new UserUpdatedEvent(message.Id, entity));
                 }
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<RemoveUserCommand>(action: message => {
                 if (_dicByLoginName.ContainsKey(message.LoginName)) {
                     UserData entity = _dicByLoginName[message.LoginName];
@@ -61,7 +61,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         }
                     });
                 }
-            });
+            }, location: this.GetType());
         }
 
         private readonly object _locker = new object();

+ 2 - 2
src/NTMinerClient/Core/Profiles/Impl/GpuProfileSet.cs

@@ -24,13 +24,13 @@ namespace NTMiner.Core.Profiles.Impl {
                     Save();
                 }
                 VirtualRoot.RaiseEvent(new GpuProfileAddedOrUpdatedEvent(message.Id, data));
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<CoinOverClockCommand>(action: message => {
                 Task.Factory.StartNew(() => {
                     CoinOverClock(root, message.CoinId);
                     VirtualRoot.RaiseEvent(new CoinOverClockDoneEvent(bornPathId: message.Id));
                 });
-            });
+            }, location: this.GetType());
         }
 
         public void Refresh() {

+ 3 - 3
src/NTMinerClient/Core/Profiles/Impl/WalletSet.cs

@@ -27,7 +27,7 @@ namespace NTMiner.Core.Profiles.Impl {
                 AddWallet(entity);
 
                 VirtualRoot.RaiseEvent(new WalletAddedEvent(message.Id, entity));
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<UpdateWalletCommand>(action: message => {
                 InitOnece();
                 if (message == null || message.Input == null || message.Input.GetId() == Guid.Empty) {
@@ -50,7 +50,7 @@ namespace NTMiner.Core.Profiles.Impl {
                 UpdateWallet(entity);
 
                 VirtualRoot.RaiseEvent(new WalletUpdatedEvent(message.Id, entity));
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<RemoveWalletCommand>(action: (message) => {
                 InitOnece();
                 if (message == null || message.EntityId == Guid.Empty) {
@@ -64,7 +64,7 @@ namespace NTMiner.Core.Profiles.Impl {
                 RemoveWallet(entity.Id);
 
                 VirtualRoot.RaiseEvent(new WalletRemovedEvent(message.Id, entity));
-            });
+            }, location: this.GetType());
         }
 
         private void AddWallet(WalletData entity) {

+ 2 - 2
src/NTMinerClient/IServerContext.cs

@@ -6,8 +6,8 @@ using System;
 namespace NTMiner {
     public interface IServerContext {
         void ReInit();
-        void AddCmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action) where TCmd : ICmd;
-        void AddEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action) where TEvent : IEvent;
+        void AddCmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action, Type location) where TCmd : ICmd;
+        void AddEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action, Type location) where TEvent : IEvent;
         ICoinGroupSet CoinGroupSet { get; }
         ICoinSet CoinSet { get; }
         IFileWriterSet FileWriterSet { get; }

+ 0 - 6
src/NTMinerClient/Messages.cs

@@ -1,5 +1,4 @@
 using NTMiner.Hub;
-using NTMiner.Core;
 using System;
 
 namespace NTMiner {
@@ -45,11 +44,6 @@ namespace NTMiner {
         public LocalContextVmsReInitedEvent() { }
     }
 
-    [MessageType(description: "主界面显示后")]
-    public class MainWindowShowedEvent : EventBase {
-        public MainWindowShowedEvent() { }
-    }
-
     [MessageType(description: "发现了NTMiner或MinerStudio新版本")]
     public class AppVersionChangedEvent : EventBase {
         /// <summary>

+ 6 - 6
src/NTMinerClient/NTMinerRoot.cs

@@ -87,7 +87,7 @@ namespace NTMiner {
                         VirtualRoot.AddEventPath<UserActionEvent>("发生了用户活动时检查serverJson是否有新版本", LogEnum.DevConsole,
                             action: message => {
                                 RefreshServerJsonFile();
-                            });
+                            }, location: this.GetType());
                         #endregion
                     }
                 }
@@ -225,11 +225,11 @@ namespace NTMiner {
                     Logger.ErrorDebugLine(e);
                     VirtualRoot.ThisLocalError(nameof(NTMinerRoot), "windows右键命令行添加失败", OutEnum.Warn);
                 }
-            });
+            }, location: this.GetType());
             VirtualRoot.AddEventPath<Per1MinuteEvent>("每1分钟阻止系统休眠", LogEnum.None,
                 action: message => {
                     Windows.Power.PreventSleep();
-                });
+                }, location: this.GetType());
             #region 挖矿开始时将无份额内核重启份额计数置0
             int shareCount = 0;
             DateTime shareOn = DateTime.Now;
@@ -240,7 +240,7 @@ namespace NTMiner {
                     if (!message.MineContext.IsRestart) {
                         shareOn = DateTime.Now;
                     }
-                });
+                }, location: this.GetType());
             #endregion
             #region 每20秒钟检查是否需要重启
             VirtualRoot.AddEventPath<Per20SecondEvent>("每20秒钟检查是否需要重启", LogEnum.None,
@@ -320,7 +320,7 @@ namespace NTMiner {
                         Logger.ErrorDebugLine(e);
                     }
                     #endregion
-                });
+                }, location: this.GetType());
             #endregion
             VirtualRoot.AddEventPath<Per10SecondEvent>("周期刷新显卡状态", LogEnum.None,
                 action: message => {
@@ -328,7 +328,7 @@ namespace NTMiner {
                     Task.Factory.StartNew(() => {
                         GpuSet.LoadGpuState();
                     });
-                });
+                }, location: this.GetType());
         }
         #endregion
 

+ 3 - 3
src/NTMinerClient/NTMinerRoot.partials.MinerProcess.cs

@@ -42,7 +42,7 @@ namespace NTMiner {
                                         if (mineContext == Instance.LockedMineContext) {
                                             ContinueCreateProcess(mineContext);
                                         }
-                                    }, pathId: cmd.Id);
+                                    }, location: typeof(MinerProcess), pathId: cmd.Id);
                                 // 超频是在另一个线程执行的,因为N卡超频当cpu性能非常差时较耗时
                                 VirtualRoot.Execute(cmd);
                             }
@@ -162,7 +162,7 @@ namespace NTMiner {
                                 clear?.Invoke();
                             }
                         }
-                    });
+                    }, location: typeof(MinerProcess));
             }
             #endregion
 
@@ -284,7 +284,7 @@ namespace NTMiner {
                                     CloseHandle(hWriteOut);
                                     isHWriteOutHasClosed = true;
                                 }
-                            }, pathId: Guid.Empty);
+                            }, location: typeof(MinerProcess), pathId: Guid.Empty);
                         Task.Factory.StartNew(() => {
                             using (FileStream fs = new FileStream(mineContext.LogFileFullName, FileMode.OpenOrCreate, FileAccess.ReadWrite)) {
                                 const byte r = (byte)'\r';

+ 5 - 5
src/NTMinerClient/Report.cs

@@ -9,26 +9,26 @@ using System.Linq;
 namespace NTMiner {
     public static class Report {
         public static void Init() {
-            VirtualRoot.AddEventPath<HasBoot10SecondEvent>("登录服务器并报告一次0算力", LogEnum.DevConsole,
+            VirtualRoot.AddOnecePath<HasBoot10SecondEvent>("登录服务器并报告一次0算力", LogEnum.DevConsole,
                 action: message => {
                     // 报告0算力从而告知服务器该客户端当前在线的币种
                     ReportSpeed();
-                });
+                }, location: typeof(Report), pathId: Guid.Empty);
 
             VirtualRoot.AddEventPath<Per2MinuteEvent>("每两分钟上报一次", LogEnum.DevConsole,
                 action: message => {
                     ReportSpeed();
-                });
+                }, location: typeof(Report));
 
             VirtualRoot.AddEventPath<MineStartedEvent>("开始挖矿后报告状态", LogEnum.DevConsole,
                 action: message => {
                     ReportSpeed();
-                });
+                }, location: typeof(Report));
 
             VirtualRoot.AddEventPath<MineStopedEvent>("停止挖矿后报告状态", LogEnum.DevConsole,
                 action: message => {
                     Server.ReportService.ReportStateAsync(NTKeyword.OfficialServerHost, VirtualRoot.Id, isMining: false);
-                });
+                }, location: typeof(Report));
         }
 
         private static ICoin _sLastSpeedMainCoin;

+ 1 - 1
src/NTMinerDaemon/HostRoot.cs

@@ -114,7 +114,7 @@ namespace NTMiner {
                     action: message => {
                         NTMinerRegistry.SetDaemonActiveOn(DateTime.Now);
                         NoDevFee.NoDevFeeUtil.StartAsync();
-                    });
+                    }, typeof(HostRoot));
                 _waitHandle.WaitOne();
                 Close();
             }

+ 3 - 3
src/NTMinerRpcClient/KernelOutputKeyword/KernelOutputKeywordSet.cs

@@ -53,7 +53,7 @@ namespace NTMiner.KernelOutputKeyword {
                             }
                         }
                     });
-                });
+                }, location: this.GetType());
             }
             VirtualRoot.AddCmdPath<AddOrUpdateKernelOutputKeywordCommand>(action: (message) => {
                 InitOnece();
@@ -95,7 +95,7 @@ namespace NTMiner.KernelOutputKeyword {
                         }
                     });
                 }
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<RemoveKernelOutputKeywordCommand>(action: (message) => {
                 InitOnece();
                 if (isServer || !DevMode.IsDevMode) {
@@ -125,7 +125,7 @@ namespace NTMiner.KernelOutputKeyword {
                         }
                     });
                 }
-            });
+            }, location: this.GetType());
         }
 
         private const string fileName = "ServerKernelOutputKeywords.json";

+ 5 - 5
src/NTMinerRpcClient/ServerMessage/ServerMessageSet.cs

@@ -29,10 +29,10 @@ namespace NTMiner.ServerMessage {
                             ReceiveServerMessage(response.Data);
                         }
                     });
-                });
+                }, location: this.GetType());
                 VirtualRoot.AddCmdPath<ReceiveServerMessageCommand>(action: message => {
                     ReceiveServerMessage(message.Data);
-                });
+                }, location: this.GetType());
             }
             VirtualRoot.AddCmdPath<AddOrUpdateServerMessageCommand>(action: message => {
                 InitOnece();
@@ -86,7 +86,7 @@ namespace NTMiner.ServerMessage {
                         }
                     });
                 }
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<MarkDeleteServerMessageCommand>(action: message => {
                 InitOnece();
                 if (isServer) {
@@ -117,7 +117,7 @@ namespace NTMiner.ServerMessage {
                         }
                     });
                 }
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<ClearServerMessages>(action: message => {
                 InitOnece();
                 // 服务端不应有清空消息的功能
@@ -131,7 +131,7 @@ namespace NTMiner.ServerMessage {
                     db.DropCollection(nameof(ServerMessageData));
                 }
                 VirtualRoot.RaiseEvent(new ServerMessagesClearedEvent());
-            });
+            }, location: this.GetType());
         }
 
         private void ReceiveServerMessage(List<ServerMessageData> data) {

+ 1 - 1
src/NTMinerServices/Data/Impl/ClientSet.cs

@@ -51,7 +51,7 @@ namespace NTMiner.Data.Impl {
                         var col = db.GetCollection<MinerData>();
                         col.Upsert(minerDatas);
                     }
-                });
+                }, location: this.GetType());
         }
 
         private void GetSpeed() {

+ 4 - 6
src/NTMinerServices/Data/Impl/CoinSnapshotSet.cs

@@ -14,7 +14,7 @@ namespace NTMiner.Data.Impl {
             VirtualRoot.AddEventPath<Per10SecondEvent>("周期性拍摄快照", LogEnum.DevConsole,
                 action: message => {
                     Snapshot(message.BornOn);
-                });
+                }, location: this.GetType());
             VirtualRoot.AddEventPath<Per2MinuteEvent>("周期性拍摄快照", LogEnum.DevConsole,
                 action: message => {
                     DateTime time = DateTime.Now.AddMinutes(-20);
@@ -22,7 +22,7 @@ namespace NTMiner.Data.Impl {
                     foreach (var item in toRemoves) {
                         _dataList.Remove(item);
                     }
-                });
+                }, location: this.GetType());
         }
 
         private bool _isInited = false;
@@ -83,8 +83,7 @@ namespace NTMiner.Data.Impl {
                         continue;
                     }
 
-                    CoinSnapshotData mainCoinSnapshotData;
-                    if (!dicByCoinCode.TryGetValue(clientData.MainCoinCode, out mainCoinSnapshotData)) {
+                    if (!dicByCoinCode.TryGetValue(clientData.MainCoinCode, out CoinSnapshotData mainCoinSnapshotData)) {
                         mainCoinSnapshotData = new CoinSnapshotData() {
                             Timestamp = now,
                             CoinCode = clientData.MainCoinCode
@@ -103,8 +102,7 @@ namespace NTMiner.Data.Impl {
                     mainCoinSnapshotData.MainCoinOnlineCount += 1;
 
                     if (!string.IsNullOrEmpty(clientData.DualCoinCode) && clientData.IsDualCoinEnabled) {
-                        CoinSnapshotData dualCoinSnapshotData;
-                        if (!dicByCoinCode.TryGetValue(clientData.DualCoinCode, out dualCoinSnapshotData)) {
+                        if (!dicByCoinCode.TryGetValue(clientData.DualCoinCode, out CoinSnapshotData dualCoinSnapshotData)) {
                             dualCoinSnapshotData = new CoinSnapshotData() {
                                 Timestamp = now,
                                 CoinCode = clientData.DualCoinCode

+ 3 - 4
src/NTMinerServices/Data/Impl/UserSet.cs

@@ -1,6 +1,5 @@
 using LiteDB;
 using NTMiner.User;
-using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
 
@@ -21,7 +20,7 @@ namespace NTMiner.Data.Impl {
                     }
                     VirtualRoot.RaiseEvent(new UserAddedEvent(message.Id, entity));
                 }
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<UpdateUserCommand>(action: message => {
                 if (_dicByLoginName.ContainsKey(message.User.LoginName)) {
                     UserData entity = _dicByLoginName[message.User.LoginName];
@@ -32,7 +31,7 @@ namespace NTMiner.Data.Impl {
                     }
                     VirtualRoot.RaiseEvent(new UserUpdatedEvent(message.Id, entity));
                 }
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<RemoveUserCommand>(action: message => {
                 if (_dicByLoginName.ContainsKey(message.LoginName)) {
                     UserData entity = _dicByLoginName[message.LoginName];
@@ -43,7 +42,7 @@ namespace NTMiner.Data.Impl {
                     }
                     VirtualRoot.RaiseEvent(new UserRemovedEvent(message.Id, entity));
                 }
-            });
+            }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 4 - 4
src/NTMinerWpf/WindowExtension.cs

@@ -102,7 +102,7 @@ namespace NTMiner {
         private const string messagePathIdsResourceKey = "messagePathIds";
 
         // 因为是上下文路径,无需返回路径标识
-        public static void BuildCmdPath<TCmd>(this Window window, string description, LogEnum logType, Action<TCmd> action)
+        public static void AddCmdPath<TCmd>(this Window window, string description, LogEnum logType, Action<TCmd> action, Type location)
             where TCmd : ICmd {
             if (WpfUtil.IsInDesignMode) {
                 return;
@@ -116,12 +116,12 @@ namespace NTMiner {
                 window.Resources.Add(messagePathIdsResourceKey, messagePathIds);
                 window.Closed += UiElement_Closed;
             }
-            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, borderType: typeof(WindowExtension));
+            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, location);
             messagePathIds.Add(messagePathId);
         }
 
         // 因为是上下文路径,无需返回路径标识
-        public static void BuildEventPath<TEvent>(this Window window, string description, LogEnum logType, Action<TEvent> action)
+        public static void AddEventPath<TEvent>(this Window window, string description, LogEnum logType, Action<TEvent> action, Type location)
             where TEvent : IEvent {
             if (WpfUtil.IsInDesignMode) {
                 return;
@@ -135,7 +135,7 @@ namespace NTMiner {
                 window.Resources.Add(messagePathIdsResourceKey, messagePathIds);
                 window.Closed += UiElement_Closed; ;
             }
-            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, borderType: typeof(WindowExtension));
+            var messagePathId = VirtualRoot.AddMessagePath(description, logType, action, location);
             messagePathIds.Add(messagePathId);
         }
 

+ 1 - 1
src/NTMinerlib/AppSetting/LocalAppSettingSet.cs

@@ -26,7 +26,7 @@ namespace NTMiner.AppSetting {
                     col.Upsert(entity);
                 }
                 VirtualRoot.RaiseEvent(new LocalAppSettingChangedEvent(message.Id, entity));
-            });
+            }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 2 - 2
src/NTMinerlib/LocalMessage/LocalMessageSet.cs

@@ -37,7 +37,7 @@ namespace NTMiner.LocalMessage {
                     col.Insert(data);
                 }
                 VirtualRoot.RaiseEvent(new LocalMessageAddedEvent(message.Id, data, removes));
-            });
+            }, location: this.GetType());
             VirtualRoot.AddCmdPath<ClearLocalMessageSetCommand>(action: message => {
                 if (string.IsNullOrEmpty(_connectionString)) {
                     return;
@@ -49,7 +49,7 @@ namespace NTMiner.LocalMessage {
                     db.DropCollection(nameof(LocalMessageData));
                 }
                 VirtualRoot.RaiseEvent(new LocalMessageSetClearedEvent());
-            });
+            }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 1 - 1
src/NTMinerlib/Net/LocalIpSet.cs

@@ -173,7 +173,7 @@ namespace NTMiner.Net {
                         mo.InvokeMethod("SetDNSServerSearchOrder", inPar, null);
                     }
                 }
-            });
+            }, location: this.GetType());
         }
 
         private bool _isInited = false;

+ 7 - 43
src/NTMinerlib/VirtualRoot.partials.Hub.cs

@@ -1,7 +1,6 @@
 using NTMiner.Hub;
 using System;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.Text.RegularExpressions;
 using System.Timers;
 
@@ -16,63 +15,28 @@ namespace NTMiner {
         }
 
         // 修建消息(命令或事件)的运动路径
-        public static IMessagePathId AddMessagePath<TMessage>(string description, LogEnum logType, Action<TMessage> action, Type borderType = null) {
-            Type location = GetMessagePathLocation(borderType: borderType);
+        public static IMessagePathId AddMessagePath<TMessage>(string description, LogEnum logType, Action<TMessage> action, Type location) {
             return MessagePath<TMessage>.AddMessagePath(MessageHub, location, description, logType, action, Guid.Empty);
         }
 
-        public static IMessagePathId AddOnecePath<TMessage>(string description, LogEnum logType, Action<TMessage> action, Guid pathId, Type borderType = null) {
-            Type location = GetMessagePathLocation(borderType: borderType);
+        public static IMessagePathId AddOnecePath<TMessage>(string description, LogEnum logType, Action<TMessage> action, Guid pathId, Type location) {
             return MessagePath<TMessage>.AddMessagePath(MessageHub, location, description, logType, action, pathId, viaLimit: 1);
         }
 
-        public static IMessagePathId AddViaLimitPath<TMessage>(string description, LogEnum logType, Action<TMessage> action, int viaLimit, Type borderType = null) {
-            Type location = GetMessagePathLocation(borderType: borderType);
+        public static IMessagePathId AddViaLimitPath<TMessage>(string description, LogEnum logType, Action<TMessage> action, int viaLimit, Type location) {
             return MessagePath<TMessage>.AddMessagePath(MessageHub, location, description, logType, action, Guid.Empty, viaLimit);
         }
 
-        // 慢了1000多倍,但是这不是一个常调的方法
-        // 基于边界类型找到接线的地点
-        private static Type GetMessagePathLocation(Type borderType) {
-            if (borderType == null) {
-                borderType = typeof(VirtualRoot);
-            }
-            StackTrace ss = new StackTrace(false);
-            int index = 1;
-            Type location = ss.GetFrame(index).GetMethod().DeclaringType;
-            while (location != borderType) {
-                index++;
-                if (index == ss.FrameCount) {
-                    throw new InvalidProgramException("到底了");
-                }
-                if (index > 10) {
-                    throw new InvalidProgramException("不可能这么深");
-                }
-                location = ss.GetFrame(index).GetMethod().DeclaringType;
-            }
-            while (location == borderType) {
-                index++;
-                if (index == ss.FrameCount) {
-                    throw new InvalidProgramException("到底了");
-                }
-                if (index > 10) {
-                    throw new InvalidProgramException("不可能这么深");
-                }
-                location = ss.GetFrame(index).GetMethod().DeclaringType;
-            }
-            return location;
-        }
-
-        public static void AddCmdPath<TCmd>(Action<TCmd> action, LogEnum logType = LogEnum.DevConsole, Type borderType = null)
+        public static void AddCmdPath<TCmd>(Action<TCmd> action, Type location, LogEnum logType = LogEnum.DevConsole)
             where TCmd : ICmd {
             MessageTypeAttribute messageTypeDescription = MessageTypeAttribute.GetMessageTypeAttribute(typeof(TCmd));
             string description = "处理" + messageTypeDescription.Description;
-            AddMessagePath(description, logType, action, borderType);
+            AddMessagePath(description, logType, action, location);
         }
 
-        public static IMessagePathId AddEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action, Type borderType = null)
+        public static IMessagePathId AddEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action, Type location)
             where TEvent : IEvent {
-            return AddMessagePath(description, logType, action, borderType);
+            return AddMessagePath(description, logType, action, location);
         }
 
         public static void DeletePath(IMessagePathId handler) {