다음을 통해 공유


DispatchSource.VnodeMonitor 클래스

정의

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

public class DispatchSource.VnodeMonitor : CoreFoundation.DispatchSource
type DispatchSource.VnodeMonitor = class
    inherit DispatchSource
상속
DispatchSource.VnodeMonitor
상속
DispatchSource.VnodeMonitor

설명

var stream = File.Create ("Demo.txt");

// Get the underlying Unix file descriptor
var safeHandle = stream.SafeFileHandle;
IntPtr descriptor = safeHandle.DangerousGetHandle ();
int fileDescriptor = descriptor.ToInt32 ();

var dispatchSource = new DispatchSource.VnodeMonitor (
    fileDescriptor,
    VnodeMonitorKind.Delete | VnodeMonitorKind.Extend | VnodeMonitorKind.Write,
    DispatchQueue.MainQueue
);

dispatchSource.SetRegistrationHandler (() => {
    Console.WriteLine ("Vnode monitor registered");
});

dispatchSource.SetEventHandler (() => {
    var observedEvents = dispatchSource.ObservedEvents;
    Console.WriteLine ("Vnode monitor event for file: {0}", observedEvents);
    dispatchSource.Cancel ();
    stream.Close ();
});

dispatchSource.SetCancelHandler (() => {
    Console.WriteLine (textView, "Vnode monitor cancelled");
});

dispatchSource.Resume ();

생성자

DispatchSource.VnodeMonitor(Int32, VnodeMonitorKind, DispatchQueue)

지정된 파일 설명자에 대한 VNode 모니터를 만들어 지정된 이벤트 집합을 모니터링합니다.

DispatchSource.VnodeMonitor(IntPtr)

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

DispatchSource.VnodeMonitor(IntPtr, Boolean)

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

DispatchSource.VnodeMonitor(String, VnodeMonitorKind, DispatchQueue)

지정된 파일 경로에 대한 VNode 모니터를 만들어 지정된 이벤트 집합을 모니터링합니다.

속성

FileDescriptor

모니터링 중인 파일 설명자

Handle

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

(다음에서 상속됨 DispatchObject)
IsCanceled

지정된 원본이 취소되었는지 여부를 확인합니다.

(다음에서 상속됨 DispatchSource)
ObservedEvents

파일에서 관찰된 이벤트입니다.

메서드

Activate()

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

(다음에서 상속됨 DispatchObject)
Cancel()

디스패치 원본을 비동기적으로 취소합니다.

(다음에서 상속됨 DispatchSource)
Check()
사용되지 않음.

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

(다음에서 상속됨 DispatchObject)
Dispose()

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

(다음에서 상속됨 DispatchObject)
Dispose(Boolean)

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

Equals(Object)

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

(다음에서 상속됨 DispatchObject)
GetHashCode()

이 개체의 해시코드를 반환합니다.

(다음에서 상속됨 DispatchObject)
InitializeHandle(IntPtr)

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

(다음에서 상속됨 NativeObject)
Release()

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

(다음에서 상속됨 DispatchObject)
Resume()

디스패치 원본을 다시 시작합니다.

(다음에서 상속됨 DispatchSource)
Retain()

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

(다음에서 상속됨 DispatchObject)
SetCancelHandler(Action)

취소 처리기를 제공합니다.

(다음에서 상속됨 DispatchSource)
SetEventHandler(Action)

디스패치 원본에서 이벤트가 수신될 때 실행할 처리기를 지정했습니다.

(다음에서 상속됨 DispatchSource)
SetRegistrationHandler(Action)

등록 처리기를 제공합니다.

(다음에서 상속됨 DispatchSource)
SetTargetQueue(DispatchQueue)

이 유형의 원본은 상태 변경에 대한 가상 파일 시스템 노드를 모니터링합니다.

(다음에서 상속됨 DispatchObject)
Suspend()

디스패치 원본을 일시 중단합니다.

(다음에서 상속됨 DispatchSource)

적용 대상