1 //------------------------------------------------------------------------------
2 // <copyright file="FileSystemEventArgs.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //------------------------------------------------------------------------------
9 using System.Diagnostics;
10 using System.Security.Permissions;
15 /// <para>Provides data for the directory events: <see cref='System.IO.FileSystemWatcher.Changed'/>, <see cref='System.IO.FileSystemWatcher.Created'/>, <see cref='System.IO.FileSystemWatcher.Deleted'/>.</para>
17 public class FileSystemEventArgs : EventArgs {
18 private WatcherChangeTypes changeType;
20 private string fullPath;
23 /// <para>Initializes a new instance of the <see cref='System.IO.FileSystemEventArgs'/> class.</para>
25 public FileSystemEventArgs(WatcherChangeTypes changeType, string directory, string name)
27 this.changeType = changeType;
30 // Ensure that the directory name ends with a "\"
31 if (!directory.EndsWith("\\", StringComparison.Ordinal)) {
32 directory = directory + "\\";
35 this.fullPath = directory + name;
41 /// one of the <see cref='System.IO.WatcherChangeTypes'/>
45 public WatcherChangeTypes ChangeType {
55 /// fully qualifed path of the affected file or directory.
58 public string FullPath {
68 /// the name of the affected file or directory.