ntminer 6 years ago
parent
commit
0ae085538b
46 changed files with 91 additions and 95 deletions
  1. 1 1
      NTMiner.sln
  2. 1 1
      src/AppModels/AppContext.cs
  3. 2 2
      src/AppModels/AppModels.csproj
  4. 1 1
      src/AppModels/Messages.cs
  5. 2 2
      src/AppModels/Vms/MessagePathIdsViewModel.cs
  6. 1 1
      src/AppModels/Vms/StartStopMineButtonViewModel.cs
  7. 2 2
      src/AppViews0/AppViews0.csproj
  8. 5 5
      src/AppViews0/Ucs/MessagePathIds.xaml.cs
  9. 2 2
      src/CalcConfigUpdater/CalcConfigUpdater.csproj
  10. 2 2
      src/MinerClient/MinerClient.csproj
  11. 2 2
      src/MinerClientSelfHost/MinerClientSelfHost.csproj
  12. 2 2
      src/MinerStudio/MinerStudio.csproj
  13. 2 2
      src/MinerStudioSelfHost/MinerStudioSelfHost.csproj
  14. 1 1
      src/NTMinerClient/Core/Impl/ServerContext.cs
  15. 1 1
      src/NTMinerClient/Core/Messages.cs
  16. 1 1
      src/NTMinerClient/IServerContext.cs
  17. 1 1
      src/NTMinerClient/Messages.cs
  18. 2 2
      src/NTMinerClient/NTMinerClient.csproj
  19. 1 1
      src/NTMinerClient/NTMinerRoot.partials.MinerProcess.cs
  20. 2 2
      src/NTMinerDaemon/NTMinerDaemon.csproj
  21. 2 6
      src/NTMinerDaemon/VirtualRoot.cs
  22. 1 1
      src/NTMinerRouter/Hub/Cmd.cs
  23. 1 1
      src/NTMinerRouter/Hub/DomainEvent`1.cs
  24. 1 1
      src/NTMinerRouter/Hub/EventBase.cs
  25. 1 1
      src/NTMinerRouter/Hub/ICmd.cs
  26. 1 1
      src/NTMinerRouter/Hub/IEvent.cs
  27. 1 1
      src/NTMinerRouter/Hub/IMessage.cs
  28. 2 2
      src/NTMinerRouter/Hub/IMessageHub.cs
  29. 1 1
      src/NTMinerRouter/Hub/IMessagePathId.cs
  30. 2 2
      src/NTMinerRouter/Hub/MessageHub.cs
  31. 2 2
      src/NTMinerRouter/Hub/MessagePath`1.cs
  32. 1 1
      src/NTMinerRouter/Hub/MessageTypeAttribute.cs
  33. 12 12
      src/NTMinerRouter/NTMinerHub.csproj
  34. 2 2
      src/NTMinerRouter/Properties/AssemblyInfo.cs
  35. 2 2
      src/NTMinerRpcClient/NTMinerRpcClient.csproj
  36. 2 2
      src/NTMinerServices/NTMinerServices.csproj
  37. 2 2
      src/NTMinerUpdater/NTMinerUpdater.csproj
  38. 2 2
      src/NTMinerWpf/NTMinerWpf.csproj
  39. 1 1
      src/NTMinerWpf/WindowExtension.cs
  40. 1 1
      src/NTMinerlib/Messages.Timing.cs
  41. 1 1
      src/NTMinerlib/Messages.cs
  42. 2 2
      src/NTMinerlib/NTMinerlib.csproj
  43. 1 1
      src/NTMinerlib/User/Messages.cs
  44. 4 4
      src/NTMinerlib/VirtualRoot.cs
  45. 7 7
      src/NTMinerlib/VirtualRoot.partials.Bus.cs
  46. 2 2
      src/UnitTests/UnitTests.csproj

+ 1 - 1
NTMiner.sln

