mirror of
				https://github.com/esiur/esiur-dotnet.git
				synced 2025-10-31 07:51:36 +00:00 
			
		
		
		
	Make...Template
This commit is contained in:
		| @@ -35,6 +35,7 @@ using System.Net; | ||||
| using Esiur.Resource; | ||||
| using Esiur.Security.Membership; | ||||
| using System.Threading.Tasks; | ||||
| using Esiur.Resource.Template; | ||||
|  | ||||
| namespace Esiur.Net.IIP; | ||||
| public class DistributedServer : NetworkServer<DistributedConnection>, IResource | ||||
| @@ -183,11 +184,18 @@ public class DistributedServer : NetworkServer<DistributedConnection>, IResource | ||||
|  | ||||
|     } | ||||
|  | ||||
|     public KeyList<string, Delegate> Calls { get; } = new KeyList<string, Delegate>(); | ||||
|     public KeyList<string, CallInfo?> Calls { get; } = new KeyList<string, CallInfo?>(); | ||||
|  | ||||
|     public struct CallInfo | ||||
|     { | ||||
|         public FunctionTemplate Template; | ||||
|         public Delegate Delegate; | ||||
|     } | ||||
|  | ||||
|     public DistributedServer MapCall(string call, Delegate handler) | ||||
|     { | ||||
|         Calls.Add(call, handler); | ||||
|         var ft = FunctionTemplate.MakeFunctionTemplate(null, handler.Method); | ||||
|         Calls.Add(call, new CallInfo(){ Delegate = handler, Template = ft}); | ||||
|         return this; | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user