ntminer 5 years ago
parent
commit
756d8204a3

+ 3 - 2
src/MinerClient/App.xaml.cs

@@ -1,4 +1,5 @@
 using NTMiner.Core;
+using NTMiner.Hub;
 using NTMiner.Notifications;
 using NTMiner.RemoteDesktop;
 using NTMiner.View;
@@ -147,10 +148,10 @@ namespace NTMiner {
                         return;
                     }
                     var coinShare = NTMinerRoot.Instance.CoinShareSet.GetOrCreate(mainCoin.GetId());
-                    VirtualRoot.RaiseEvent(new ShareChangedEvent(Guid.Empty, coinShare));
+                    VirtualRoot.RaiseEvent(new ShareChangedEvent(PathId.Empty, coinShare));
                     if ((NTMinerRoot.Instance.LockedMineContext is IDualMineContext dualMineContext) && dualMineContext.DualCoin != null) {
                         coinShare = NTMinerRoot.Instance.CoinShareSet.GetOrCreate(dualMineContext.DualCoin.GetId());
-                        VirtualRoot.RaiseEvent(new ShareChangedEvent(Guid.Empty, coinShare));
+                        VirtualRoot.RaiseEvent(new ShareChangedEvent(PathId.Empty, coinShare));
                     }
                     AppContext.Instance.GpuSpeedVms.Refresh();
                 }

+ 73 - 73
src/NTMinerClient/Core/Messages.cs

