Beispiel #1
0
        /// <summary>
        /// Processes all change notifications sent by the Windows Shell.
        /// </summary>
        /// <param name="e">The windows message representing the notification event</param>
        protected virtual void ProcessChangeNotificationEvent(WindowMessageEventArgs e)
        {
            if (!Running)
            {
                return;
            }
            if (e == null)
            {
                throw new ArgumentNullException(nameof(e));
            }

            ChangeNotifyLock notifyLock = new ChangeNotifyLock(e.Message);

            ShellObjectNotificationEventArgs args = null;

            switch (notifyLock.ChangeType)
            {
            case ShellObjectChangeTypes.DirectoryRename:
            case ShellObjectChangeTypes.ItemRename:
                args = new ShellObjectRenamedEventArgs(notifyLock);
                break;

            case ShellObjectChangeTypes.SystemImageUpdate:
                args = new SystemImageUpdatedEventArgs(notifyLock);
                break;

            default:
                args = new ShellObjectChangedEventArgs(notifyLock);
                break;
            }

            _manager.Invoke(this, notifyLock.ChangeType, args);
        }
Beispiel #2
0
 private void OnWindowMessageReceived(WindowMessageEventArgs e)
 {
     if (e.Message.Msg == _message)
     {
         _context.Send(x => ProcessChangeNotificationEvent(e), null);
     }
 }
Beispiel #3
0
 private void MessageReceived(object sender, WindowMessageEventArgs e)
 {
     if (Callbacks.TryGetValue(e.Message.Msg, out Action <WindowMessageEventArgs> action))
     {
         action(e);
     }
 }
 private void MessageReceived(object sender, WindowMessageEventArgs e)
 {
     Action<WindowMessageEventArgs> action;
     if (Callbacks.TryGetValue(e.Message.Msg, out action))
     {
         action(e);
     }
 }
Beispiel #5
0
        /// <summary>
        /// Processes all change notifications sent by the Windows Shell.
        /// </summary>
        /// <param name="e">The windows message representing the notification event</param>
        protected virtual void ProcessChangeNotificationEvent(WindowMessageEventArgs e)
        {
            if (!Running) { return; }
            if (e == null) { throw new ArgumentNullException("e"); }

            ChangeNotifyLock notifyLock = new ChangeNotifyLock(e.Message);

            ShellObjectNotificationEventArgs args = null;
            switch (notifyLock.ChangeType)
            {
                case ShellObjectChangeTypes.DirectoryRename:
                case ShellObjectChangeTypes.ItemRename:
                    args = new ShellObjectRenamedEventArgs(notifyLock);
                    break;
                case ShellObjectChangeTypes.SystemImageUpdate:
                    args = new SystemImageUpdatedEventArgs(notifyLock);
                    break;
                default:
                    args = new ShellObjectChangedEventArgs(notifyLock);
                    break;
            }

            _manager.Invoke(this, notifyLock.ChangeType, args);
        }
Beispiel #6
0
 private void OnWindowMessageReceived(WindowMessageEventArgs e)
 {
     if (e.Message.Msg == _message)
     {
         _context.Send(x => ProcessChangeNotificationEvent(e), null);
     }
 }