ntminer 6 лет назад
Родитель
Сommit
112da4713e

+ 3 - 3
src/AppModels/AppContext.cs

@@ -10,7 +10,7 @@ namespace NTMiner {
         public static ExtendedNotifyIcon NotifyIcon;
         public static Action<RemoteDesktopInput> RemoteDesktop;
 
-        private static readonly List<IHandlerId> _contextHandlers = new List<IHandlerId>();
+        private static readonly List<IPathId> _contextHandlers = new List<IPathId>();
 
         private AppContext() {
         }
@@ -19,7 +19,7 @@ namespace NTMiner {
         /// <summary>
         /// 命令窗口。使用该方法的代码行应将前两个参数放在第一行以方便vs查找引用时展示出参数信息
         /// </summary>
-        public static IHandlerId CmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action)
+        public static IPathId CmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action)
             where TCmd : ICmd {
             return VirtualRoot.CreatePath(description, logType, action).AddToCollection(_contextHandlers);
         }
@@ -27,7 +27,7 @@ namespace NTMiner {
         /// <summary>
         /// 事件响应
         /// </summary>
-        public static IHandlerId EventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action)
+        public static IPathId EventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action)
             where TEvent : IEvent {
             return VirtualRoot.CreatePath(description, logType, action).AddToCollection(_contextHandlers);
         }

+ 1 - 1
src/AppModels/AppModels.csproj

@@ -111,7 +111,7 @@
     <Compile Include="Vms\FileWriterSelectViewModel.cs" />
     <Compile Include="Vms\FragmentWriterViewModel.cs" />
     <Compile Include="Vms\GpuStatusBarViewModel.cs" />
-    <Compile Include="Vms\HandlerIdsWindowViewModel.cs" />
+    <Compile Include="Vms\PathIdsWindowViewModel.cs" />
     <Compile Include="Vms\KernelOutputSelectViewModel.cs" />
     <Compile Include="Vms\KernelInputSelectViewModel.cs" />
     <Compile Include="Vms\LocalIpConfigViewModel.cs" />

+ 4 - 4
src/AppModels/Vms/HandlerIdsWindowViewModel.cs → src/AppModels/Vms/PathIdsWindowViewModel.cs

