Ejemplo n.º 1
0
        /// <summary>
        /// register a kernel-hook
        /// </summary>
        /// <param name="context">command evaluation context</param>
        /// <param name="mi">hook method info</param>
        public void RegisterHook(
            CommandEvaluationContext context,
            string name,
            MethodInfo mi)
        {
            object owner = _GetInstance(mi.DeclaringType);
            var    hs    = new HookSpecification(name, owner, mi);

            _hooks.AddOrReplace(name, hs);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// register a kernel-hook
        /// </summary>
        /// <param name="context">command evaluation context</param>
        /// <param name="mi">hook method info</param>
        public void RegisterHook(
            CommandEvaluationContext context,
            string name,

            MethodInfo mi)
        {
            object owner = _GetInstance(mi.DeclaringType);      // TODO: having no instance, we MUST use DI to share INSTANCES
            var    hs    = new HookSpecification(name, owner, mi);

            _hooks.AddOrReplace(name, hs);
        }