FileSystemWatcher.SynchronizingObject 속성

정의

디렉터리를 변경한 결과로 발생되는 이벤트 처리기 호출을 마샬링하는 데 사용되는 개체를 가져오거나 설정합니다.

public:
 property System::ComponentModel::ISynchronizeInvoke ^ SynchronizingObject { System::ComponentModel::ISynchronizeInvoke ^ get(); void set(System::ComponentModel::ISynchronizeInvoke ^ value); };
public System.ComponentModel.ISynchronizeInvoke? SynchronizingObject { get; set; }
public System.ComponentModel.ISynchronizeInvoke SynchronizingObject { get; set; }
[System.IO.IODescription("FSW_SynchronizingObject")]
public System.ComponentModel.ISynchronizeInvoke SynchronizingObject { get; set; }
[System.IO.IODescription("FSW_SynchronizingObject")]
[System.ComponentModel.Browsable(false)]
public System.ComponentModel.ISynchronizeInvoke SynchronizingObject { get; set; }
[System.ComponentModel.Browsable(false)]
public System.ComponentModel.ISynchronizeInvoke SynchronizingObject { get; set; }
member this.SynchronizingObject : System.ComponentModel.ISynchronizeInvoke with get, set
[<System.IO.IODescription("FSW_SynchronizingObject")>]
member this.SynchronizingObject : System.ComponentModel.ISynchronizeInvoke with get, set
[<System.IO.IODescription("FSW_SynchronizingObject")>]
[<System.ComponentModel.Browsable(false)>]
member this.SynchronizingObject : System.ComponentModel.ISynchronizeInvoke with get, set
[<System.ComponentModel.Browsable(false)>]
member this.SynchronizingObject : System.ComponentModel.ISynchronizeInvoke with get, set
Public Property SynchronizingObject As ISynchronizeInvoke

속성 값

디렉터리를 변경한 결과로 발생되는 이벤트 처리기 호출을 마샬링하는 데 사용되는 개체를 나타내는 ISynchronizeInvoke입니다. 기본값은 null입니다.

특성

설명

가 이nullSynchronizingObject 시스템 스레드 풀의 Changed스레드에서 , Created, DeletedRenamed 이벤트를 처리하는 메서드가 호출됩니다. 시스템 스레드 풀에 대한 자세한 내용은 를 참조하세요 ThreadPool.

Changed, Created, DeletedRenamed 이벤트가 와 같은 Button시각적 Windows Forms 구성 요소에 의해 처리되는 경우 시스템 스레드 풀을 통해 구성 요소에 액세스하는 것이 작동하지 않거나 예외가 발생할 수 있습니다. 구성 요소를 만든 동일한 스레드에서 , , CreatedDeletedRenamed 이벤트를 처리하는 Changed메서드를 호출하는 Windows Forms 구성 요소로 설정 SynchronizingObject 하여 이를 방지합니다.

FileSystemWatcher 가 Windows Forms 디자이너 SynchronizingObject 의 Visual Studio 2005 내에서 사용되는 경우 가 포함된 FileSystemWatcher컨트롤로 자동으로 설정합니다. 예를 들어 를 Form1의 디자이너에 배치 FileSystemWatcher 하는 경우(에서 Form상속됨) SynchronizingObjectFileSystemWatcher 속성은 Form1의 instance 설정됩니다.

적용 대상

추가 정보