FileSystemWatcher.WaitForChanged Método

Definição

Um método síncrono que retorna uma estrutura que contém informações específicas sobre a alteração ocorrida.A synchronous method that returns a structure that contains specific information on the change that occurred.

Sobrecargas

WaitForChanged(WatcherChangeTypes)

Um método síncrono que retorna uma estrutura que contém informações específicas sobre a alteração ocorrida, considerando o tipo de alteração que você deseja monitorar.A synchronous method that returns a structure that contains specific information on the change that occurred, given the type of change you want to monitor.

WaitForChanged(WatcherChangeTypes, Int32)

Um método síncrono que retorna uma estrutura que contém informações específicas sobre a alteração ocorrida, considerando o tipo de alteração que você deseja monitorar e o tempo (em milissegundos) de espera antes do tempo limite.A synchronous method that returns a structure that contains specific information on the change that occurred, given the type of change you want to monitor and the time (in milliseconds) to wait before timing out.

WaitForChanged(WatcherChangeTypes)

Um método síncrono que retorna uma estrutura que contém informações específicas sobre a alteração ocorrida, considerando o tipo de alteração que você deseja monitorar.A synchronous method that returns a structure that contains specific information on the change that occurred, given the type of change you want to monitor.

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

Parâmetros

changeType
WatcherChangeTypes

O WatcherChangeTypes a ser inspecionado.The WatcherChangeTypes to watch for.

Retornos

WaitForChangedResult

Um WaitForChangedResult que contém informações específicas sobre a alteração ocorrida.A WaitForChangedResult that contains specific information on the change that occurred.

Comentários

Esse método aguarda indefinidamente até que a primeira alteração ocorra e, em seguida, retorna.This method waits indefinitely until the first change occurs and then returns. Isso é o mesmo que usar WaitForChanged com o timeout parâmetro definido como-1.This is the same as using WaitForChanged with the timeout parameter set to -1.

Observação

Esse método permite que um manipulador de eventos seja invocado para responder a alterações de arquivo mesmo que a EnableRaisingEvents Propriedade esteja definida como false .This method allows an event handler to be invoked to respond to file changes even if the EnableRaisingEvents property is set to false.

Em alguns sistemas, o FileSystemWatcher relata alterações em arquivos usando o formato de nome de arquivo 8,3 curto.In some systems, FileSystemWatcher reports changes to files using the short 8.3 file name format. Por exemplo, uma alteração de "LongFileName. LongExtension" poderia ser relatada como "LongFi ~. Lon ".For example, a change to "LongFileName.LongExtension" could be reported as "LongFi~.Lon".

Confira também

Aplica-se a

WaitForChanged(WatcherChangeTypes, Int32)

Um método síncrono que retorna uma estrutura que contém informações específicas sobre a alteração ocorrida, considerando o tipo de alteração que você deseja monitorar e o tempo (em milissegundos) de espera antes do tempo limite.A synchronous method that returns a structure that contains specific information on the change that occurred, given the type of change you want to monitor and the time (in milliseconds) to wait before timing out.

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

Parâmetros

changeType
WatcherChangeTypes

O WatcherChangeTypes a ser inspecionado.The WatcherChangeTypes to watch for.

timeout
Int32

O tempo (em milissegundos) de espera antes do tempo limite.The time (in milliseconds) to wait before timing out.

Retornos

WaitForChangedResult

Um WaitForChangedResult que contém informações específicas sobre a alteração ocorrida.A WaitForChangedResult that contains specific information on the change that occurred.

Comentários

Esse método aguarda até que ocorra uma alteração ou tenha atingido o tempo limite. Um valor de-1 para o timeout parâmetro significa aguardar indefinidamente.This method waits until a change occurs or it has timed out. A value of -1 for the timeout parameter means wait indefinitely.

Observação

Esse método permite que um manipulador de eventos seja invocado para responder a alterações de arquivo mesmo que a EnableRaisingEvents Propriedade esteja definida como false .This method allows an event handler to be invoked to respond to file changes even if the EnableRaisingEvents property is set to false.

Em alguns sistemas, o FileSystemWatcher relata alterações em arquivos usando o formato de nome de arquivo 8,3 curto.In some systems, FileSystemWatcher reports changes to files using the short 8.3 file name format. Por exemplo, uma alteração de "LongFileName. LongExtension" poderia ser relatada como "LongFi ~. Lon ".For example, a change to "LongFileName.LongExtension" could be reported as "LongFi~.Lon".

Confira também

Aplica-se a