@@ -94,7 +94,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebSocketServerTests", "src
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebSocketClientTests", "src\WebSocketClientTests\WebSocketClientTests.csproj", "{188484AC-C870-4F34-BE4C-9A0AF96DE2EA}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NTMinerRouter", "src\NTMinerRouter\NTMinerRouter.csproj", "{E17F278A-E393-403E-9D37-E371036D7A02}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NTMinerHub", "src\NTMinerRouter\NTMinerHub.csproj", "{E17F278A-E393-403E-9D37-E371036D7A02}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

+ 1 - 1
src/AppModels/AppContext.cs

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using NTMiner.Vms;
 using System;
 using System.Collections.Generic;

+ 2 - 2
src/AppModels/AppModels.csproj

@@ -221,9 +221,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
     <ProjectReference Include="..\NTMinerRpcClient\NTMinerRpcClient.csproj">
       <Project>{c7108d8f-eb73-4ae3-916f-be817ede37af}</Project>

+ 1 - 1
src/AppModels/Messages.cs

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using NTMiner.Core;
 using NTMiner.Vms;
 using System;

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

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using System.Collections.ObjectModel;
 
 namespace NTMiner.Vms {
@@ -6,7 +6,7 @@ namespace NTMiner.Vms {
         private readonly ObservableCollection<IMessagePathId> _pathIds;
 
         public MessagePathIdsViewModel() {
-            _pathIds = new ObservableCollection<IMessagePathId>(VirtualRoot.MessageDispatcher.GetAllPaths());
+            _pathIds = new ObservableCollection<IMessagePathId>(VirtualRoot.MessageHub.GetAllPaths());
         }
 
         public ObservableCollection<IMessagePathId> PathIds {

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

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using System.Windows.Input;
 
 namespace NTMiner.Vms {

+ 2 - 2
src/AppViews0/AppViews0.csproj

@@ -966,9 +966,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
     <ProjectReference Include="..\NTMinerRpcClient\NTMinerRpcClient.csproj">
       <Project>{c7108d8f-eb73-4ae3-916f-be817ede37af}</Project>

+ 5 - 5
src/AppViews0/Ucs/MessagePathIds.xaml.cs

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using NTMiner.Vms;
 using System.Windows;
 using System.Windows.Controls;
@@ -27,11 +27,11 @@ namespace NTMiner.Views.Ucs {
         public MessagePathIds() {
             InitializeComponent();
             this.RunOneceOnLoaded(onLoad: window => {
-                VirtualRoot.MessageDispatcher.Added += OnPathConnected;
-                VirtualRoot.MessageDispatcher.Removed += OnPathDisconnected;
+                VirtualRoot.MessageHub.Added += OnPathConnected;
+                VirtualRoot.MessageHub.Removed += OnPathDisconnected;
             }, onUnload: window => {
-                VirtualRoot.MessageDispatcher.Added -= OnPathConnected;
-                VirtualRoot.MessageDispatcher.Removed -= OnPathDisconnected;
+                VirtualRoot.MessageHub.Added -= OnPathConnected;
+                VirtualRoot.MessageHub.Removed -= OnPathDisconnected;
             });
         }
 

+ 2 - 2
src/CalcConfigUpdater/CalcConfigUpdater.csproj

@@ -68,9 +68,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
     <ProjectReference Include="..\NTMinerRpcClient\NTMinerRpcClient.csproj">
       <Project>{c7108d8f-eb73-4ae3-916f-be817ede37af}</Project>

+ 2 - 2
src/MinerClient/MinerClient.csproj

@@ -171,9 +171,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
     <ProjectReference Include="..\NTMinerRpcClient\NTMinerRpcClient.csproj">
       <Project>{c7108d8f-eb73-4ae3-916f-be817ede37af}</Project>

+ 2 - 2
src/MinerClientSelfHost/MinerClientSelfHost.csproj

@@ -77,9 +77,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>

+ 2 - 2
src/MinerStudio/MinerStudio.csproj

@@ -167,9 +167,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
     <ProjectReference Include="..\NTMinerRpcClient\NTMinerRpcClient.csproj">
       <Project>{c7108d8f-eb73-4ae3-916f-be817ede37af}</Project>

+ 2 - 2
src/MinerStudioSelfHost/MinerStudioSelfHost.csproj

@@ -79,9 +79,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>

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

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using NTMiner.Core.Kernels;
 using NTMiner.Core.Kernels.Impl;
 using System;

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

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using NTMiner.Core.Gpus;
 using NTMiner.MinerServer;
 using NTMiner.Profile;

+ 1 - 1
src/NTMinerClient/IServerContext.cs

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using NTMiner.Core;
 using NTMiner.Core.Kernels;
 using System;

+ 1 - 1
src/NTMinerClient/Messages.cs

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using NTMiner.Core;
 using System;
 

+ 2 - 2
src/NTMinerClient/NTMinerClient.csproj

@@ -249,9 +249,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
     <ProjectReference Include="..\NTMinerRpcClient\NTMinerRpcClient.csproj">
       <Project>{c7108d8f-eb73-4ae3-916f-be817ede37af}</Project>

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

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using NTMiner.Core;
 using NTMiner.Core.Kernels;
 using NTMiner.MinerClient;

+ 2 - 2
src/NTMinerDaemon/NTMinerDaemon.csproj

@@ -171,9 +171,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>

+ 2 - 6
src/NTMinerDaemon/VirtualRoot.cs

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using System.Diagnostics;
 
 namespace NTMiner {
@@ -6,10 +6,6 @@ namespace NTMiner {
         public static readonly string AppFileFullName = Process.GetCurrentProcess().MainModule.FileName;
         public static bool IsMinerStudio = false;
 
-        public static readonly IMessagePathSet MessageDispatcher;
-
-        static VirtualRoot() {
-            MessageDispatcher = new MessagePathSet();
-        }
+        public static readonly IMessageHub MessageHub = new MessageHub();
     }
 }

+ 1 - 1
src/NTMinerRouter/Router/Cmd.cs → src/NTMinerRouter/Hub/Cmd.cs

@@ -1,5 +1,5 @@
 
-namespace NTMiner.Router {
+namespace NTMiner.Hub {
     using System;
 
     public abstract class Cmd : ICmd {

+ 1 - 1
src/NTMinerRouter/Router/DomainEvent`1.cs → src/NTMinerRouter/Hub/DomainEvent`1.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace NTMiner.Router {
+namespace NTMiner.Hub {
     public abstract class DomainEvent<TEntity> : IEvent {
         protected DomainEvent(Guid bornPathId, TEntity source) {
             this.Id = Guid.NewGuid();

+ 1 - 1
src/NTMinerRouter/Router/EventBase.cs → src/NTMinerRouter/Hub/EventBase.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace NTMiner.Router {
+namespace NTMiner.Hub {
     public abstract class EventBase : IEvent {
         protected EventBase() {
             this.Id = Guid.NewGuid();

+ 1 - 1
src/NTMinerRouter/Router/ICmd.cs → src/NTMinerRouter/Hub/ICmd.cs

@@ -1,4 +1,4 @@
-namespace NTMiner.Router {
+namespace NTMiner.Hub {
 
     // 一种命令只应被一个处理器处理,命令实际上可以设计为不走总线,
     // 之所以设计为统一走总线只是为了通过将命令类型集中表达以起文档作用。

+ 1 - 1
src/NTMinerRouter/Router/IEvent.cs → src/NTMinerRouter/Hub/IEvent.cs

@@ -1,4 +1,4 @@
-namespace NTMiner.Router {
+namespace NTMiner.Hub {
     using System;
 
     public interface IEvent : IMessage {

+ 1 - 1
src/NTMinerRouter/Router/IMessage.cs → src/NTMinerRouter/Hub/IMessage.cs

@@ -1,7 +1,7 @@
 
 using System;
 
-namespace NTMiner.Router {
+namespace NTMiner.Hub {
     public interface IMessage {
         Guid Id { get; }
     }

+ 2 - 2
src/NTMinerRouter/Router/IMessagePathSet.cs → src/NTMinerRouter/Hub/IMessageHub.cs

@@ -1,8 +1,8 @@
 using System;
 using System.Collections.Generic;
 
-namespace NTMiner.Router {
-    public interface IMessagePathSet {
+namespace NTMiner.Hub {
+    public interface IMessageHub {
         IEnumerable<IMessagePathId> GetAllPaths();
         void Route<TMessage>(TMessage message) where TMessage : IMessage;
 

+ 1 - 1
src/NTMinerRouter/Router/IMessagePathId.cs → src/NTMinerRouter/Hub/IMessagePathId.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace NTMiner.Router {
+namespace NTMiner.Hub {
     
     public interface IMessagePathId {
         Guid PathId { get; }

+ 2 - 2
src/NTMinerRouter/Router/MessagePathSet.cs → src/NTMinerRouter/Hub/MessageHub.cs

@@ -1,8 +1,8 @@
-namespace NTMiner.Router {
+namespace NTMiner.Hub {
     using System;
     using System.Collections.Generic;
 
-    public class MessagePathSet : IMessagePathSet {
+    public class MessageHub : IMessageHub {
         private readonly Dictionary<Type, List<object>> _pathDicByMessageType = new Dictionary<Type, List<object>>();
         private readonly Dictionary<string, List<IMessagePathId>> _paths = new Dictionary<string, List<IMessagePathId>>();
         private readonly object _locker = new object();

+ 2 - 2
src/NTMinerRouter/Router/MessagePath`1.cs → src/NTMinerRouter/Hub/MessagePath`1.cs

@@ -1,7 +1,7 @@
 using System;
 using System.ComponentModel;
 
-namespace NTMiner.Router {
+namespace NTMiner.Hub {
     public class MessagePath<TMessage> : IMessagePathId
 #if DEBUG
         , INotifyPropertyChanged
@@ -17,7 +17,7 @@ namespace NTMiner.Router {
         public event PropertyChangedEventHandler PropertyChanged;
 #endif
 
-        public static MessagePath<TMessage> Build(IMessagePathSet dispatcher, Type location, string description, LogEnum logType, Action<TMessage> path, Guid pathId, int viaLimit = -1) {
+        public static MessagePath<TMessage> Build(IMessageHub dispatcher, Type location, string description, LogEnum logType, Action<TMessage> path, Guid pathId, int viaLimit = -1) {
             if (path == null) {
                 throw new ArgumentNullException(nameof(path));
             }

+ 1 - 1
src/NTMinerRouter/Router/MessageTypeAttribute.cs → src/NTMinerRouter/Hub/MessageTypeAttribute.cs

@@ -2,7 +2,7 @@
 using System.Collections.Generic;
 using System.Linq;
 
-namespace NTMiner.Router {
+namespace NTMiner.Hub {
     [AttributeUsage(AttributeTargets.Class)]
     public class MessageTypeAttribute : Attribute {
         private static readonly Dictionary<Type, MessageTypeAttribute> _messageTypeAttributeDic = new Dictionary<Type, MessageTypeAttribute>();

+ 12 - 12
src/NTMinerRouter/NTMinerRouter.csproj → src/NTMinerRouter/NTMinerHub.csproj

@@ -8,7 +8,7 @@
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>NTMiner</RootNamespace>
-    <AssemblyName>NTMinerRouter</AssemblyName>
+    <AssemblyName>NTMinerHub</AssemblyName>
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <Deterministic>false</Deterministic>
@@ -34,17 +34,17 @@
     <Reference Include="System" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Router\Cmd.cs" />
-    <Compile Include="Router\MessagePath`1.cs" />
-    <Compile Include="Router\DomainEvent`1.cs" />
-    <Compile Include="Router\EventBase.cs" />
-    <Compile Include="Router\ICmd.cs" />
-    <Compile Include="Router\IEvent.cs" />
-    <Compile Include="Router\IMessagePathId.cs" />
-    <Compile Include="Router\IMessage.cs" />
-    <Compile Include="Router\IMessagePathSet.cs" />
-    <Compile Include="Router\MessagePathSet.cs" />
-    <Compile Include="Router\MessageTypeAttribute.cs" />
+    <Compile Include="Hub\Cmd.cs" />
+    <Compile Include="Hub\MessagePath`1.cs" />
+    <Compile Include="Hub\DomainEvent`1.cs" />
+    <Compile Include="Hub\EventBase.cs" />
+    <Compile Include="Hub\ICmd.cs" />
+    <Compile Include="Hub\IEvent.cs" />
+    <Compile Include="Hub\IMessagePathId.cs" />
+    <Compile Include="Hub\IMessage.cs" />
+    <Compile Include="Hub\IMessageHub.cs" />
+    <Compile Include="Hub\MessageHub.cs" />
+    <Compile Include="Hub\MessageTypeAttribute.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   <ItemGroup>

+ 2 - 2
src/NTMinerRouter/Properties/AssemblyInfo.cs

@@ -4,11 +4,11 @@ using System.Runtime.InteropServices;
 // 有关程序集的一般信息由以下
 // 控制。更改这些特性值可修改
 // 与程序集关联的信息。
-[assembly: AssemblyTitle("NTMinerRouter")]
+[assembly: AssemblyTitle("NTMinerHub")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("NTMinerRouter")]
+[assembly: AssemblyProduct("NTMinerHub")]
 [assembly: AssemblyCopyright(NTMiner.MainAssemblyInfo.Copyright)]
 [assembly: AssemblyTrademark("")]
 [assembly: AssemblyCulture("")]

+ 2 - 2
src/NTMinerRpcClient/NTMinerRpcClient.csproj

@@ -101,9 +101,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>

+ 2 - 2
src/NTMinerServices/NTMinerServices.csproj

@@ -158,9 +158,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
     <ProjectReference Include="..\NTMinerRpcClient\NTMinerRpcClient.csproj">
       <Project>{c7108d8f-eb73-4ae3-916f-be817ede37af}</Project>

+ 2 - 2
src/NTMinerUpdater/NTMinerUpdater.csproj

@@ -153,9 +153,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
     <ProjectReference Include="..\NTMinerRpcClient\NTMinerRpcClient.csproj">
       <Project>{c7108d8f-eb73-4ae3-916f-be817ede37af}</Project>

+ 2 - 2
src/NTMinerWpf/NTMinerWpf.csproj

@@ -247,9 +247,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
     <ProjectReference Include="..\NTMinerRpcClient\NTMinerRpcClient.csproj">
       <Project>{c7108d8f-eb73-4ae3-916f-be817ede37af}</Project>

+ 1 - 1
src/NTMinerWpf/WindowExtension.cs

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using NTMiner.Views;
 using System;
 using System.Collections.Generic;

+ 1 - 1
src/NTMinerlib/Messages.Timing.cs

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 
 namespace NTMiner {
 

+ 1 - 1
src/NTMinerlib/Messages.cs

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using NTMiner.Core;
 using NTMiner.MinerClient;
 using NTMiner.MinerServer;

+ 2 - 2
src/NTMinerlib/NTMinerlib.csproj

@@ -97,9 +97,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
   </ItemGroup>
   <ItemGroup />

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

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using System;
 
 namespace NTMiner.User {

+ 4 - 4
src/NTMinerlib/VirtualRoot.cs

@@ -1,5 +1,5 @@
 using NTMiner.AppSetting;
-using NTMiner.Router;
+using NTMiner.Hub;
 using NTMiner.Core;
 using NTMiner.LocalMessage;
 using NTMiner.MinerClient;
@@ -114,9 +114,9 @@ namespace NTMiner {
         public static IObjectSerializer JsonSerializer { get; private set; }
 
         // 视图层有个界面提供给开发者观察系统的消息路径情况所以是public的。
-        // 系统根上的一些状态集的构造时最好都放在MessageDispatcher初始化之后,因为状态集的构造
-        // 函数中可能会建造消息路径,所以这里保证在访问MessageDispatcher之前一定完成了构造。
-        public static readonly IMessagePathSet MessageDispatcher = new MessagePathSet();
+        // 系统根上的一些状态集的构造时最好都放在MessageHub初始化之后,因为状态集的构造
+        // 函数中可能会建造消息路径,所以这里保证在访问MessageHub之前一定完成了构造。
+        public static readonly IMessageHub MessageHub = new MessageHub();
         public static readonly ILocalMessageSet LocalMessages;
 
         #region Out

+ 7 - 7
src/NTMinerlib/VirtualRoot.partials.Bus.cs

@@ -1,4 +1,4 @@
-using NTMiner.Router;
+using NTMiner.Hub;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
@@ -8,11 +8,11 @@ using System.Timers;
 namespace NTMiner {
     public static partial class VirtualRoot {
         public static void RaiseEvent<TEvent>(TEvent evnt) where TEvent : class, IEvent {
-            MessageDispatcher.Route(evnt);
+            MessageHub.Route(evnt);
         }
 
         public static void Execute<TCmd>(TCmd command) where TCmd : class, ICmd {
-            MessageDispatcher.Route(command);
+            MessageHub.Route(command);
         }
 
         // 修建消息(命令或事件)的运动路径
@@ -20,21 +20,21 @@ namespace NTMiner {
             StackTrace ss = new StackTrace(false);
             // 0是CreatePath,1是CreateCmdPath或CreateEventPath,2是当地
             Type location = ss.GetFrame(2).GetMethod().DeclaringType;
-            return MessagePath<TMessage>.Build(MessageDispatcher, location, description, logType, action, Guid.Empty);
+            return MessagePath<TMessage>.Build(MessageHub, location, description, logType, action, Guid.Empty);
         }
 
         public static IMessagePathId BuildOnecePath<TMessage>(string description, LogEnum logType, Action<TMessage> action, Guid pathId) {
             StackTrace ss = new StackTrace(false);
             // 0是CreatePath,1是CreateCmdPath或CreateEventPath,2是当地
             Type location = ss.GetFrame(2).GetMethod().DeclaringType;
-            return MessagePath<TMessage>.Build(MessageDispatcher, location, description, logType, action, pathId, viaLimit: 1);
+            return MessagePath<TMessage>.Build(MessageHub, location, description, logType, action, pathId, viaLimit: 1);
         }
 
         public static IMessagePathId BuildViaLimitPath<TMessage>(string description, LogEnum logType, Action<TMessage> action, int viaLimit) {
             StackTrace ss = new StackTrace(false);
             // 0是CreatePath,1是CreateCmdPath或CreateEventPath,2是当地
             Type location = ss.GetFrame(2).GetMethod().DeclaringType;
-            return MessagePath<TMessage>.Build(MessageDispatcher, location, description, logType, action, Guid.Empty, viaLimit);
+            return MessagePath<TMessage>.Build(MessageHub, location, description, logType, action, Guid.Empty, viaLimit);
         }
 
         public static void BuildCmdPath<TCmd>(Action<TCmd> action, LogEnum logType = LogEnum.DevConsole)
@@ -53,7 +53,7 @@ namespace NTMiner {
             if (handler == null) {
                 return;
             }
-            MessageDispatcher.Remove(handler);
+            MessageHub.Remove(handler);
         }
 
         private static readonly Dictionary<string, Regex> _regexDic = new Dictionary<string, Regex>();

+ 2 - 2
src/UnitTests/UnitTests.csproj

@@ -110,9 +110,9 @@
       <Project>{f5091b28-5bb6-4446-9b97-02b37125e340}</Project>
       <Name>NTMinerLogging</Name>
     </ProjectReference>
-    <ProjectReference Include="..\NTMinerRouter\NTMinerRouter.csproj">
+    <ProjectReference Include="..\NTMinerRouter\NTMinerHub.csproj">
       <Project>{e17f278a-e393-403e-9d37-e371036d7a02}</Project>
-      <Name>NTMinerRouter</Name>
+      <Name>NTMinerHub</Name>
     </ProjectReference>
     <ProjectReference Include="..\NTMinerRpcClient\NTMinerRpcClient.csproj">
       <Project>{c7108d8f-eb73-4ae3-916f-be817ede37af}</Project>