@@ -169,19 +169,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加工作后")]
     public class MineWorkAddedEvent : DomainEvent<IMineWork> {
-        public MineWorkAddedEvent(RouteToPathId routeToPathId, IMineWork source) : base(routeToPathId, source) {
+        public MineWorkAddedEvent(PathId routeToPathId, IMineWork source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新工作后")]
     public class MineWorkUpdatedEvent : DomainEvent<IMineWork> {
-        public MineWorkUpdatedEvent(RouteToPathId routeToPathId, IMineWork source) : base(routeToPathId, source) {
+        public MineWorkUpdatedEvent(PathId routeToPathId, IMineWork source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除工作后")]
     public class MineWorkRemovedEvent : DomainEvent<IMineWork> {
-        public MineWorkRemovedEvent(RouteToPathId routeToPathId, IMineWork source) : base(routeToPathId, source) {
+        public MineWorkRemovedEvent(PathId routeToPathId, IMineWork source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -207,19 +207,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加矿机分组后")]
     public class MinerGroupAddedEvent : DomainEvent<IMinerGroup> {
-        public MinerGroupAddedEvent(RouteToPathId routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
+        public MinerGroupAddedEvent(PathId routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新矿机分组后")]
     public class MinerGroupUpdatedEvent : DomainEvent<IMinerGroup> {
-        public MinerGroupUpdatedEvent(RouteToPathId routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
+        public MinerGroupUpdatedEvent(PathId routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除矿机分组后")]
     public class MinerGroupRemovedEvent : DomainEvent<IMinerGroup> {
-        public MinerGroupRemovedEvent(RouteToPathId routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
+        public MinerGroupRemovedEvent(PathId routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -245,19 +245,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加NTMiner钱包后")]
     public class NTMinerWalletAddedEvent : DomainEvent<INTMinerWallet> {
-        public NTMinerWalletAddedEvent(RouteToPathId routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
+        public NTMinerWalletAddedEvent(PathId routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新NTMiner钱包后")]
     public class NTMinerWalletUpdatedEvent : DomainEvent<INTMinerWallet> {
-        public NTMinerWalletUpdatedEvent(RouteToPathId routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
+        public NTMinerWalletUpdatedEvent(PathId routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除NTMiner钱包后")]
     public class NTMinerWalletRemovedEvent : DomainEvent<INTMinerWallet> {
-        public NTMinerWalletRemovedEvent(RouteToPathId routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
+        public NTMinerWalletRemovedEvent(PathId routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -283,19 +283,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加超频建议后")]
     public class OverClockDataAddedEvent : DomainEvent<IOverClockData> {
-        public OverClockDataAddedEvent(RouteToPathId routeToPathId, IOverClockData source) : base(routeToPathId, source) {
+        public OverClockDataAddedEvent(PathId routeToPathId, IOverClockData source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新超频建议后")]
     public class OverClockDataUpdatedEvent : DomainEvent<IOverClockData> {
-        public OverClockDataUpdatedEvent(RouteToPathId routeToPathId, IOverClockData source) : base(routeToPathId, source) {
+        public OverClockDataUpdatedEvent(PathId routeToPathId, IOverClockData source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除超频建议后")]
     public class OverClockDataRemovedEvent : DomainEvent<IOverClockData> {
-        public OverClockDataRemovedEvent(RouteToPathId routeToPathId, IOverClockData source) : base(routeToPathId, source) {
+        public OverClockDataRemovedEvent(PathId routeToPathId, IOverClockData source) : base(routeToPathId, source) {
         }
     }
 
@@ -333,19 +333,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加列显后")]
     public class ColumnsShowAddedEvent : DomainEvent<IColumnsShow> {
-        public ColumnsShowAddedEvent(RouteToPathId routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
+        public ColumnsShowAddedEvent(PathId routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新列显后")]
     public class ColumnsShowUpdatedEvent : DomainEvent<IColumnsShow> {
-        public ColumnsShowUpdatedEvent(RouteToPathId routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
+        public ColumnsShowUpdatedEvent(PathId routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除列显后")]
     public class ColumnsShowRemovedEvent : DomainEvent<IColumnsShow> {
-        public ColumnsShowRemovedEvent(RouteToPathId routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
+        public ColumnsShowRemovedEvent(PathId routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -371,13 +371,13 @@ namespace NTMiner.Core {
     
     [MessageType(description: "币种超频完成后")]
     public class CoinOverClockDoneEvent : EventBase {
-        public CoinOverClockDoneEvent(RouteToPathId routeToPathId) : base(routeToPathId) {
+        public CoinOverClockDoneEvent(PathId routeToPathId) : base(routeToPathId) {
         }
     }
 
     [MessageType(description: "Gpu超频数据添加或更新后")]
     public class GpuProfileAddedOrUpdatedEvent : DomainEvent<IGpuProfile> {
-        public GpuProfileAddedOrUpdatedEvent(RouteToPathId routeToPathId, IGpuProfile source) : base(routeToPathId, source) {
+        public GpuProfileAddedOrUpdatedEvent(PathId routeToPathId, IGpuProfile source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -385,7 +385,7 @@ namespace NTMiner.Core {
     #region speed and share
     [MessageType(description: "显卡算力变更事件")]
     public class GpuSpeedChangedEvent : DomainEvent<IGpuSpeed> {
-        public GpuSpeedChangedEvent(bool isDual, RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public GpuSpeedChangedEvent(bool isDual, PathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
             this.IsDual = isDual;
         }
 
@@ -394,37 +394,37 @@ namespace NTMiner.Core {
 
     [MessageType(description: "显卡份额变更事件")]
     public class GpuShareChangedEvent : DomainEvent<IGpuSpeed> {
-        public GpuShareChangedEvent(RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public GpuShareChangedEvent(PathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "找到了一个份额")]
     public class FoundShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public FoundShareIncreasedEvent(RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public FoundShareIncreasedEvent(PathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "接受了一个份额")]
     public class AcceptShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public AcceptShareIncreasedEvent(RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public AcceptShareIncreasedEvent(PathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "拒绝了一个份额")]
     public class RejectShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public RejectShareIncreasedEvent(RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public RejectShareIncreasedEvent(PathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "算错了一个份额")]
     public class IncorrectShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public IncorrectShareIncreasedEvent(RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public IncorrectShareIncreasedEvent(PathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "收益变更事件")]
     public class ShareChangedEvent : DomainEvent<ICoinShare> {
-        public ShareChangedEvent(RouteToPathId routeToPathId, ICoinShare share) : base(routeToPathId, share) {
+        public ShareChangedEvent(PathId routeToPathId, ICoinShare share) : base(routeToPathId, share) {
         }
     }
     #endregion
@@ -432,7 +432,7 @@ namespace NTMiner.Core {
     #region Gpu Messages
     [MessageType(description: "显卡状态变更事件", isCanNoHandler: true)]
     public class GpuStateChangedEvent : DomainEvent<IGpu> {
-        public GpuStateChangedEvent(RouteToPathId routeToPathId, IGpu source) : base(routeToPathId, source) {
+        public GpuStateChangedEvent(PathId routeToPathId, IGpu source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -458,19 +458,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加系统字典后")]
     public class SysDicAddedEvent : DomainEvent<ISysDic> {
-        public SysDicAddedEvent(RouteToPathId routeToPathId, ISysDic source) : base(routeToPathId, source) {
+        public SysDicAddedEvent(PathId routeToPathId, ISysDic source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新系统字典后")]
     public class SysDicUpdatedEvent : DomainEvent<ISysDic> {
-        public SysDicUpdatedEvent(RouteToPathId routeToPathId, ISysDic source) : base(routeToPathId, source) {
+        public SysDicUpdatedEvent(PathId routeToPathId, ISysDic source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除系统字典后")]
     public class SysDicRemovedEvent : DomainEvent<ISysDic> {
-        public SysDicRemovedEvent(RouteToPathId routeToPathId, ISysDic source) : base(routeToPathId, source) {
+        public SysDicRemovedEvent(PathId routeToPathId, ISysDic source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -496,19 +496,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了系统字典项后")]
     public class SysDicItemAddedEvent : DomainEvent<ISysDicItem> {
-        public SysDicItemAddedEvent(RouteToPathId routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
+        public SysDicItemAddedEvent(PathId routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了系统字典项后")]
     public class SysDicItemUpdatedEvent : DomainEvent<ISysDicItem> {
-        public SysDicItemUpdatedEvent(RouteToPathId routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
+        public SysDicItemUpdatedEvent(PathId routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除了系统字典项后")]
     public class SysDicItemRemovedEvent : DomainEvent<ISysDicItem> {
-        public SysDicItemRemovedEvent(RouteToPathId routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
+        public SysDicItemRemovedEvent(PathId routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -534,25 +534,25 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了币种后")]
     public class CoinAddedEvent : DomainEvent<ICoin> {
-        public CoinAddedEvent(RouteToPathId routeToPathId, ICoin source) : base(routeToPathId, source) {
+        public CoinAddedEvent(PathId routeToPathId, ICoin source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了币种后")]
     public class CoinUpdatedEvent : DomainEvent<ICoin> {
-        public CoinUpdatedEvent(RouteToPathId routeToPathId, ICoin source) : base(routeToPathId, source) {
+        public CoinUpdatedEvent(PathId routeToPathId, ICoin source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了币种后")]
     public class CoinRemovedEvent : DomainEvent<ICoin> {
-        public CoinRemovedEvent(RouteToPathId routeToPathId, ICoin source) : base(routeToPathId, source) {
+        public CoinRemovedEvent(PathId routeToPathId, ICoin source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "下载了币种图标后")]
     public class CoinIconDownloadedEvent : DomainEvent<ICoin> {
-        public CoinIconDownloadedEvent(RouteToPathId routeToPathId, ICoin source) : base(routeToPathId, source) {
+        public CoinIconDownloadedEvent(PathId routeToPathId, ICoin source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -578,19 +578,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了组后")]
     public class GroupAddedEvent : DomainEvent<IGroup> {
-        public GroupAddedEvent(RouteToPathId routeToPathId, IGroup source) : base(routeToPathId, source) {
+        public GroupAddedEvent(PathId routeToPathId, IGroup source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了组后")]
     public class GroupUpdatedEvent : DomainEvent<IGroup> {
-        public GroupUpdatedEvent(RouteToPathId routeToPathId, IGroup source) : base(routeToPathId, source) {
+        public GroupUpdatedEvent(PathId routeToPathId, IGroup source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了组后")]
     public class GroupRemovedEvent : DomainEvent<IGroup> {
-        public GroupRemovedEvent(RouteToPathId routeToPathId, IGroup source) : base(routeToPathId, source) {
+        public GroupRemovedEvent(PathId routeToPathId, IGroup source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -616,13 +616,13 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了币组后")]
     public class CoinGroupAddedEvent : DomainEvent<ICoinGroup> {
-        public CoinGroupAddedEvent(RouteToPathId routeToPathId, ICoinGroup source) : base(routeToPathId, source) {
+        public CoinGroupAddedEvent(PathId routeToPathId, ICoinGroup source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了币组后")]
     public class CoinGroupRemovedEvent : DomainEvent<ICoinGroup> {
-        public CoinGroupRemovedEvent(RouteToPathId routeToPathId, ICoinGroup source) : base(routeToPathId, source) {
+        public CoinGroupRemovedEvent(PathId routeToPathId, ICoinGroup source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -648,19 +648,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了文件书写器后")]
     public class FileWriterAddedEvent : DomainEvent<IFileWriter> {
-        public FileWriterAddedEvent(RouteToPathId routeToPathId, IFileWriter source) : base(routeToPathId, source) {
+        public FileWriterAddedEvent(PathId routeToPathId, IFileWriter source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了文件书写器后")]
     public class FileWriterUpdatedEvent : DomainEvent<IFileWriter> {
-        public FileWriterUpdatedEvent(RouteToPathId routeToPathId, IFileWriter source) : base(routeToPathId, source) {
+        public FileWriterUpdatedEvent(PathId routeToPathId, IFileWriter source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了文件书写器后")]
     public class FileWriterRemovedEvent : DomainEvent<IFileWriter> {
-        public FileWriterRemovedEvent(RouteToPathId routeToPathId, IFileWriter source) : base(routeToPathId, source) {
+        public FileWriterRemovedEvent(PathId routeToPathId, IFileWriter source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -686,19 +686,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了命令行片段书写器后")]
     public class FragmentWriterAddedEvent : DomainEvent<IFragmentWriter> {
-        public FragmentWriterAddedEvent(RouteToPathId routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
+        public FragmentWriterAddedEvent(PathId routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了命令行片段书写器后")]
     public class FragmentWriterUpdatedEvent : DomainEvent<IFragmentWriter> {
-        public FragmentWriterUpdatedEvent(RouteToPathId routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
+        public FragmentWriterUpdatedEvent(PathId routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了命令行片段书写器后")]
     public class FragmentWriterRemovedEvent : DomainEvent<IFragmentWriter> {
-        public FragmentWriterRemovedEvent(RouteToPathId routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
+        public FragmentWriterRemovedEvent(PathId routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -724,19 +724,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了钱包后")]
     public class WalletAddedEvent : DomainEvent<IWallet> {
-        public WalletAddedEvent(RouteToPathId routeToPathId, IWallet source) : base(routeToPathId, source) {
+        public WalletAddedEvent(PathId routeToPathId, IWallet source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了钱包后")]
     public class WalletUpdatedEvent : DomainEvent<IWallet> {
-        public WalletUpdatedEvent(RouteToPathId routeToPathId, IWallet source) : base(routeToPathId, source) {
+        public WalletUpdatedEvent(PathId routeToPathId, IWallet source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了钱包后")]
     public class WalletRemovedEvent : DomainEvent<IWallet> {
-        public WalletRemovedEvent(RouteToPathId routeToPathId, IWallet source) : base(routeToPathId, source) {
+        public WalletRemovedEvent(PathId routeToPathId, IWallet source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -762,19 +762,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了矿池后")]
     public class PoolAddedEvent : DomainEvent<IPool> {
-        public PoolAddedEvent(RouteToPathId routeToPathId, IPool source) : base(routeToPathId, source) {
+        public PoolAddedEvent(PathId routeToPathId, IPool source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了矿池后")]
     public class PoolUpdatedEvent : DomainEvent<IPool> {
-        public PoolUpdatedEvent(RouteToPathId routeToPathId, IPool source) : base(routeToPathId, source) {
+        public PoolUpdatedEvent(PathId routeToPathId, IPool source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了矿池后")]
     public class PoolRemovedEvent : DomainEvent<IPool> {
-        public PoolRemovedEvent(RouteToPathId routeToPathId, IPool source) : base(routeToPathId, source) {
+        public PoolRemovedEvent(PathId routeToPathId, IPool source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -800,19 +800,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了币种级内核后")]
     public class CoinKernelAddedEvent : DomainEvent<ICoinKernel> {
-        public CoinKernelAddedEvent(RouteToPathId routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
+        public CoinKernelAddedEvent(PathId routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了币种级内核后")]
     public class CoinKernelUpdatedEvent : DomainEvent<ICoinKernel> {
-        public CoinKernelUpdatedEvent(RouteToPathId routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
+        public CoinKernelUpdatedEvent(PathId routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了币种级内核后")]
     public class CoinKernelRemovedEvent : DomainEvent<ICoinKernel> {
-        public CoinKernelRemovedEvent(RouteToPathId routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
+        public CoinKernelRemovedEvent(PathId routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -838,19 +838,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了矿池级内核后")]
     public class PoolKernelAddedEvent : DomainEvent<IPoolKernel> {
-        public PoolKernelAddedEvent(RouteToPathId routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
+        public PoolKernelAddedEvent(PathId routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了矿池级内核后")]
     public class PoolKernelUpdatedEvent : DomainEvent<IPoolKernel> {
-        public PoolKernelUpdatedEvent(RouteToPathId routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
+        public PoolKernelUpdatedEvent(PathId routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了矿池级内核后")]
     public class PoolKernelRemovedEvent : DomainEvent<IPoolKernel> {
-        public PoolKernelRemovedEvent(RouteToPathId routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
+        public PoolKernelRemovedEvent(PathId routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -876,19 +876,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了包后")]
     public class PackageAddedEvent : DomainEvent<IPackage> {
-        public PackageAddedEvent(RouteToPathId routeToPathId, IPackage source) : base(routeToPathId, source) {
+        public PackageAddedEvent(PathId routeToPathId, IPackage source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了包后")]
     public class PackageUpdatedEvent : DomainEvent<IPackage> {
-        public PackageUpdatedEvent(RouteToPathId routeToPathId, IPackage source) : base(routeToPathId, source) {
+        public PackageUpdatedEvent(PathId routeToPathId, IPackage source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除了包后")]
     public class PackageRemovedEvent : DomainEvent<IPackage> {
-        public PackageRemovedEvent(RouteToPathId routeToPathId, IPackage source) : base(routeToPathId, source) {
+        public PackageRemovedEvent(PathId routeToPathId, IPackage source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -914,19 +914,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核后")]
     public class KernelAddedEvent : DomainEvent<IKernel> {
-        public KernelAddedEvent(RouteToPathId routeToPathId, IKernel source) : base(routeToPathId, source) {
+        public KernelAddedEvent(PathId routeToPathId, IKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核后")]
     public class KernelUpdatedEvent : DomainEvent<IKernel> {
-        public KernelUpdatedEvent(RouteToPathId routeToPathId, IKernel source) : base(routeToPathId, source) {
+        public KernelUpdatedEvent(PathId routeToPathId, IKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除了内核后")]
     public class KernelRemovedEvent : DomainEvent<IKernel> {
-        public KernelRemovedEvent(RouteToPathId routeToPathId, IKernel source) : base(routeToPathId, source) {
+        public KernelRemovedEvent(PathId routeToPathId, IKernel source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -952,19 +952,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核输入组后")]
     public class KernelInputAddedEvent : DomainEvent<IKernelInput> {
-        public KernelInputAddedEvent(RouteToPathId routeToPathId, IKernelInput source) : base(routeToPathId, source) {
+        public KernelInputAddedEvent(PathId routeToPathId, IKernelInput source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核输入组后")]
     public class KernelInputUpdatedEvent : DomainEvent<IKernelInput> {
-        public KernelInputUpdatedEvent(RouteToPathId routeToPathId, IKernelInput source) : base(routeToPathId, source) {
+        public KernelInputUpdatedEvent(PathId routeToPathId, IKernelInput source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了内核输入组后")]
     public class KernelInputRemovedEvent : DomainEvent<IKernelInput> {
-        public KernelInputRemovedEvent(RouteToPathId routeToPathId, IKernelInput source) : base(routeToPathId, source) {
+        public KernelInputRemovedEvent(PathId routeToPathId, IKernelInput source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -990,19 +990,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核输出组后")]
     public class KernelOutputAddedEvent : DomainEvent<IKernelOutput> {
-        public KernelOutputAddedEvent(RouteToPathId routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
+        public KernelOutputAddedEvent(PathId routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核输出组后")]
     public class KernelOutputUpdatedEvent : DomainEvent<IKernelOutput> {
-        public KernelOutputUpdatedEvent(RouteToPathId routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
+        public KernelOutputUpdatedEvent(PathId routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了内核输出组后")]
     public class KernelOutputRemovedEvent : DomainEvent<IKernelOutput> {
-        public KernelOutputRemovedEvent(RouteToPathId routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
+        public KernelOutputRemovedEvent(PathId routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -1028,19 +1028,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核输出翻译器后")]
     public class KernelOutputTranslaterAddedEvent : DomainEvent<IKernelOutputTranslater> {
-        public KernelOutputTranslaterAddedEvent(RouteToPathId routeToPathId, IKernelOutputTranslater source) : base(routeToPathId, source) {
+        public KernelOutputTranslaterAddedEvent(PathId routeToPathId, IKernelOutputTranslater source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核输出翻译器后")]
     public class KernelOutputTranslaterUpdatedEvent : DomainEvent<IKernelOutputTranslater> {
-        public KernelOutputTranslaterUpdatedEvent(RouteToPathId routeToPathId, IKernelOutputTranslater source) : base(routeToPathId, source) {
+        public KernelOutputTranslaterUpdatedEvent(PathId routeToPathId, IKernelOutputTranslater source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了内核输出翻译器后")]
     public class KernelOutputTranslaterRemovedEvent : DomainEvent<IKernelOutputTranslater> {
-        public KernelOutputTranslaterRemovedEvent(RouteToPathId routeToPathId, IKernelOutputTranslater source) : base(routeToPathId, source) {
+        public KernelOutputTranslaterRemovedEvent(PathId routeToPathId, IKernelOutputTranslater source) : base(routeToPathId, source) {
         }
     }
     #endregion

+ 2 - 2
src/NTMinerHub/Hub/DomainEvent`1.cs

@@ -2,7 +2,7 @@
 
 namespace NTMiner.Hub {
     public abstract class DomainEvent<TEntity> : IEvent {
-        protected DomainEvent(RouteToPathId routeToPathId, TEntity source) {
+        protected DomainEvent(PathId routeToPathId, TEntity source) {
             this.Id = Guid.NewGuid();
             this.RouteToPathId = routeToPathId;
             this.Target = source;
@@ -10,7 +10,7 @@ namespace NTMiner.Hub {
         }
 
         public Guid Id { get; private set; }
-        public RouteToPathId RouteToPathId { get; private set; }
+        public PathId RouteToPathId { get; private set; }
         public DateTime BornOn { get; private set; }
         public TEntity Target { get; private set; }
     }

+ 3 - 3
src/NTMinerHub/Hub/EventBase.cs

@@ -5,16 +5,16 @@ namespace NTMiner.Hub {
         protected EventBase() {
             this.Id = Guid.NewGuid();
             this.BornOn = DateTime.Now;
-            this.RouteToPathId = RouteToPathId.All;
+            this.RouteToPathId = PathId.Empty;
         }
 
-        protected EventBase(RouteToPathId routeToPathId) : this() {
+        protected EventBase(PathId routeToPathId) : this() {
             this.RouteToPathId = routeToPathId;
         }
 
         public Guid Id { get; private set; }
 
-        public RouteToPathId RouteToPathId { get; private set; }
+        public PathId RouteToPathId { get; private set; }
 
         public DateTime BornOn { get; private set; }
     }

+ 1 - 1
src/NTMinerHub/Hub/IEvent.cs

@@ -2,7 +2,7 @@
     using System;
 
     public interface IEvent : IMessage {
-        RouteToPathId RouteToPathId { get; }
+        PathId RouteToPathId { get; }
         DateTime BornOn { get; }
     }
 }

+ 1 - 1
src/NTMinerHub/Hub/IMessagePathId.cs

@@ -3,7 +3,7 @@
 namespace NTMiner.Hub {
     
     public interface IMessagePathId {
-        Guid PathId { get; }
+        PathId PathId { get; }
         DateTime CreatedOn { get; }
         /// <summary>
         /// 表示该条消息路径允许消息通过的次数

+ 3 - 3
src/NTMinerHub/Hub/MessageHub.cs

@@ -116,13 +116,13 @@
                     bool canGo = false;
                     if (message is IEvent evt) {
                         canGo = 
-                            evt.RouteToPathId.IsAll // 事件不是特定路径的事件则放行
-                            || messagePath.PathId == RouteToPathId.All // 路径不是特定事件的路径则放行
+                            evt.RouteToPathId == PathId.Empty // 事件不是特定路径的事件则放行
+                            || messagePath.PathId == PathId.Empty // 路径不是特定事件的路径则放行
                             || evt.RouteToPathId == messagePath.PathId; // 路径是特定事件的路径且路径和事件造型放行
                     }
                     else if (message is ICmd cmd) {
                         // 路径不是特定命令的路径则放行
-                        if (messagePath.PathId == RouteToPathId.All) {
+                        if (messagePath.PathId == PathId.Empty) {
                             canGo = true;
                         }
                         else {

+ 3 - 3
src/NTMinerHub/Hub/MessagePath`1.cs

@@ -18,7 +18,7 @@ namespace NTMiner.Hub {
         public event PropertyChangedEventHandler PropertyChanged;
 #endif
 
-        public static MessagePath<TMessage> AddMessagePath(IMessageHub hub, Type location, string description, LogEnum logType, Action<TMessage> action, Guid pathId, int viaTimesLimit = -1) {
+        public static MessagePath<TMessage> AddMessagePath(IMessageHub hub, Type location, string description, LogEnum logType, Action<TMessage> action, PathId pathId, int viaTimesLimit = -1) {
             if (action == null) {
                 throw new ArgumentNullException(nameof(action));
             }
@@ -27,7 +27,7 @@ namespace NTMiner.Hub {
             return path;
         }
 
-        private MessagePath(Type location, string description, LogEnum logType, Action<TMessage> action, Guid pathId, int viaTimesLimit) {
+        private MessagePath(Type location, string description, LogEnum logType, Action<TMessage> action, PathId pathId, int viaTimesLimit) {
             if (viaTimesLimit == 0) {
                 throw new InvalidProgramException("消息路径的viaTimesLimit不能为0,可以为负数表示不限制通过次数或为正数表示限定通过次数,但不能为0");
             }
@@ -60,7 +60,7 @@ namespace NTMiner.Hub {
 #endif
         }
 
-        public Guid PathId { get; private set; }
+        public PathId PathId { get; private set; }
         public DateTime CreatedOn { get; private set; }
         public Type MessageType { get; private set; }
         public Type Location { get; private set; }

+ 53 - 0
src/NTMinerHub/Hub/PathId.cs

@@ -0,0 +1,53 @@
+using System;
+
+namespace NTMiner.Hub {
+    public struct PathId {
+        public static PathId Empty = new PathId(Guid.Empty);
+
+        private readonly Guid Id;
+
+        public PathId(Guid id) {
+            this.Id = id;
+        }
+
+        public static implicit operator PathId(Guid id) {
+            return new PathId(id);
+        }
+
+        public static bool operator==(PathId pathId, Guid id) {
+            return pathId.Id == id;
+        }
+
+        public static bool operator!=(PathId pathId, Guid id) {
+            return !(pathId == id);
+        }
+
+        public static bool operator ==(PathId left, PathId right) {
+            return left.Id == right.Id;
+        }
+
+        public static bool operator !=(PathId left, PathId right) {
+            return !(left == right);
+        }
+
+        public override bool Equals(object obj) {
+            if (obj == null) {
+                return false;
+            }
+
+            if (!(obj is PathId data)) {
+                return false;
+            }
+
+            return this.Id == data.Id;
+        }
+
+        public bool Equals(PathId obj) {
+            return this.Id == obj.Id;
+        }
+
+        public override int GetHashCode() {
+            return this.Id.GetHashCode();
+        }
+    }
+}

+ 0 - 59
src/NTMinerHub/Hub/RouteToPathId.cs

@@ -1,59 +0,0 @@
-using System;
-
-namespace NTMiner.Hub {
-    public struct RouteToPathId {
-        public static RouteToPathId All = new RouteToPathId(Guid.Empty);
-
-        public readonly Guid PathId;
-
-        public RouteToPathId(Guid pathId) {
-            this.PathId = pathId;
-        }
-
-        public bool IsAll {
-            get {
-                return PathId == Guid.Empty;
-            }
-        }
-
-        public static implicit operator RouteToPathId(Guid guid) {
-            return new RouteToPathId(guid);
-        }
-
-        public static bool operator==(RouteToPathId pathId, Guid guid) {
-            return pathId.PathId == guid;
-        }
-
-        public static bool operator!=(RouteToPathId pathId, Guid guid) {
-            return !(pathId == guid);
-        }
-
-        public static bool operator ==(RouteToPathId left, RouteToPathId right) {
-            return left.PathId == right.PathId;
-        }
-
-        public static bool operator !=(RouteToPathId left, RouteToPathId right) {
-            return !(left == right);
-        }
-
-        public override bool Equals(object obj) {
-            if (obj == null) {
-                return false;
-            }
-
-            if (!(obj is RouteToPathId data)) {
-                return false;
-            }
-
-            return this.PathId == data.PathId;
-        }
-
-        public bool Equals(RouteToPathId obj) {
-            return this.PathId == obj.PathId;
-        }
-
-        public override int GetHashCode() {
-            return this.PathId.GetHashCode();
-        }
-    }
-}

+ 1 - 1
src/NTMinerHub/NTMinerHub.csproj

@@ -46,7 +46,7 @@
     <Compile Include="Hub\IMessageHub.cs" />
     <Compile Include="Hub\MessageHub.cs" />
     <Compile Include="Hub\MessageTypeAttribute.cs" />
-    <Compile Include="Hub\RouteToPathId.cs" />
+    <Compile Include="Hub\PathId.cs" />
     <Compile Include="Messages.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Timing\AbstractTimer.cs" />

+ 6 - 6
src/NTMinerlib/Messages.cs

@@ -65,7 +65,7 @@ namespace NTMiner {
 
     [MessageType(description: "ServerAppSetting变更后")]
     public class ServerAppSettingSetedEvent : DomainEvent<IAppSetting> {
-        public ServerAppSettingSetedEvent(RouteToPathId routeToPathId, IAppSetting source) : base(routeToPathId, source) {
+        public ServerAppSettingSetedEvent(PathId routeToPathId, IAppSetting source) : base(routeToPathId, source) {
         }
     }
 
@@ -98,7 +98,7 @@ namespace NTMiner {
 
     [MessageType(description: "LocalAppSetting变更后")]
     public class LocalAppSettingChangedEvent : DomainEvent<IAppSetting> {
-        public LocalAppSettingChangedEvent(RouteToPathId routeToPathId, IAppSetting source) : base(routeToPathId, source) {
+        public LocalAppSettingChangedEvent(PathId routeToPathId, IAppSetting source) : base(routeToPathId, source) {
         }
     }
 
@@ -131,13 +131,13 @@ namespace NTMiner {
 
     [MessageType(description: "添加了用户自定义内核输出关键字后")]
     public class UserKernelOutputKeywordAddedEvent : DomainEvent<IKernelOutputKeyword> {
-        public UserKernelOutputKeywordAddedEvent(RouteToPathId routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
+        public UserKernelOutputKeywordAddedEvent(PathId routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了用户自定义内核输出关键字后")]
     public class UserKernelOutputKeywordUpdatedEvent : DomainEvent<IKernelOutputKeyword> {
-        public UserKernelOutputKeywordUpdatedEvent(RouteToPathId routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
+        public UserKernelOutputKeywordUpdatedEvent(PathId routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
         }
     }
 
@@ -149,7 +149,7 @@ namespace NTMiner {
 
     [MessageType(description: "移除了用户自定义内核输出关键字后")]
     public class UserKernelOutputKeywordRemovedEvent : DomainEvent<IKernelOutputKeyword> {
-        public UserKernelOutputKeywordRemovedEvent(RouteToPathId routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
+        public UserKernelOutputKeywordRemovedEvent(PathId routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
 
         }
     }
@@ -163,7 +163,7 @@ namespace NTMiner {
 
     [MessageType(description: "记录了本地事件后")]
     public class LocalMessageAddedEvent : DomainEvent<ILocalMessage> {
-        public LocalMessageAddedEvent(RouteToPathId routeToPathId, ILocalMessage source, List<ILocalMessage> removes) : base(routeToPathId, source) {
+        public LocalMessageAddedEvent(PathId routeToPathId, ILocalMessage source, List<ILocalMessage> removes) : base(routeToPathId, source) {
             this.Removes = removes ?? new List<ILocalMessage>();
         }
 

+ 3 - 3
src/NTMinerlib/User/Messages.cs

@@ -55,19 +55,19 @@ namespace NTMiner.User {
 
     [MessageType(description: "添加了新用户后")]
     public class UserAddedEvent : DomainEvent<IUser> {
-        public UserAddedEvent(RouteToPathId routeToPathId, IUser source) : base(routeToPathId, source) {
+        public UserAddedEvent(PathId routeToPathId, IUser source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "修改了用户后")]
     public class UserUpdatedEvent : DomainEvent<IUser> {
-        public UserUpdatedEvent(RouteToPathId routeToPathId, IUser source) : base(routeToPathId, source) {
+        public UserUpdatedEvent(PathId routeToPathId, IUser source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了用户后")]
     public class UserRemovedEvent : DomainEvent<IUser> {
-        public UserRemovedEvent(RouteToPathId routeToPathId, IUser source) : base(routeToPathId, source) {
+        public UserRemovedEvent(PathId routeToPathId, IUser source) : base(routeToPathId, source) {
         }
     }
 }

+ 3 - 3
src/NTMinerlib/VirtualRoot.partials.Hub.cs

@@ -28,15 +28,15 @@ namespace NTMiner {
 
         // 修建消息(命令或事件)的运动路径
         public static IMessagePathId AddMessagePath<TMessage>(string description, LogEnum logType, Action<TMessage> action, Type location) {
-            return MessagePath<TMessage>.AddMessagePath(MessageHub, location, description, logType, action, pathId: Guid.Empty);
+            return MessagePath<TMessage>.AddMessagePath(MessageHub, location, description, logType, action, pathId: PathId.Empty);
         }
 
-        public static IMessagePathId AddOnecePath<TMessage>(string description, LogEnum logType, Action<TMessage> action, Guid pathId, Type location) {
+        public static IMessagePathId AddOnecePath<TMessage>(string description, LogEnum logType, Action<TMessage> action, PathId pathId, Type location) {
             return MessagePath<TMessage>.AddMessagePath(MessageHub, location, description, logType, action, pathId, viaTimesLimit: 1);
         }
 
         public static IMessagePathId AddViaTimesLimitPath<TMessage>(string description, LogEnum logType, Action<TMessage> action, int viaTimesLimit, Type location) {
-            return MessagePath<TMessage>.AddMessagePath(MessageHub, location, description, logType, action, pathId: Guid.Empty, viaTimesLimit: viaTimesLimit);
+            return MessagePath<TMessage>.AddMessagePath(MessageHub, location, description, logType, action, pathId: PathId.Empty, viaTimesLimit: viaTimesLimit);
         }
 
         public static void AddCmdPath<TCmd>(Action<TCmd> action, Type location, LogEnum logType = LogEnum.DevConsole)