Esempio n. 1
0
        /// <summary>
        /// Add a hook method to plugin
        /// </summary>
        /// <param name="name">Hook name</param>
        /// <param name="method">Method Info instance of the needed method</param>
        public void AddHookMethod(string name, MethodInfo method)
        {
            if (Hooks.ContainsKey(name))
            {
                Log.Warning($"Plugin {Title} tried to register an existing hook");
                return;
            }

            Hooks[name] = new HookMethod(this, name, method);
        }
Esempio n. 2
0
 public bool RemoveHook(string hook, ulong id)
 {
     if (!Hooks.ContainsKey(hook))
     {
         return(false);
     }
     if (!Hooks[hook].Contains(id))
     {
         return(false);
     }
     Hooks[hook].Remove(id);
     return(true);
 }