private void setUpHookData(WinHookBase hook) { this.Hook = hook; if (hook != null) { this.Data.Add("HookID", hook.HookId); this.Data.Add("Attached", hook.Attached); this.Data.Add("MainProcedure", hook.MainProcedure); } }
/// <summary> /// Creates a new WinHookException bound to a specific hook, with the specified exception message, and the specified /// inner exception. /// </summary> /// <param name="hook">The hook that caused the exception to be thrown.</param> /// <param name="message">The exception message.</param> /// <param name="innerException"> /// The exception that caused this exception to be thrown. Generally a /// <see cref="WinSysException" />. /// </param> public WinHookException(WinHookBase hook, string message, Exception innerException) : base(message, innerException) { this.setUpHookData(hook); }
/// <summary> /// Creates a new WinHookException bound to the specified hook. The message is set accordingly. /// </summary> /// <param name="hook">The hook that caused the exception to be thrown.</param> public WinHookException(WinHookBase hook) : base(hook == null ? null : $"The hook {hook} errored.") { this.setUpHookData(hook); }