Class ShellObjectWatcher
- Namespace
- Microsoft.WindowsAPICodePack.Shell
- Assembly
- Microsoft.WindowsAPICodePack.Shell.dll
Listens for changes in/on a ShellObject and raises events when they occur. This class supports all items under the shell namespace including files, folders and virtual folders (libraries, search results and network items), etc.
public class ShellObjectWatcher : IDisposable
- Inheritance
-
ShellObjectWatcher
- Implements
- Inherited Members
Constructors
ShellObjectWatcher(ShellObject, bool)
Creates the ShellObjectWatcher for the given ShellObject
public ShellObjectWatcher(ShellObject shellObject, bool recursive)
Parameters
shellObject
ShellObjectThe ShellObject to monitor
recursive
boolWhether to listen for changes recursively (for when monitoring a container)
Properties
Running
Gets whether the watcher is currently running.
public bool Running { get; }
Property Value
Methods
Dispose()
Disposes ShellObjectWatcher.
public void Dispose()
Dispose(bool)
Disposes ShellObjectWatcher
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
~ShellObjectWatcher()
Finalizer for ShellObjectWatcher
protected ~ShellObjectWatcher()
ProcessChangeNotificationEvent(WindowMessageEventArgs)
Processes all change notifications sent by the Windows Shell.
protected virtual void ProcessChangeNotificationEvent(WindowMessageEventArgs e)
Parameters
e
WindowMessageEventArgsThe windows message representing the notification event
Start()
Start the watcher and begin receiving change notifications.
public void Start()
Stop()
Stop the watcher and prevent further notifications from being received.
public void Stop()
Events
AllEvents
Raised when any event occurs.
public event EventHandler<ShellObjectNotificationEventArgs> AllEvents
Event Type
DirectoryCreated
Raised when a directory is created.
public event EventHandler<ShellObjectChangedEventArgs> DirectoryCreated
Event Type
DirectoryDeleted
Raised when a directory is deleted.
public event EventHandler<ShellObjectChangedEventArgs> DirectoryDeleted
Event Type
DirectoryRenamed
Raised when a directory is renamed.
public event EventHandler<ShellObjectRenamedEventArgs> DirectoryRenamed
Event Type
DirectoryUpdated
Raised when a directory is updated.
public event EventHandler<ShellObjectChangedEventArgs> DirectoryUpdated
Event Type
DiskEvents
Raised when disk events occur.
public event EventHandler<ShellObjectNotificationEventArgs> DiskEvents
Event Type
DriveAdded
Raised when a drive is added.
public event EventHandler<ShellObjectChangedEventArgs> DriveAdded
Event Type
DriveRemoved
Raised when a drive is removed.
public event EventHandler<ShellObjectChangedEventArgs> DriveRemoved
Event Type
FileTypeAssociationChanged
Raised when a file type association changes.
public event EventHandler<ShellObjectChangedEventArgs> FileTypeAssociationChanged
Event Type
FolderNetworkShared
Raised when a folder is shared on a network.
public event EventHandler<ShellObjectChangedEventArgs> FolderNetworkShared
Event Type
FolderNetworkUnshared
Raised when a folder is unshared from the network.
public event EventHandler<ShellObjectChangedEventArgs> FolderNetworkUnshared
Event Type
FreeSpaceChanged
Raised when free space changes.
public event EventHandler<ShellObjectChangedEventArgs> FreeSpaceChanged
Event Type
GlobalEvents
Raised when global events occur.
public event EventHandler<ShellObjectNotificationEventArgs> GlobalEvents
Event Type
ItemCreated
Raised when an item is created.
public event EventHandler<ShellObjectChangedEventArgs> ItemCreated
Event Type
ItemDeleted
Raised when an item is deleted.
public event EventHandler<ShellObjectChangedEventArgs> ItemDeleted
Event Type
ItemRenamed
Raised when an item is renamed.
public event EventHandler<ShellObjectRenamedEventArgs> ItemRenamed
Event Type
MediaInserted
Raised when media is inserted.
public event EventHandler<ShellObjectChangedEventArgs> MediaInserted
Event Type
MediaRemoved
Raised when media is removed.
public event EventHandler<ShellObjectChangedEventArgs> MediaRemoved
Event Type
ServerDisconnected
Raised when a server is disconnected.
public event EventHandler<ShellObjectChangedEventArgs> ServerDisconnected
Event Type
SystemImageChanged
Raised when a system image is changed.
public event EventHandler<ShellObjectChangedEventArgs> SystemImageChanged
Event Type
Updated
Raised when an item is updated.
public event EventHandler<ShellObjectChangedEventArgs> Updated