@@ -3,10 +3,10 @@ using System.Collections.Generic;
 using System.Collections.ObjectModel;
 
 namespace NTMiner.Vms {
-    public class HandlerIdsWindowViewModel : ViewModelBase {
-        private readonly ObservableCollection<IHandlerId> _handlerIds = new ObservableCollection<IHandlerId>();
+    public class PathIdsWindowViewModel : ViewModelBase {
+        private readonly ObservableCollection<IPathId> _handlerIds = new ObservableCollection<IPathId>();
 
-        public HandlerIdsWindowViewModel() {
+        public PathIdsWindowViewModel() {
             VirtualRoot.SMessageDispatcher.Connected += (handlerId)=> {
                 UIThread.Execute(() => {
                     _handlerIds.Add(handlerId);
@@ -19,7 +19,7 @@ namespace NTMiner.Vms {
             };
         }
 
-        public IEnumerable<IHandlerId> HandlerIds {
+        public IEnumerable<IPathId> HandlerIds {
             get {
                 return _handlerIds;
             }

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

@@ -43,7 +43,7 @@ namespace NTMiner.Vms {
             if (IsAutoStart && !this.MinerProfile.IsMining) {
                 this.MinerProfile.IsMining = true;
                 int n = MinerProfile.AutoStartDelaySeconds;
-                IHandlerId handler = null;
+                IPathId handler = null;
                 handler = AppContext.EventPath<Per1SecondEvent>("挖矿倒计时", LogEnum.None,
                 action: message => {
                     if (NTMinerRoot.IsAutoStartCanceled) {

+ 7 - 0
src/AppViews0/AppViews0.csproj

@@ -101,6 +101,9 @@
     <Compile Include="PackagesWindow.xaml.cs">
       <DependentUpon>PackagesWindow.xaml</DependentUpon>
     </Compile>
+    <Compile Include="PathIdsWindow.xaml.cs">
+      <DependentUpon>PathIdsWindow.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Ucs\BrandTag.xaml.cs">
       <DependentUpon>BrandTag.xaml</DependentUpon>
     </Compile>
@@ -463,6 +466,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="PathIdsWindow.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Ucs\BrandTag.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>

+ 2 - 2
src/MinerClient/Views/HandlerIdsWindow.xaml → src/AppViews0/PathIdsWindow.xaml

@@ -1,5 +1,5 @@
 <blankWindow:BlankWindow
-	x:Class="NTMiner.Views.HandlerIdsWindow"
+	x:Class="NTMiner.Views.PathIdsWindow"
 	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 	xmlns:blankWindow="http://NTMiner.com"
@@ -16,7 +16,7 @@
 	WindowStartupLocation="CenterScreen"
 	TextOptions.TextFormattingMode="Display">
 	<blankWindow:BlankWindow.DataContext>
-		<vm:HandlerIdsWindowViewModel></vm:HandlerIdsWindowViewModel>
+		<vm:PathIdsWindowViewModel></vm:PathIdsWindowViewModel>
 	</blankWindow:BlankWindow.DataContext>
 	<Grid>
 		<Grid.RowDefinitions>

+ 4 - 4
src/MinerClient/Views/HandlerIdsWindow.xaml.cs → src/AppViews0/PathIdsWindow.xaml.cs

@@ -3,14 +3,14 @@ using System.ComponentModel;
 using System.Windows.Input;
 
 namespace NTMiner.Views {
-    public partial class HandlerIdsWindow : BlankWindow {
-        public HandlerIdsWindowViewModel Vm {
+    public partial class PathIdsWindow : BlankWindow {
+        public PathIdsWindowViewModel Vm {
             get {
-                return (HandlerIdsWindowViewModel)this.DataContext;
+                return (PathIdsWindowViewModel)this.DataContext;
             }
         }
 
-        public HandlerIdsWindow() {
+        public PathIdsWindow() {
             InitializeComponent();
         }
 

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

@@ -73,7 +73,7 @@ namespace NTMiner {
                     ConsoleWindow.Instance.Show();
                     NotiCenterWindow.Instance.Show();
                     if (DevMode.IsDevMode) {
-                        HandlerIdsWindow window = new HandlerIdsWindow();
+                        PathIdsWindow window = new PathIdsWindow();
                         window.Show();
                     }
                     if (!NTMiner.Windows.Role.IsAdministrator) {

+ 0 - 7
src/MinerClient/MinerClient.csproj

@@ -105,9 +105,6 @@
     <Compile Include="RemoteDesktopEnabler\Rdp.cs" />
     <Compile Include="RemoteDesktopEnabler\Firewall.cs" />
     <Compile Include="SwitchRadeonGpu\SwitchRadeonGpu.cs" />
-    <Compile Include="Views\HandlerIdsWindow.xaml.cs">
-      <DependentUpon>HandlerIdsWindow.xaml</DependentUpon>
-    </Compile>
     <Compile Include="Windows\WindowsUtil.cs" />
   </ItemGroup>
   <ItemGroup>
@@ -208,10 +205,6 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
-    <Page Include="Views\HandlerIdsWindow.xaml">
-      <Generator>MSBuild:Compile</Generator>
-      <SubType>Designer</SubType>
-    </Page>
   </ItemGroup>
   <ItemGroup>
     <EmbeddedResource Include="SwitchRadeonGpu\switch-radeon-gpu.exe" />

+ 2 - 2
src/NTMiner/INTMinerRoot.cs

@@ -11,8 +11,8 @@ using System.Collections.Generic;
 
 namespace NTMiner {
     public interface INTMinerRoot {
-        IHandlerId ServerContextCmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action) where TCmd : ICmd;
-        IHandlerId ServerContextEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action) where TEvent : IEvent;
+        IPathId ServerContextCmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action) where TCmd : ICmd;
+        IPathId ServerContextEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action) where TEvent : IEvent;
         
         void ReInitMinerProfile();
 

+ 3 - 3
src/NTMiner/NTMinerRoot.cs

@@ -26,12 +26,12 @@ using System.Threading.Tasks;
 
 namespace NTMiner {
     public partial class NTMinerRoot : INTMinerRoot {
-        private readonly List<IHandlerId> _serverContextHandlers = new List<IHandlerId>();
+        private readonly List<IPathId> _serverContextHandlers = new List<IPathId>();
 
         /// <summary>
         /// 命令窗口。使用该方法的代码行应将前两个参数放在第一行以方便vs查找引用时展示出参数信息
         /// </summary>
-        public IHandlerId ServerContextCmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action)
+        public IPathId ServerContextCmdPath<TCmd>(string description, LogEnum logType, Action<TCmd> action)
             where TCmd : ICmd {
             return VirtualRoot.CreatePath(description, logType, action).AddToCollection(_serverContextHandlers);
         }
@@ -39,7 +39,7 @@ namespace NTMiner {
         /// <summary>
         /// 事件响应
         /// </summary>
-        public IHandlerId ServerContextEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action)
+        public IPathId ServerContextEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action)
             where TEvent : IEvent {
             return VirtualRoot.CreatePath(description, logType, action).AddToCollection(_serverContextHandlers);
         }

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

@@ -34,7 +34,7 @@ namespace NTMiner {
                                 Write.UserWarn("应用超频,如果CPU性能较差耗时可能超过1分钟,请耐心等待");
                                 var cmd = new CoinOverClockCommand(mineContext.MainCoin.GetId());
                                 // N卡超频当cpu性能非常差时较耗时,所以这里弄个回调
-                                DelegateHandler<CoinOverClockDoneEvent> callback = null;
+                                DelegatePath<CoinOverClockDoneEvent> callback = null;
                                 callback = VirtualRoot.CreateEventPath<CoinOverClockDoneEvent>("超频完成后继续流程", LogEnum.DevConsole,
                                     message => {
                                         if (mineContext != Instance.CurrentMineContext) {
@@ -123,7 +123,7 @@ namespace NTMiner {
             #endregion
 
             #region KernelProcessDaemon
-            private static DelegateHandler<Per1MinuteEvent> _kernelProcessDaemon = null;
+            private static DelegatePath<Per1MinuteEvent> _kernelProcessDaemon = null;
             private static void KernelProcessDaemon(IMineContext mineContext, Action clear) {
                 if (_kernelProcessDaemon != null) {
                     VirtualRoot.DeletePath(_kernelProcessDaemon);
@@ -317,7 +317,7 @@ namespace NTMiner {
                         VirtualRoot.Happened(new StartingMineFailedEvent($"管道型进程创建失败 lasterr:{lasterr}"));
                     }
                     else {
-                        Bus.DelegateHandler<MineStopedEvent> closeHandle = null;
+                        Bus.DelegatePath<MineStopedEvent> closeHandle = null;
                         bool isHWriteOutHasClosed = false;
                         KernelProcessDaemon(mineContext, () => {
                             if (!isHWriteOutHasClosed) {

+ 9 - 10
src/NTMinerBus/Bus/DelegateHandler`1.cs → src/NTMinerBus/Bus/DelegatePath`1.cs

@@ -2,26 +2,25 @@
 using System.ComponentModel;
 
 namespace NTMiner.Bus {
-    public class DelegateHandler<TMessage> : IHandlerId, INotifyPropertyChanged {
-        private readonly Action<TMessage> _action;
+    public class DelegatePath<TMessage> : IPathId, INotifyPropertyChanged {
+        private readonly Action<TMessage> _path;
         private bool _isEnabled;
 
         public event PropertyChangedEventHandler PropertyChanged;
 
-        public DelegateHandler(Type location, string description, LogEnum logType, Action<TMessage> action) {
+        public DelegatePath(Type location, string description, LogEnum logType, Action<TMessage> path) {
             this.IsEnabled = true;
             MessageType = typeof(TMessage);
-            string path = $"{location.FullName}[{MessageType.FullName}]";
             Location = location;
-            HandlerPath = path;
+            Path = $"{location.FullName}[{MessageType.FullName}]";
             Description = description;
             LogType = logType;
-            _action = action;
+            _path = path;
         }
 
         public Type MessageType { get; private set; }
         public Type Location { get; private set; }
-        public string HandlerPath { get; private set; }
+        public string Path { get; private set; }
         public LogEnum LogType { get; private set; }
         public string Description { get; private set; }
         public bool IsEnabled {
@@ -32,12 +31,12 @@ namespace NTMiner.Bus {
             }
         }
 
-        public void Handle(TMessage message) {
+        public void Run(TMessage message) {
             try {
-                _action?.Invoke(message);
+                _path?.Invoke(message);
             }
             catch (Exception e) {
-                Logger.ErrorDebugLine(HandlerPath + ":" + e.Message, e);
+                Logger.ErrorDebugLine(Path + ":" + e.Message, e);
                 throw;
             }
         }

+ 4 - 4
src/NTMinerBus/Bus/IMessageDispatcher.cs

@@ -4,11 +4,11 @@ namespace NTMiner.Bus {
     public interface IMessageDispatcher {
         void Dispatch<TMessage>(TMessage message);
 
-        void Connect<TMessage>(DelegateHandler<TMessage> handler);
+        void Connect<TMessage>(DelegatePath<TMessage> handler);
 
-        void Disconnect(IHandlerId handlerId);
+        void Disconnect(IPathId handlerId);
 
-        event Action<IHandlerId> Connected;
-        event Action<IHandlerId> Disconnected;
+        event Action<IPathId> Connected;
+        event Action<IPathId> Disconnected;
     }
 }

+ 2 - 2
src/NTMinerBus/Bus/IHandlerId.cs → src/NTMinerBus/Bus/IPathId.cs

@@ -2,11 +2,11 @@
 
 namespace NTMiner.Bus {
     
-    public interface IHandlerId {
+    public interface IPathId {
         Type MessageType { get; }
         bool IsEnabled { get; set; }
         Type Location { get; }
-        string HandlerPath { get; }
+        string Path { get; }
         LogEnum LogType { get; }
         string Description { get; }
     }

+ 14 - 14
src/NTMinerBus/Bus/MessageDispatcher.cs

@@ -4,11 +4,11 @@
 
     public class MessageDispatcher : IMessageDispatcher {
         private readonly Dictionary<Type, List<object>> _handlers = new Dictionary<Type, List<object>>();
-        private readonly Dictionary<string, List<IHandlerId>> _paths = new Dictionary<string, List<IHandlerId>>();
+        private readonly Dictionary<string, List<IPathId>> _paths = new Dictionary<string, List<IPathId>>();
         private readonly object _locker = new object();
 
-        public event Action<IHandlerId> Connected;
-        public event Action<IHandlerId> Disconnected;
+        public event Action<IPathId> Connected;
+        public event Action<IPathId> Disconnected;
 
         #region IMessageDispatcher Members
         public void Dispatch<TMessage>(TMessage message) {
@@ -20,7 +20,7 @@
             if (_handlers.ContainsKey(messageType)) {
                 var messageHandlers = _handlers[messageType].ToArray();
                 foreach (var messageHandler in messageHandlers) {
-                    var tMessageHandler = (DelegateHandler<TMessage>)messageHandler;
+                    var tMessageHandler = (DelegatePath<TMessage>)messageHandler;
                     if (!tMessageHandler.IsEnabled) {
                         continue;
                     }
@@ -37,7 +37,7 @@
                         default:
                             break;
                     }
-                    tMessageHandler.Handle(message);
+                    tMessageHandler.Run(message);
                 }
             }
             else if (!messageTypeDescription.IsCanNoHandler) {
@@ -45,7 +45,7 @@
             }
         }
 
-        public void Connect<TMessage>(DelegateHandler<TMessage> handler) {
+        public void Connect<TMessage>(DelegatePath<TMessage> handler) {
             if (handler == null) {
                 throw new ArgumentNullException(nameof(handler));
             }
@@ -53,16 +53,16 @@
                 var keyType = typeof(TMessage);
 
                 var handlerId = handler;
-                if (!_paths.ContainsKey(handlerId.HandlerPath)) {
-                    _paths.Add(handlerId.HandlerPath, new List<IHandlerId> { handlerId });
+                if (!_paths.ContainsKey(handlerId.Path)) {
+                    _paths.Add(handlerId.Path, new List<IPathId> { handlerId });
                 }
                 else {
-                    List<IHandlerId> handlerIds = _paths[handlerId.HandlerPath];
+                    List<IPathId> handlerIds = _paths[handlerId.Path];
                     if (handlerIds.Count == 1) {
-                        Write.DevWarn($"重复的路径:{handlerIds[0].HandlerPath} {handlerIds[0].Description}");
+                        Write.DevWarn($"重复的路径:{handlerIds[0].Path} {handlerIds[0].Description}");
                     }
                     handlerIds.Add(handlerId);
-                    Write.DevWarn($"重复的路径:{handlerId.HandlerPath} {handlerId.Description}");
+                    Write.DevWarn($"重复的路径:{handlerId.Path} {handlerId.Description}");
                 }
                 if (_handlers.ContainsKey(keyType)) {
                     var registeredHandlers = _handlers[keyType];
@@ -83,19 +83,19 @@
             }
         }
 
-        public void Disconnect(IHandlerId handlerId) {
+        public void Disconnect(IPathId handlerId) {
             if (handlerId == null) {
                 return;
             }
             lock (_locker) {
-                _paths.Remove(handlerId.HandlerPath);
+                _paths.Remove(handlerId.Path);
                 var keyType = handlerId.MessageType;
                 if (_handlers.ContainsKey(keyType) &&
                     _handlers[keyType] != null &&
                     _handlers[keyType].Count > 0 &&
                     _handlers[keyType].Contains(handlerId)) {
                     _handlers[keyType].Remove(handlerId);
-                    Write.DevDebug("拆除路径" + handlerId.HandlerPath);
+                    Write.DevDebug("拆除路径" + handlerId.Path);
                     Disconnected?.Invoke(handlerId);
                 }
             }

+ 2 - 2
src/NTMinerBus/Bus/MessageDispatcherExtensions.cs

@@ -2,11 +2,11 @@
 
 namespace NTMiner.Bus {
     public static class MessageDispatcherExtensions {
-        public static DelegateHandler<TMessage> Connect<TMessage>(this IMessageDispatcher dispatcher, Type location, string description, LogEnum logType, Action<TMessage> action) {
+        public static DelegatePath<TMessage> Connect<TMessage>(this IMessageDispatcher dispatcher, Type location, string description, LogEnum logType, Action<TMessage> action) {
             if (action == null) {
                 throw new ArgumentNullException(nameof(action));
             }
-            DelegateHandler<TMessage> handler = new DelegateHandler<TMessage>(location, description, logType, action);
+            DelegatePath<TMessage> handler = new DelegatePath<TMessage>(location, description, logType, action);
             dispatcher.Connect(handler);
             return handler;
         }

+ 1 - 1
src/NTMinerBus/Bus/MessageHandlerExtensions.cs

@@ -3,7 +3,7 @@
 namespace NTMiner.Bus {
     public static class MessageHandlerExtensions {
 
-        public static IHandlerId AddToCollection(this IHandlerId handler, List<IHandlerId> handlers) {
+        public static IPathId AddToCollection(this IPathId handler, List<IPathId> handlers) {
             if (!handlers.Contains(handler)) {
                 handlers.Add(handler);
             }

+ 2 - 2
src/NTMinerBus/NTMinerBus.csproj

@@ -36,7 +36,7 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Bus\Cmd.cs" />
-    <Compile Include="Bus\DelegateHandler`1.cs" />
+    <Compile Include="Bus\DelegatePath`1.cs" />
     <Compile Include="Bus\DirectBus\DirectBus.cs" />
     <Compile Include="Bus\DirectBus\DirectCommandBus.cs" />
     <Compile Include="Bus\DirectBus\DirectEventBus.cs" />
@@ -47,7 +47,7 @@
     <Compile Include="Bus\ICmdBus.cs" />
     <Compile Include="Bus\IEvent.cs" />
     <Compile Include="Bus\IEventBus.cs" />
-    <Compile Include="Bus\IHandlerId.cs" />
+    <Compile Include="Bus\IPathId.cs" />
     <Compile Include="Bus\IMessage.cs" />
     <Compile Include="Bus\IMessageDispatcher.cs" />
     <Compile Include="Bus\MessageDispatcher.cs" />

+ 5 - 5
src/NTMinerWpf/WindowExtension.cs

@@ -98,9 +98,9 @@ namespace NTMiner {
             if (window.Resources == null) {
                 window.Resources = new ResourceDictionary();
             }
-            List<IHandlerId> contextHandlers = (List<IHandlerId>)window.Resources["ntminer_contextHandlers"];
+            List<IPathId> contextHandlers = (List<IPathId>)window.Resources["ntminer_contextHandlers"];
             if (contextHandlers == null) {
-                contextHandlers = new List<IHandlerId>();
+                contextHandlers = new List<IPathId>();
                 window.Resources.Add("ntminer_contextHandlers", contextHandlers);
                 window.Closed += UiElement_Closed;
             }
@@ -118,9 +118,9 @@ namespace NTMiner {
             if (window.Resources == null) {
                 window.Resources = new ResourceDictionary();
             }
-            List<IHandlerId> contextHandlers = (List<IHandlerId>)window.Resources["ntminer_contextHandlers"];
+            List<IPathId> contextHandlers = (List<IPathId>)window.Resources["ntminer_contextHandlers"];
             if (contextHandlers == null) {
-                contextHandlers = new List<IHandlerId>();
+                contextHandlers = new List<IPathId>();
                 window.Resources.Add("ntminer_contextHandlers", contextHandlers);
                 window.Closed += UiElement_Closed; ;
             }
@@ -129,7 +129,7 @@ namespace NTMiner {
 
         private static void UiElement_Closed(object sender, EventArgs e) {
             Window uiElement = (Window)sender;
-            List<IHandlerId> contextHandlers = (List<IHandlerId>)uiElement.Resources["ntminer_contextHandlers"];
+            List<IPathId> contextHandlers = (List<IPathId>)uiElement.Resources["ntminer_contextHandlers"];
             foreach (var handler in contextHandlers) {
                 VirtualRoot.DeletePath(handler);
             }

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

@@ -27,7 +27,7 @@ namespace NTMiner {
         }
 
         // 修建消息(命令或事件)的运动路径
-        public static DelegateHandler<TMessage> CreatePath<TMessage>(string description, LogEnum logType, Action<TMessage> action) {
+        public static DelegatePath<TMessage> CreatePath<TMessage>(string description, LogEnum logType, Action<TMessage> action) {
             StackTrace ss = new StackTrace(false);
             // 0是CreatePath,1是CreateCmdPath或CreateEventPath,2是当地
             Type location = ss.GetFrame(2).GetMethod().DeclaringType;
@@ -37,7 +37,7 @@ namespace NTMiner {
         /// <summary>
         /// 创建命令路径
         /// </summary>
-        public static DelegateHandler<TCmd> CreateCmdPath<TCmd>(Action<TCmd> action, LogEnum logType = LogEnum.DevConsole)
+        public static DelegatePath<TCmd> CreateCmdPath<TCmd>(Action<TCmd> action, LogEnum logType = LogEnum.DevConsole)
             where TCmd : ICmd {
             MessageTypeAttribute messageTypeDescription = MessageTypeAttribute.GetMessageTypeDescription(typeof(TCmd));
             string description = "处理" + messageTypeDescription.Description;
@@ -47,13 +47,13 @@ namespace NTMiner {
         /// <summary>
         /// 创建事件路径
         /// </summary>
-        public static DelegateHandler<TEvent> CreateEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action)
+        public static DelegatePath<TEvent> CreateEventPath<TEvent>(string description, LogEnum logType, Action<TEvent> action)
             where TEvent : IEvent {
             return CreatePath(description, logType, action);
         }
 
         // 拆除消息(命令或事件)的运动路径
-        public static void DeletePath(IHandlerId handler) {
+        public static void DeletePath(IPathId handler) {
             if (handler == null) {
                 return;
             }