1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Reflection;
- using System.Threading.Tasks;
- namespace JsonRPC4.Router
- {
- internal class StaticRpcMethodProvider : IRpcMethodProvider
- {
- // Token: 0x1700003E RID: 62
- // (get) Token: 0x060000B0 RID: 176 RVA: 0x00003488 File Offset: 0x00001688
- private List<MethodInfo> baseMethods { get; }
- // Token: 0x1700003F RID: 63
- // (get) Token: 0x060000B1 RID: 177 RVA: 0x00003490 File Offset: 0x00001690
- private Dictionary<RpcPath, List<MethodInfo>> methods { get; }
- // Token: 0x060000B2 RID: 178 RVA: 0x00003498 File Offset: 0x00001698
- public StaticRpcMethodProvider(List<MethodInfo> baseMethods, Dictionary<RpcPath, List<MethodInfo>> methods)
- {
- this.baseMethods = baseMethods;
- this.methods = methods;
- }
- // Token: 0x060000B3 RID: 179 RVA: 0x000034B0 File Offset: 0x000016B0
- public bool TryGetByPath(RpcPath path, out IReadOnlyList<MethodInfo> methods)
- {
- if (path == null)
- {
- methods = this.baseMethods;
- return true;
- }
- List<MethodInfo> list;
- if (this.methods.TryGetValue(path, out list))
- {
- methods = list;
- return true;
- }
- methods = null;
- return false;
- }
- }
- }
|