Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
262 lines (245 sloc) 14.9 KB
<Type Name="FileSystemEventArgs" FullName="System.IO.FileSystemEventArgs">
<TypeSignature Language="C#" Value="public class FileSystemEventArgs : EventArgs" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit FileSystemEventArgs extends System.EventArgs" />
<TypeSignature Language="DocId" Value="T:System.IO.FileSystemEventArgs" />
<TypeSignature Language="VB.NET" Value="Public Class FileSystemEventArgs&#xA;Inherits EventArgs" />
<TypeSignature Language="C++ CLI" Value="public ref class FileSystemEventArgs : EventArgs" />
<TypeSignature Language="F#" Value="type FileSystemEventArgs = class&#xA; inherit EventArgs" />
<AssemblyInfo>
<AssemblyName>System.IO.FileSystem.Watcher</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.EventArgs</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides data for the directory events: <see cref="E:System.IO.FileSystemWatcher.Changed" />, <see cref="E:System.IO.FileSystemWatcher.Created" />, <see cref="E:System.IO.FileSystemWatcher.Deleted" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.IO.FileSystemEventArgs> class is passed as a parameter to event handlers for these events:
The <xref:System.IO.FileSystemWatcher.Changed> event occurs when changes are made to the size, system attributes, last write time, last access time, or security permissions in a file or directory in the specified <xref:System.IO.FileSystemWatcher.Path%2A> of a <xref:System.IO.FileSystemWatcher>.
The <xref:System.IO.FileSystemWatcher.Created> event occurs when a file or directory in the specified <xref:System.IO.FileSystemWatcher.Path%2A> of a <xref:System.IO.FileSystemWatcher> is created.
The <xref:System.IO.FileSystemWatcher.Deleted> event occurs when a file or directory in the specified <xref:System.IO.FileSystemWatcher.Path%2A> of a <xref:System.IO.FileSystemWatcher> is deleted. For more information, see <xref:System.IO.FileSystemWatcher>.
## Examples
The following example shows how to create a <xref:System.IO.FileSystemWatcher> to monitor file changes (creates, deletes, renames, changes) occurring on a disk drive. The example also shows how to properly receive error notifications.
[!code-csharp[FileSystemWatcher#1](~/samples/snippets/csharp/VS_Snippets_CLR/FileSystemWatcher/cs/filesystemwatcher.cs#1)]
[!code-vb[FileSystemWatcher#1](~/samples/snippets/visualbasic/VS_Snippets_CLR/FileSystemWatcher/VB/FileSystemWatcher.vb#1)]
]]></format>
</remarks>
<altmember cref="E:System.IO.FileSystemWatcher.Changed" />
<altmember cref="E:System.IO.FileSystemWatcher.Created" />
<altmember cref="E:System.IO.FileSystemWatcher.Deleted" />
<altmember cref="T:System.IO.FileSystemEventHandler" />
<altmember cref="T:System.IO.FileSystemWatcher" />
<altmember cref="T:System.IO.InternalBufferOverflowException" />
<altmember cref="T:System.IO.NotifyFilters" />
<altmember cref="M:System.IO.FileSystemWatcher.OnCreated(System.IO.FileSystemEventArgs)" />
<altmember cref="M:System.IO.FileSystemWatcher.OnDeleted(System.IO.FileSystemEventArgs)" />
<altmember cref="P:System.IO.FileSystemWatcher.Path" />
<altmember cref="T:System.IO.RenamedEventArgs" />
<altmember cref="T:System.IO.RenamedEventHandler" />
<altmember cref="T:System.IO.WaitForChangedResult" />
<altmember cref="T:System.IO.WatcherChangeTypes" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public FileSystemEventArgs (System.IO.WatcherChangeTypes changeType, string directory, string name);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.IO.WatcherChangeTypes changeType, string directory, string name) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.FileSystemEventArgs.#ctor(System.IO.WatcherChangeTypes,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (changeType As WatcherChangeTypes, directory As String, name As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; FileSystemEventArgs(System::IO::WatcherChangeTypes changeType, System::String ^ directory, System::String ^ name);" />
<MemberSignature Language="F#" Value="new System.IO.FileSystemEventArgs : System.IO.WatcherChangeTypes * string * string -&gt; System.IO.FileSystemEventArgs" Usage="new System.IO.FileSystemEventArgs (changeType, directory, name)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.FileSystem.Watcher</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="changeType" Type="System.IO.WatcherChangeTypes" />
<Parameter Name="directory" Type="System.String" />
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="changeType">One of the <see cref="T:System.IO.WatcherChangeTypes" /> values, which represents the kind of change detected in the file system.</param>
<param name="directory">The root directory of the affected file or directory.</param>
<param name="name">The name of the affected file or directory.</param>
<summary>Initializes a new instance of the <see cref="T:System.IO.FileSystemEventArgs" /> class.</summary>
<remarks>To be added.</remarks>
<altmember cref="T:System.IO.FileSystemWatcher" />
<altmember cref="T:System.IO.WatcherChangeTypes" />
</Docs>
</Member>
<Member MemberName="ChangeType">
<MemberSignature Language="C#" Value="public System.IO.WatcherChangeTypes ChangeType { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.IO.WatcherChangeTypes ChangeType" />
<MemberSignature Language="DocId" Value="P:System.IO.FileSystemEventArgs.ChangeType" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ChangeType As WatcherChangeTypes" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::IO::WatcherChangeTypes ChangeType { System::IO::WatcherChangeTypes get(); };" />
<MemberSignature Language="F#" Value="member this.ChangeType : System.IO.WatcherChangeTypes" Usage="System.IO.FileSystemEventArgs.ChangeType" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.FileSystem.Watcher</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.IO.WatcherChangeTypes</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the type of directory event that occurred.</summary>
<value>One of the <see cref="T:System.IO.WatcherChangeTypes" /> values that represents the kind of change detected in the file system.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example demonstrates the <xref:System.IO.FileSystemEventArgs.ChangeType%2A> property. This code example is part of a larger example provided for the <xref:System.IO.FileSystemEventArgs> class.
[!code-csharp[FileSystemWatcher#7](~/samples/snippets/csharp/VS_Snippets_CLR/FileSystemWatcher/cs/filesystemwatcher.cs#7)]
[!code-vb[FileSystemWatcher#7](~/samples/snippets/visualbasic/VS_Snippets_CLR/FileSystemWatcher/VB/FileSystemWatcher.vb#7)]
]]></format>
</remarks>
<altmember cref="T:System.IO.WatcherChangeTypes" />
</Docs>
</Member>
<Member MemberName="FullPath">
<MemberSignature Language="C#" Value="public string FullPath { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string FullPath" />
<MemberSignature Language="DocId" Value="P:System.IO.FileSystemEventArgs.FullPath" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property FullPath As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ FullPath { System::String ^ get(); };" />
<MemberSignature Language="F#" Value="member this.FullPath : string" Usage="System.IO.FileSystemEventArgs.FullPath" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.FileSystem.Watcher</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the fully qualified path of the affected file or directory.</summary>
<value>The path of the affected file or directory.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example demonstrates the <xref:System.IO.FileSystemEventArgs.FullPath%2A> property. This code example is part of a larger example provided for the <xref:System.IO.FileSystemEventArgs> class.
[!code-csharp[FileSystemWatcher#7](~/samples/snippets/csharp/VS_Snippets_CLR/FileSystemWatcher/cs/filesystemwatcher.cs#7)]
[!code-vb[FileSystemWatcher#7](~/samples/snippets/visualbasic/VS_Snippets_CLR/FileSystemWatcher/VB/FileSystemWatcher.vb#7)]
]]></format>
</remarks>
<permission cref="T:System.Security.Permissions.FileIOPermission">for reading files. Associated enumeration: <see cref="F:System.Security.Permissions.FileIOPermissionAccess.Read" /></permission>
</Docs>
</Member>
<Member MemberName="Name">
<MemberSignature Language="C#" Value="public string Name { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Name" />
<MemberSignature Language="DocId" Value="P:System.IO.FileSystemEventArgs.Name" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Name As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Name { System::String ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Name : string" Usage="System.IO.FileSystemEventArgs.Name" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.FileSystem.Watcher</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the name of the affected file or directory.</summary>
<value>The name of the affected file or directory.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The name returned by the <xref:System.IO.FileSystemEventArgs.Name%2A> property is the relative path of the affected file or directory, with respect to the directory being watched. For example, if a <xref:System.IO.FileSystemWatcher> object is watching the directory "C:\temp" and the file at "C:\temp\test\file.txt" changes, the <xref:System.IO.FileSystemEventArgs.Name%2A> property will return "test\file.txt".
The <xref:System.IO.FileSystemEventArgs.Name%2A> property may be null for renamed events if the <xref:System.IO.FileSystemWatcher> does not get matching old and new name events from the OS.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.