Esempio n. 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("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);
        }
Esempio n. 2
0
 internal ShellObjectRenamedEventArgs(ChangeNotifyLock notifyLock)
     : base(notifyLock)
 {
     NewPath = notifyLock.ItemName2;
 }
Esempio n. 3
0
 internal SystemImageUpdatedEventArgs(ChangeNotifyLock notifyLock)
     : base(notifyLock)
 {
     ImageIndex = notifyLock.ImageIndex;
 }
Esempio n. 4
0
 internal ShellObjectNotificationEventArgs(ChangeNotifyLock notifyLock)
 {
     ChangeType          = notifyLock.ChangeType;
     FromSystemInterrupt = notifyLock.FromSystemInterrupt;
 }
Esempio n. 5
0
 internal ShellObjectChangedEventArgs(ChangeNotifyLock notifyLock)
     : base(notifyLock)
 {
     Path = notifyLock.ItemName;
 }
		internal SystemImageUpdatedEventArgs(ChangeNotifyLock notifyLock)
			: base(notifyLock) {
			ImageIndex = notifyLock.ImageIndex;
		}
		internal ShellObjectRenamedEventArgs(ChangeNotifyLock notifyLock)
			: base(notifyLock) {
			NewPath = notifyLock.ItemName2;
		}
		internal ShellObjectChangedEventArgs(ChangeNotifyLock notifyLock)
			: base(notifyLock) {
			Path = notifyLock.ItemName;
		}
		internal ShellObjectNotificationEventArgs(ChangeNotifyLock notifyLock) {
			ChangeType = notifyLock.ChangeType;
			FromSystemInterrupt = notifyLock.FromSystemInterrupt;
		}
Esempio n. 10
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);
		}