private void CallHookedScripts(ScriptHook hook, ScriptExecutionContext context, params object[] args) { foreach (var scriptMethod in HookedMethods[hook]) { try { CallScriptMethod(scriptMethod, null, context, args); } catch (Exception e) { LogError($"Failed to execute {hook.ToString()} script \"{scriptMethod.DeclaringType.Name}.{scriptMethod.Name}\" ({e.Message})"); LogException(e); } } }
public override string ToString() { return(string.Format("{0} : [Caller:{1}, Activator:{2}, Hook:{3}]", GetType().Name, Caller, Activator, Hook == ScriptHook.None ? (string.IsNullOrEmpty(NamedHook) ? "null" : NamedHook) : Hook.ToString())); }