ntminer 6 years ago
parent
commit
da19e1a01a

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

@@ -164,19 +164,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加工作后")]
     public class MineWorkAddedEvent : DomainEvent<IMineWork> {
-        public MineWorkAddedEvent(Guid routeToPathId, IMineWork source) : base(routeToPathId, source) {
+        public MineWorkAddedEvent(RouteToPathId routeToPathId, IMineWork source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新工作后")]
     public class MineWorkUpdatedEvent : DomainEvent<IMineWork> {
-        public MineWorkUpdatedEvent(Guid routeToPathId, IMineWork source) : base(routeToPathId, source) {
+        public MineWorkUpdatedEvent(RouteToPathId routeToPathId, IMineWork source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除工作后")]
     public class MineWorkRemovedEvent : DomainEvent<IMineWork> {
-        public MineWorkRemovedEvent(Guid routeToPathId, IMineWork source) : base(routeToPathId, source) {
+        public MineWorkRemovedEvent(RouteToPathId routeToPathId, IMineWork source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -202,19 +202,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加矿机分组后")]
     public class MinerGroupAddedEvent : DomainEvent<IMinerGroup> {
-        public MinerGroupAddedEvent(Guid routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
+        public MinerGroupAddedEvent(RouteToPathId routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新矿机分组后")]
     public class MinerGroupUpdatedEvent : DomainEvent<IMinerGroup> {
-        public MinerGroupUpdatedEvent(Guid routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
+        public MinerGroupUpdatedEvent(RouteToPathId routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除矿机分组后")]
     public class MinerGroupRemovedEvent : DomainEvent<IMinerGroup> {
-        public MinerGroupRemovedEvent(Guid routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
+        public MinerGroupRemovedEvent(RouteToPathId routeToPathId, IMinerGroup source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -240,19 +240,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加NTMiner钱包后")]
     public class NTMinerWalletAddedEvent : DomainEvent<INTMinerWallet> {
-        public NTMinerWalletAddedEvent(Guid routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
+        public NTMinerWalletAddedEvent(RouteToPathId routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新NTMiner钱包后")]
     public class NTMinerWalletUpdatedEvent : DomainEvent<INTMinerWallet> {
-        public NTMinerWalletUpdatedEvent(Guid routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
+        public NTMinerWalletUpdatedEvent(RouteToPathId routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除NTMiner钱包后")]
     public class NTMinerWalletRemovedEvent : DomainEvent<INTMinerWallet> {
-        public NTMinerWalletRemovedEvent(Guid routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
+        public NTMinerWalletRemovedEvent(RouteToPathId routeToPathId, INTMinerWallet source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -278,19 +278,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加超频建议后")]
     public class OverClockDataAddedEvent : DomainEvent<IOverClockData> {
-        public OverClockDataAddedEvent(Guid routeToPathId, IOverClockData source) : base(routeToPathId, source) {
+        public OverClockDataAddedEvent(RouteToPathId routeToPathId, IOverClockData source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新超频建议后")]
     public class OverClockDataUpdatedEvent : DomainEvent<IOverClockData> {
-        public OverClockDataUpdatedEvent(Guid routeToPathId, IOverClockData source) : base(routeToPathId, source) {
+        public OverClockDataUpdatedEvent(RouteToPathId routeToPathId, IOverClockData source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除超频建议后")]
     public class OverClockDataRemovedEvent : DomainEvent<IOverClockData> {
-        public OverClockDataRemovedEvent(Guid routeToPathId, IOverClockData source) : base(routeToPathId, source) {
+        public OverClockDataRemovedEvent(RouteToPathId routeToPathId, IOverClockData source) : base(routeToPathId, source) {
         }
     }
 
@@ -328,19 +328,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加列显后")]
     public class ColumnsShowAddedEvent : DomainEvent<IColumnsShow> {
-        public ColumnsShowAddedEvent(Guid routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
+        public ColumnsShowAddedEvent(RouteToPathId routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新列显后")]
     public class ColumnsShowUpdatedEvent : DomainEvent<IColumnsShow> {
-        public ColumnsShowUpdatedEvent(Guid routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
+        public ColumnsShowUpdatedEvent(RouteToPathId routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除列显后")]
     public class ColumnsShowRemovedEvent : DomainEvent<IColumnsShow> {
-        public ColumnsShowRemovedEvent(Guid routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
+        public ColumnsShowRemovedEvent(RouteToPathId routeToPathId, IColumnsShow source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -366,13 +366,13 @@ namespace NTMiner.Core {
     
     [MessageType(description: "币种超频完成后")]
     public class CoinOverClockDoneEvent : EventBase {
-        public CoinOverClockDoneEvent(Guid routeToPathId) : base(routeToPathId) {
+        public CoinOverClockDoneEvent(RouteToPathId routeToPathId) : base(routeToPathId) {
         }
     }
 
     [MessageType(description: "Gpu超频数据添加或更新后")]
     public class GpuProfileAddedOrUpdatedEvent : DomainEvent<IGpuProfile> {
-        public GpuProfileAddedOrUpdatedEvent(Guid routeToPathId, IGpuProfile source) : base(routeToPathId, source) {
+        public GpuProfileAddedOrUpdatedEvent(RouteToPathId routeToPathId, IGpuProfile source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -380,7 +380,7 @@ namespace NTMiner.Core {
     #region speed and share
     [MessageType(description: "显卡算力变更事件")]
     public class GpuSpeedChangedEvent : DomainEvent<IGpuSpeed> {
-        public GpuSpeedChangedEvent(bool isDual, Guid routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public GpuSpeedChangedEvent(bool isDual, RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
             this.IsDual = isDual;
         }
 
@@ -389,37 +389,37 @@ namespace NTMiner.Core {
 
     [MessageType(description: "显卡份额变更事件")]
     public class GpuShareChangedEvent : DomainEvent<IGpuSpeed> {
-        public GpuShareChangedEvent(Guid routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public GpuShareChangedEvent(RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "找到了一个份额")]
     public class FoundShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public FoundShareIncreasedEvent(Guid routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public FoundShareIncreasedEvent(RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "接受了一个份额")]
     public class AcceptShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public AcceptShareIncreasedEvent(Guid routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public AcceptShareIncreasedEvent(RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "拒绝了一个份额")]
     public class RejectShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public RejectShareIncreasedEvent(Guid routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public RejectShareIncreasedEvent(RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "算错了一个份额")]
     public class IncorrectShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public IncorrectShareIncreasedEvent(Guid routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
+        public IncorrectShareIncreasedEvent(RouteToPathId routeToPathId, IGpuSpeed gpuSpeed) : base(routeToPathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "收益变更事件")]
     public class ShareChangedEvent : DomainEvent<ICoinShare> {
-        public ShareChangedEvent(Guid routeToPathId, ICoinShare share) : base(routeToPathId, share) {
+        public ShareChangedEvent(RouteToPathId routeToPathId, ICoinShare share) : base(routeToPathId, share) {
         }
     }
     #endregion
@@ -427,7 +427,7 @@ namespace NTMiner.Core {
     #region Gpu Messages
     [MessageType(description: "显卡状态变更事件", isCanNoHandler: true)]
     public class GpuStateChangedEvent : DomainEvent<IGpu> {
-        public GpuStateChangedEvent(Guid routeToPathId, IGpu source) : base(routeToPathId, source) {
+        public GpuStateChangedEvent(RouteToPathId routeToPathId, IGpu source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -453,19 +453,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加系统字典后")]
     public class SysDicAddedEvent : DomainEvent<ISysDic> {
-        public SysDicAddedEvent(Guid routeToPathId, ISysDic source) : base(routeToPathId, source) {
+        public SysDicAddedEvent(RouteToPathId routeToPathId, ISysDic source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新系统字典后")]
     public class SysDicUpdatedEvent : DomainEvent<ISysDic> {
-        public SysDicUpdatedEvent(Guid routeToPathId, ISysDic source) : base(routeToPathId, source) {
+        public SysDicUpdatedEvent(RouteToPathId routeToPathId, ISysDic source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除系统字典后")]
     public class SysDicRemovedEvent : DomainEvent<ISysDic> {
-        public SysDicRemovedEvent(Guid routeToPathId, ISysDic source) : base(routeToPathId, source) {
+        public SysDicRemovedEvent(RouteToPathId routeToPathId, ISysDic source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -491,19 +491,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了系统字典项后")]
     public class SysDicItemAddedEvent : DomainEvent<ISysDicItem> {
-        public SysDicItemAddedEvent(Guid routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
+        public SysDicItemAddedEvent(RouteToPathId routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了系统字典项后")]
     public class SysDicItemUpdatedEvent : DomainEvent<ISysDicItem> {
-        public SysDicItemUpdatedEvent(Guid routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
+        public SysDicItemUpdatedEvent(RouteToPathId routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除了系统字典项后")]
     public class SysDicItemRemovedEvent : DomainEvent<ISysDicItem> {
-        public SysDicItemRemovedEvent(Guid routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
+        public SysDicItemRemovedEvent(RouteToPathId routeToPathId, ISysDicItem source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -529,25 +529,25 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了币种后")]
     public class CoinAddedEvent : DomainEvent<ICoin> {
-        public CoinAddedEvent(Guid routeToPathId, ICoin source) : base(routeToPathId, source) {
+        public CoinAddedEvent(RouteToPathId routeToPathId, ICoin source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了币种后")]
     public class CoinUpdatedEvent : DomainEvent<ICoin> {
-        public CoinUpdatedEvent(Guid routeToPathId, ICoin source) : base(routeToPathId, source) {
+        public CoinUpdatedEvent(RouteToPathId routeToPathId, ICoin source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了币种后")]
     public class CoinRemovedEvent : DomainEvent<ICoin> {
-        public CoinRemovedEvent(Guid routeToPathId, ICoin source) : base(routeToPathId, source) {
+        public CoinRemovedEvent(RouteToPathId routeToPathId, ICoin source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "下载了币种图标后")]
     public class CoinIconDownloadedEvent : DomainEvent<ICoin> {
-        public CoinIconDownloadedEvent(Guid routeToPathId, ICoin source) : base(routeToPathId, source) {
+        public CoinIconDownloadedEvent(RouteToPathId routeToPathId, ICoin source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -573,19 +573,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了组后")]
     public class GroupAddedEvent : DomainEvent<IGroup> {
-        public GroupAddedEvent(Guid routeToPathId, IGroup source) : base(routeToPathId, source) {
+        public GroupAddedEvent(RouteToPathId routeToPathId, IGroup source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了组后")]
     public class GroupUpdatedEvent : DomainEvent<IGroup> {
-        public GroupUpdatedEvent(Guid routeToPathId, IGroup source) : base(routeToPathId, source) {
+        public GroupUpdatedEvent(RouteToPathId routeToPathId, IGroup source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了组后")]
     public class GroupRemovedEvent : DomainEvent<IGroup> {
-        public GroupRemovedEvent(Guid routeToPathId, IGroup source) : base(routeToPathId, source) {
+        public GroupRemovedEvent(RouteToPathId routeToPathId, IGroup source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -611,13 +611,13 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了币组后")]
     public class CoinGroupAddedEvent : DomainEvent<ICoinGroup> {
-        public CoinGroupAddedEvent(Guid routeToPathId, ICoinGroup source) : base(routeToPathId, source) {
+        public CoinGroupAddedEvent(RouteToPathId routeToPathId, ICoinGroup source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了币组后")]
     public class CoinGroupRemovedEvent : DomainEvent<ICoinGroup> {
-        public CoinGroupRemovedEvent(Guid routeToPathId, ICoinGroup source) : base(routeToPathId, source) {
+        public CoinGroupRemovedEvent(RouteToPathId routeToPathId, ICoinGroup source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -643,19 +643,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了文件书写器后")]
     public class FileWriterAddedEvent : DomainEvent<IFileWriter> {
-        public FileWriterAddedEvent(Guid routeToPathId, IFileWriter source) : base(routeToPathId, source) {
+        public FileWriterAddedEvent(RouteToPathId routeToPathId, IFileWriter source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了文件书写器后")]
     public class FileWriterUpdatedEvent : DomainEvent<IFileWriter> {
-        public FileWriterUpdatedEvent(Guid routeToPathId, IFileWriter source) : base(routeToPathId, source) {
+        public FileWriterUpdatedEvent(RouteToPathId routeToPathId, IFileWriter source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了文件书写器后")]
     public class FileWriterRemovedEvent : DomainEvent<IFileWriter> {
-        public FileWriterRemovedEvent(Guid routeToPathId, IFileWriter source) : base(routeToPathId, source) {
+        public FileWriterRemovedEvent(RouteToPathId routeToPathId, IFileWriter source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -681,19 +681,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了命令行片段书写器后")]
     public class FragmentWriterAddedEvent : DomainEvent<IFragmentWriter> {
-        public FragmentWriterAddedEvent(Guid routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
+        public FragmentWriterAddedEvent(RouteToPathId routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了命令行片段书写器后")]
     public class FragmentWriterUpdatedEvent : DomainEvent<IFragmentWriter> {
-        public FragmentWriterUpdatedEvent(Guid routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
+        public FragmentWriterUpdatedEvent(RouteToPathId routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了命令行片段书写器后")]
     public class FragmentWriterRemovedEvent : DomainEvent<IFragmentWriter> {
-        public FragmentWriterRemovedEvent(Guid routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
+        public FragmentWriterRemovedEvent(RouteToPathId routeToPathId, IFragmentWriter source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -719,19 +719,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了钱包后")]
     public class WalletAddedEvent : DomainEvent<IWallet> {
-        public WalletAddedEvent(Guid routeToPathId, IWallet source) : base(routeToPathId, source) {
+        public WalletAddedEvent(RouteToPathId routeToPathId, IWallet source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了钱包后")]
     public class WalletUpdatedEvent : DomainEvent<IWallet> {
-        public WalletUpdatedEvent(Guid routeToPathId, IWallet source) : base(routeToPathId, source) {
+        public WalletUpdatedEvent(RouteToPathId routeToPathId, IWallet source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了钱包后")]
     public class WalletRemovedEvent : DomainEvent<IWallet> {
-        public WalletRemovedEvent(Guid routeToPathId, IWallet source) : base(routeToPathId, source) {
+        public WalletRemovedEvent(RouteToPathId routeToPathId, IWallet source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -757,19 +757,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了矿池后")]
     public class PoolAddedEvent : DomainEvent<IPool> {
-        public PoolAddedEvent(Guid routeToPathId, IPool source) : base(routeToPathId, source) {
+        public PoolAddedEvent(RouteToPathId routeToPathId, IPool source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了矿池后")]
     public class PoolUpdatedEvent : DomainEvent<IPool> {
-        public PoolUpdatedEvent(Guid routeToPathId, IPool source) : base(routeToPathId, source) {
+        public PoolUpdatedEvent(RouteToPathId routeToPathId, IPool source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了矿池后")]
     public class PoolRemovedEvent : DomainEvent<IPool> {
-        public PoolRemovedEvent(Guid routeToPathId, IPool source) : base(routeToPathId, source) {
+        public PoolRemovedEvent(RouteToPathId routeToPathId, IPool source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -795,19 +795,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了币种级内核后")]
     public class CoinKernelAddedEvent : DomainEvent<ICoinKernel> {
-        public CoinKernelAddedEvent(Guid routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
+        public CoinKernelAddedEvent(RouteToPathId routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了币种级内核后")]
     public class CoinKernelUpdatedEvent : DomainEvent<ICoinKernel> {
-        public CoinKernelUpdatedEvent(Guid routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
+        public CoinKernelUpdatedEvent(RouteToPathId routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了币种级内核后")]
     public class CoinKernelRemovedEvent : DomainEvent<ICoinKernel> {
-        public CoinKernelRemovedEvent(Guid routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
+        public CoinKernelRemovedEvent(RouteToPathId routeToPathId, ICoinKernel source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -833,19 +833,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了矿池级内核后")]
     public class PoolKernelAddedEvent : DomainEvent<IPoolKernel> {
-        public PoolKernelAddedEvent(Guid routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
+        public PoolKernelAddedEvent(RouteToPathId routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了矿池级内核后")]
     public class PoolKernelUpdatedEvent : DomainEvent<IPoolKernel> {
-        public PoolKernelUpdatedEvent(Guid routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
+        public PoolKernelUpdatedEvent(RouteToPathId routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了矿池级内核后")]
     public class PoolKernelRemovedEvent : DomainEvent<IPoolKernel> {
-        public PoolKernelRemovedEvent(Guid routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
+        public PoolKernelRemovedEvent(RouteToPathId routeToPathId, IPoolKernel source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -871,19 +871,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了包后")]
     public class PackageAddedEvent : DomainEvent<IPackage> {
-        public PackageAddedEvent(Guid routeToPathId, IPackage source) : base(routeToPathId, source) {
+        public PackageAddedEvent(RouteToPathId routeToPathId, IPackage source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了包后")]
     public class PackageUpdatedEvent : DomainEvent<IPackage> {
-        public PackageUpdatedEvent(Guid routeToPathId, IPackage source) : base(routeToPathId, source) {
+        public PackageUpdatedEvent(RouteToPathId routeToPathId, IPackage source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除了包后")]
     public class PackageRemovedEvent : DomainEvent<IPackage> {
-        public PackageRemovedEvent(Guid routeToPathId, IPackage source) : base(routeToPathId, source) {
+        public PackageRemovedEvent(RouteToPathId routeToPathId, IPackage source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -909,19 +909,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核后")]
     public class KernelAddedEvent : DomainEvent<IKernel> {
-        public KernelAddedEvent(Guid routeToPathId, IKernel source) : base(routeToPathId, source) {
+        public KernelAddedEvent(RouteToPathId routeToPathId, IKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核后")]
     public class KernelUpdatedEvent : DomainEvent<IKernel> {
-        public KernelUpdatedEvent(Guid routeToPathId, IKernel source) : base(routeToPathId, source) {
+        public KernelUpdatedEvent(RouteToPathId routeToPathId, IKernel source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "删除了内核后")]
     public class KernelRemovedEvent : DomainEvent<IKernel> {
-        public KernelRemovedEvent(Guid routeToPathId, IKernel source) : base(routeToPathId, source) {
+        public KernelRemovedEvent(RouteToPathId routeToPathId, IKernel source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -947,19 +947,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核输入组后")]
     public class KernelInputAddedEvent : DomainEvent<IKernelInput> {
-        public KernelInputAddedEvent(Guid routeToPathId, IKernelInput source) : base(routeToPathId, source) {
+        public KernelInputAddedEvent(RouteToPathId routeToPathId, IKernelInput source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核输入组后")]
     public class KernelInputUpdatedEvent : DomainEvent<IKernelInput> {
-        public KernelInputUpdatedEvent(Guid routeToPathId, IKernelInput source) : base(routeToPathId, source) {
+        public KernelInputUpdatedEvent(RouteToPathId routeToPathId, IKernelInput source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了内核输入组后")]
     public class KernelInputRemovedEvent : DomainEvent<IKernelInput> {
-        public KernelInputRemovedEvent(Guid routeToPathId, IKernelInput source) : base(routeToPathId, source) {
+        public KernelInputRemovedEvent(RouteToPathId routeToPathId, IKernelInput source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -985,19 +985,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核输出组后")]
     public class KernelOutputAddedEvent : DomainEvent<IKernelOutput> {
-        public KernelOutputAddedEvent(Guid routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
+        public KernelOutputAddedEvent(RouteToPathId routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核输出组后")]
     public class KernelOutputUpdatedEvent : DomainEvent<IKernelOutput> {
-        public KernelOutputUpdatedEvent(Guid routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
+        public KernelOutputUpdatedEvent(RouteToPathId routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了内核输出组后")]
     public class KernelOutputRemovedEvent : DomainEvent<IKernelOutput> {
-        public KernelOutputRemovedEvent(Guid routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
+        public KernelOutputRemovedEvent(RouteToPathId routeToPathId, IKernelOutput source) : base(routeToPathId, source) {
         }
     }
     #endregion
@@ -1023,19 +1023,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核输出翻译器后")]
     public class KernelOutputTranslaterAddedEvent : DomainEvent<IKernelOutputTranslater> {
-        public KernelOutputTranslaterAddedEvent(Guid routeToPathId, IKernelOutputTranslater source) : base(routeToPathId, source) {
+        public KernelOutputTranslaterAddedEvent(RouteToPathId routeToPathId, IKernelOutputTranslater source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核输出翻译器后")]
     public class KernelOutputTranslaterUpdatedEvent : DomainEvent<IKernelOutputTranslater> {
-        public KernelOutputTranslaterUpdatedEvent(Guid routeToPathId, IKernelOutputTranslater source) : base(routeToPathId, source) {
+        public KernelOutputTranslaterUpdatedEvent(RouteToPathId routeToPathId, IKernelOutputTranslater source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了内核输出翻译器后")]
     public class KernelOutputTranslaterRemovedEvent : DomainEvent<IKernelOutputTranslater> {
-        public KernelOutputTranslaterRemovedEvent(Guid routeToPathId, IKernelOutputTranslater source) : base(routeToPathId, source) {
+        public KernelOutputTranslaterRemovedEvent(RouteToPathId 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(Guid routeToPathId, TEntity source) {
+        protected DomainEvent(RouteToPathId 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 Guid RouteToPathId { get; private set; }
+        public RouteToPathId 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 = Guid.Empty;
+            this.RouteToPathId = RouteToPathId.All;
         }
 
-        protected EventBase(Guid routeToPathId) : this() {
+        protected EventBase(RouteToPathId routeToPathId) : this() {
             this.RouteToPathId = routeToPathId;
         }
 
         public Guid Id { get; private set; }
 
-        public Guid RouteToPathId { get; private set; }
+        public RouteToPathId 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 {
-        Guid RouteToPathId { get; }
+        RouteToPathId RouteToPathId { get; }
         DateTime BornOn { get; }
     }
 }

+ 6 - 8
src/NTMinerHub/Hub/MessageHub.cs

@@ -114,14 +114,12 @@
                 foreach (var messagePath in messagePaths) {
                     // isMatch表示该处路径是否可以通过该消息,因为有些路径的PathId属性不为Guid.Empty,非空PathId的路径只允许特定标识造型的消息通过
                     // PathId可以认为是路径的形状,唯一的PathId表明该路径具有唯一的形状从而只允许和路径的形状一样的消息结构体穿过
-                    bool isMatch = messagePath.PathId == Guid.Empty;
-                    if (!isMatch) {
-                        if (message is IEvent evt) {
-                            isMatch = messagePath.PathId == evt.RouteToPathId;
-                        }
-                        else if (message is ICmd cmd) {
-                            isMatch = messagePath.PathId == cmd.Id;
-                        }
+                    bool isMatch = false;
+                    if (message is IEvent evt) {
+                        isMatch = evt.RouteToPathId.IsAll || evt.RouteToPathId == messagePath.PathId;
+                    }
+                    else if (message is ICmd cmd) {
+                        isMatch = messagePath.PathId == Guid.Empty || messagePath.PathId == cmd.Id;
                     }
                     if (isMatch && messagePath.ViaTimesLimit > 0) {
                         // ViaTimesLimite小于0表示是不限定通过的次数的路径,不限定通过的次数的路径不需要消息每通过一次递减一次ViaTimesLimit计数

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

@@ -0,0 +1,59 @@
+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 - 0
src/NTMinerHub/NTMinerHub.csproj

@@ -46,6 +46,7 @@
     <Compile Include="Hub\IMessageHub.cs" />
     <Compile Include="Hub\MessageHub.cs" />
     <Compile Include="Hub\MessageTypeAttribute.cs" />
+    <Compile Include="Hub\RouteToPathId.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(Guid routeToPathId, IAppSetting source) : base(routeToPathId, source) {
+        public ServerAppSettingSetedEvent(RouteToPathId routeToPathId, IAppSetting source) : base(routeToPathId, source) {
         }
     }
 
@@ -98,7 +98,7 @@ namespace NTMiner {
 
     [MessageType(description: "LocalAppSetting变更后")]
     public class LocalAppSettingChangedEvent : DomainEvent<IAppSetting> {
-        public LocalAppSettingChangedEvent(Guid routeToPathId, IAppSetting source) : base(routeToPathId, source) {
+        public LocalAppSettingChangedEvent(RouteToPathId routeToPathId, IAppSetting source) : base(routeToPathId, source) {
         }
     }
 
@@ -131,13 +131,13 @@ namespace NTMiner {
 
     [MessageType(description: "添加了用户自定义内核输出关键字后")]
     public class UserKernelOutputKeywordAddedEvent : DomainEvent<IKernelOutputKeyword> {
-        public UserKernelOutputKeywordAddedEvent(Guid routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
+        public UserKernelOutputKeywordAddedEvent(RouteToPathId routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "更新了用户自定义内核输出关键字后")]
     public class UserKernelOutputKeywordUpdatedEvent : DomainEvent<IKernelOutputKeyword> {
-        public UserKernelOutputKeywordUpdatedEvent(Guid routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
+        public UserKernelOutputKeywordUpdatedEvent(RouteToPathId routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
         }
     }
 
@@ -149,7 +149,7 @@ namespace NTMiner {
 
     [MessageType(description: "移除了用户自定义内核输出关键字后")]
     public class UserKernelOutputKeywordRemovedEvent : DomainEvent<IKernelOutputKeyword> {
-        public UserKernelOutputKeywordRemovedEvent(Guid routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
+        public UserKernelOutputKeywordRemovedEvent(RouteToPathId routeToPathId, IKernelOutputKeyword source) : base(routeToPathId, source) {
 
         }
     }
@@ -163,7 +163,7 @@ namespace NTMiner {
 
     [MessageType(description: "记录了本地事件后")]
     public class LocalMessageAddedEvent : DomainEvent<ILocalMessage> {
-        public LocalMessageAddedEvent(Guid routeToPathId, ILocalMessage source, List<ILocalMessage> removes) : base(routeToPathId, source) {
+        public LocalMessageAddedEvent(RouteToPathId 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(Guid routeToPathId, IUser source) : base(routeToPathId, source) {
+        public UserAddedEvent(RouteToPathId routeToPathId, IUser source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "修改了用户后")]
     public class UserUpdatedEvent : DomainEvent<IUser> {
-        public UserUpdatedEvent(Guid routeToPathId, IUser source) : base(routeToPathId, source) {
+        public UserUpdatedEvent(RouteToPathId routeToPathId, IUser source) : base(routeToPathId, source) {
         }
     }
 
     [MessageType(description: "移除了用户后")]
     public class UserRemovedEvent : DomainEvent<IUser> {
-        public UserRemovedEvent(Guid routeToPathId, IUser source) : base(routeToPathId, source) {
+        public UserRemovedEvent(RouteToPathId routeToPathId, IUser source) : base(routeToPathId, source) {
         }
     }
 }