public static void RegisterCallBack(string key, HandleCustom handle) { if (dict.ContainsKey(key)) { dict[key] = handle; } else { dict.Add(key, handle); keys.Add(key); } Logger.v("Register " + key); }
public static bool Call(string key, string arg, out string result) { result = ""; if (dict.ContainsKey(key)) { HandleCustom handler = dict[key]; try { result = handler(arg); } catch (System.Exception ex) { Logger.w(ex.Message + "\n" + ex.StackTrace); } return(true); } else { Logger.w("UnRegitster Function ==>" + key); return(false); } }