コード例 #1
0
        public void RegisterGetProcessHighlightingColorHandler(GeneralGetHighlightingColorDelegate handler)
        {
            if (handler == null)
            {
                throw new InvalidOperationException("Delegate handler can not be null.");
            }

            CallbackRegistration registration = new CallbackRegistration(
                NativeApi.PhGetGeneralCallback(PhGeneralCallback.GetProcessHighlightingColor),
                (parameter, context) =>
            {
                PhPluginGetHighlightingColor *pargs = (PhPluginGetHighlightingColor *)parameter;
                GeneralGetHighlightingColorArgs args;

                args.Parameter = (IntPtr)pargs->Parameter;
                args.BackColor = ColorTranslator.FromWin32(pargs->BackColor);
                args.Handled   = pargs->Handled;
                args.Cache     = pargs->Cache;

                handler(this, ref args);

                pargs->BackColor = ColorTranslator.ToWin32(args.BackColor);
                pargs->Handled   = args.Handled;
                pargs->Cache     = args.Cache;
            }
                );

            _registrations.Add(registration);
        }
コード例 #2
0
        /// <summary>
        /// Registers a callback for interval update notifications.
        /// </summary>
        /// <remarks>
        /// Registering for Interval udpates allows you to use the interval settings
        /// set by the user to update your display if required.
        /// </remarks>
        /// <param name="handler">The delegate to invoke.</param>
        public void RegisterIntervalUpdateHandler(SimplePluginDelegate handler)
        {
            if (handler == null)
            {
                throw new InvalidOperationException("Delegate handler can not be null.");
            }

            CallbackRegistration registration = new CallbackRegistration(
                NativeApi.PhGetGeneralCallback(PhGeneralCallback.IntervalUpdate),
                (parameter, context) => handler(this)
                );

            _registrations.Add(registration);
        }
コード例 #3
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);
        }
コード例 #4
0
        /// <summary>
        /// Registers a callback for Plugin unload notifications.
        /// </summary>
        /// <param name="handler">The delegate to invoke.</param>
        public void RegisterUnLoadHandler(SimplePluginDelegate handler)
        {
            if (handler == null)
            {
                throw new InvalidOperationException("Delegate handler can not be null.");
            }

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

            _registrations.Add(registration);
        }
コード例 #5
0
        /// <summary>
        /// Registers a callback for Plugin load notifications.
        /// </summary>
        /// <param name="handler">The delegate to invoke.</param>
        public void RegisterLoadHandler(SimplePluginDelegate handler)
        {
            if (handler == null)
                throw new InvalidOperationException("Delegate handler can not be null.");

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

            _registrations.Add(registration);
        }
コード例 #6
0
        public void RegisterGetProcessHighlightingColorHandler(GeneralGetHighlightingColorDelegate handler)
        {
            if (handler == null)
                throw new InvalidOperationException("Delegate handler can not be null.");

            CallbackRegistration registration = new CallbackRegistration(
                NativeApi.PhGetGeneralCallback(PhGeneralCallback.GetProcessHighlightingColor),
                (parameter, context) =>
                {
                    PhPluginGetHighlightingColor* pargs = (PhPluginGetHighlightingColor*)parameter;
                    GeneralGetHighlightingColorArgs args;

                    args.Parameter = (IntPtr)pargs->Parameter;
                    args.BackColor = ColorTranslator.FromWin32(pargs->BackColor);
                    args.Handled = pargs->Handled;
                    args.Cache = pargs->Cache;

                    handler(this, ref args);

                    pargs->BackColor = ColorTranslator.ToWin32(args.BackColor);
                    pargs->Handled = args.Handled;
                    pargs->Cache = args.Cache;
                }
                );

            _registrations.Add(registration);
        }
コード例 #7
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);
        }
コード例 #8
0
        /// <summary>
        /// Registers a callback for interval update notifications.
        /// </summary>
        /// <remarks>
        /// Registering for Interval udpates allows you to use the interval settings
        /// set by the user to update your display if required.
        /// </remarks>
        /// <param name="handler">The delegate to invoke.</param>
        public void RegisterIntervalUpdateHandler(SimplePluginDelegate handler)
        {
            if (handler == null)
                throw new InvalidOperationException("Delegate handler can not be null.");

            CallbackRegistration registration = new CallbackRegistration(
                NativeApi.PhGetGeneralCallback(PhGeneralCallback.IntervalUpdate),
                (parameter, context) => handler(this)
                );

            _registrations.Add(registration);
        }