Ejemplo n.º 1
0
        /// <summary>
        /// Unregisters from receiving Chroma events.
        /// </summary>
        public void Unregister()
        {
            if (!_registered)
            {
                return;
            }

            NativeWrapper.UnregisterEventNotification();
            _registered       = false;
            _registeredHandle = IntPtr.Zero;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Registers to start receiving Chroma events.
        /// </summary>
        /// <param name="handle">Handle to the application Window that is running the message loop.</param>
        /// <remarks>
        /// Chroma events are sent using the Windows message API, as such, there has to be something handling
        /// Windows messages to receive them. Messages need to be passed to the message handler in Colore to
        /// be processed, as this cannot be automated.
        /// </remarks>
        public void Register(IntPtr handle)
        {
            if (_registered)
            {
                NativeWrapper.UnregisterEventNotification();
            }

            NativeWrapper.RegisterEventNotification(handle);
            _registered       = true;
            _registeredHandle = handle;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Unregisters from receiving Chroma events.
        /// </summary>
        public void Unregister()
        {
            if (!_registered)
            {
                return;
            }

            Log.Debug("Unregistering from Chroma event notifications");

            NativeWrapper.UnregisterEventNotification();
            _registered       = false;
            _registeredHandle = IntPtr.Zero;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Registers to start receiving Chroma events.
        /// </summary>
        /// <param name="handle">Handle to the application Window that is running the message loop.</param>
        /// <remarks>
        /// Chroma events are sent using the Windows message API, as such, there has to be something handling
        /// Windows messages to receive them. Messages need to be passed to the message handler in Colore to
        /// be processed, as this cannot be automated.
        /// </remarks>
        public void Register(IntPtr handle)
        {
            Log.Debug("Registering for Chroma event notifications");

            if (_registered)
            {
                Log.Debug("Already registered, unregistering before continuing with registration");
                NativeWrapper.UnregisterEventNotification();
            }

            NativeWrapper.RegisterEventNotification(handle);
            _registered       = true;
            _registeredHandle = handle;
        }