FileSystemWatcher.WaitForChanged Metodo

Definizione

Metodo sincrono che restituisce una struttura contenente informazioni specifiche sulla modifica effettuata.

Overload

WaitForChanged(WatcherChangeTypes)

Metodo sincrono che restituisce una struttura contenente informazioni specifiche sulle modifica effettuata, una volta definito il tipo di modifica da monitorare.

WaitForChanged(WatcherChangeTypes, Int32)

Metodo sincrono che restituisce una struttura contenente informazioni specifiche sulle modifica effettuata, una volta definiti il tipo di modifica da monitorare e il tempo di attesa espresso in millisecondi prima del timeout.

WaitForChanged(WatcherChangeTypes, TimeSpan)

Restituisce in modo sincrono una struttura che contiene informazioni specifiche sulla modifica che si è verificata, dato il tipo di modifica da monitorare.

WaitForChanged(WatcherChangeTypes)

Origine:
FileSystemWatcher.cs
Origine:
FileSystemWatcher.cs
Origine:
FileSystemWatcher.cs

Metodo sincrono che restituisce una struttura contenente informazioni specifiche sulle modifica effettuata, una volta definito il tipo di modifica da monitorare.

public:
 System::IO::WaitForChangedResult WaitForChanged(System::IO::WatcherChangeTypes changeType);
public System.IO.WaitForChangedResult WaitForChanged (System.IO.WatcherChangeTypes changeType);
member this.WaitForChanged : System.IO.WatcherChangeTypes -> System.IO.WaitForChangedResult
Public Function WaitForChanged (changeType As WatcherChangeTypes) As WaitForChangedResult

Parametri

changeType
WatcherChangeTypes

Oggetto WatcherChangeTypes da controllare.

Restituisce

Oggetto WaitForChangedResult che contiene informazioni specifiche sulle modifiche effettuate.

Commenti

Questo metodo attende in modo indefinito fino a quando la prima modifica si verifica e quindi restituisce. Si tratta dello stesso utilizzo WaitForChanged con il timeout parametro impostato su -1.

Nota

Questo metodo consente a un gestore eventi di rispondere alle modifiche dei file anche se la EnableRaisingEvents proprietà è impostata su false.

In alcuni sistemi, FileSystemWatcher segnala le modifiche ai file usando il formato di nome file 8.3 breve. Ad esempio, una modifica a "LongFileName.LongExtension" potrebbe essere segnalata come "LongFi~. Lon".

Vedi anche

Si applica a

WaitForChanged(WatcherChangeTypes, Int32)

Origine:
FileSystemWatcher.cs
Origine:
FileSystemWatcher.cs
Origine:
FileSystemWatcher.cs

Metodo sincrono che restituisce una struttura contenente informazioni specifiche sulle modifica effettuata, una volta definiti il tipo di modifica da monitorare e il tempo di attesa espresso in millisecondi prima del timeout.

public:
 System::IO::WaitForChangedResult WaitForChanged(System::IO::WatcherChangeTypes changeType, int timeout);
public System.IO.WaitForChangedResult WaitForChanged (System.IO.WatcherChangeTypes changeType, int timeout);
member this.WaitForChanged : System.IO.WatcherChangeTypes * int -> System.IO.WaitForChangedResult
Public Function WaitForChanged (changeType As WatcherChangeTypes, timeout As Integer) As WaitForChangedResult

Parametri

changeType
WatcherChangeTypes

Oggetto WatcherChangeTypes da controllare.

timeout
Int32

Tempo di attesa espresso in millisecondi prima del timeout.

Restituisce

Oggetto WaitForChangedResult che contiene informazioni specifiche sulle modifiche effettuate.

Commenti

Questo metodo attende fino a quando non si verifica una modifica o il timeout. Un valore di -1 per il timeout parametro significa attendere in modo indefinito.

Nota

Questo metodo consente a un gestore eventi di rispondere alle modifiche dei file anche se la EnableRaisingEvents proprietà è impostata su false.

In alcuni sistemi, FileSystemWatcher segnala le modifiche ai file usando il formato di nome file 8.3 breve. Ad esempio, una modifica a "LongFileName.LongExtension" potrebbe essere segnalata come "LongFi~. Lon".

Vedi anche

Si applica a

WaitForChanged(WatcherChangeTypes, TimeSpan)

Origine:
FileSystemWatcher.cs
Origine:
FileSystemWatcher.cs
Origine:
FileSystemWatcher.cs

Restituisce in modo sincrono una struttura che contiene informazioni specifiche sulla modifica che si è verificata, dato il tipo di modifica da monitorare.

public:
 System::IO::WaitForChangedResult WaitForChanged(System::IO::WatcherChangeTypes changeType, TimeSpan timeout);
public System.IO.WaitForChangedResult WaitForChanged (System.IO.WatcherChangeTypes changeType, TimeSpan timeout);
member this.WaitForChanged : System.IO.WatcherChangeTypes * TimeSpan -> System.IO.WaitForChangedResult
Public Function WaitForChanged (changeType As WatcherChangeTypes, timeout As TimeSpan) As WaitForChangedResult

Parametri

changeType
WatcherChangeTypes

Oggetto WatcherChangeTypes da controllare.

timeout
TimeSpan

Tempo di attesa prima del timeout.

Restituisce

Oggetto WaitForChangedResult che contiene informazioni specifiche sulle modifiche effettuate.

Commenti

Vedere WaitForChanged(WatcherChangeTypes, Int32) le osservazioni.

Si applica a