Exemplo n.º 1
0
        /// <summary>
        /// Registers a Menu Item handler on the View menu.
        /// </summary>
        /// <param name="handler">The delegate to invoke.</param>
        public void RegisterMenuItemHandler(PluginParamsCallbackDelegate handler)
        {
            if (handler == null)
            {
                throw new InvalidOperationException("Delegate handler can not be null.");
            }

            CallbackRegistration registration = new CallbackRegistration(
                NativeApi.PhGetPluginCallback(this.Plugin, PhPluginCallback.MenuItem),
                (parameter, context) => handler(this, parameter, context)
                );

            _registrations.Add(registration);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Registers a Menu Item handler on the View menu.
        /// </summary>
        /// <param name="handler">The delegate to invoke.</param>
        public void RegisterMenuItemHandler(PluginParamsCallbackDelegate handler)
        {
            if (handler == null)
                throw new InvalidOperationException("Delegate handler can not be null.");

            CallbackRegistration registration = new CallbackRegistration(
                NativeApi.PhGetPluginCallback(this.Plugin, PhPluginCallback.MenuItem),
                (parameter, context) => handler(this, parameter, context)
                );

            _registrations.Add(registration);
        }