public static void RegisterHandler(BaseHandler handler, string name, RemoteNameFunc remoteNameFunc) { Dictionary <string, RemoteMethod> m = handler.GetRemotesMap(); foreach (KeyValuePair <string, RemoteMethod> kvp in m) { var rn = remoteNameFunc(kvp.Key); var handlerName = $"{name}.{rn}"; if (HandlersDict.ContainsKey(handlerName)) { throw new PitayaException($"tried to register same remote twice! remote name: {handlerName}"); } Logger.Info("registering handler {0}", handlerName); HandlersDict[handlerName] = kvp.Value; } }