/// <summary> /// Fires all associated FileChanged delegates. /// </summary> public void OnChanged(object sender, FileSystemEventArgs e) { foreach (FileSystemEventHandler handler in FileChanged.GetInvocationList()) { handler.Invoke(sender, e); } }
public void Dispose() { if (!IsDisposed) { IsDisposed = true; foreach (var item in FileDeleted.GetInvocationList()) { FileDeleted -= item as Action; } foreach (var item in FileChanged.GetInvocationList()) { FileChanged -= item as Action; } if (fileSystemWatcher != null) { fileSystemWatcher.Dispose(); fileSystemWatcher = null; } } }