private static extern SafeEventStreamHandle FSEventStreamCreate( IntPtr allocator, FSEventStreamCallback cb, IntPtr context, SafeCreateHandle pathsToWatch, FSEventStreamEventId sinceWhen, CFTimeInterval latency, FSEventStreamCreateFlags flags);
private static extern FSEventStreamRef FSEventStreamCreate( IntPtr allocator, FSEventStreamCallback cb, IntPtr context, CFArrayRef pathsToWatch, FSEventStreamEventId sinceWhen, CFTimeInterval latency, FSEventStreamCreateFlags flags);
private extern static IntPtr FSEventStreamCreate( IntPtr allocator, FSEventStreamCallback callback, IntPtr context, IntPtr pathsToWatch, ulong sinceWhen, double latency, FSEventStreamCreateFlags flags);
/// <summary> /// Creates a new EventStream to listen to events from the core OS (such as File System events). /// </summary> /// <param name="cb">A callback instance that will be called for every event batch.</param> /// <param name="pathsToWatch">A CFArray of the path(s) to watch for events.</param> /// <param name="sinceWhen"> /// The start point to receive events from. This can be to retrieve historical events or only new events. /// To get historical events, pass in the corresponding ID of the event you want to start from. /// To get only new events, pass in kFSEventStreamEventIdSinceNow. /// </param> /// <param name="latency">Coalescing period to wait before sending events.</param> /// <param name="flags">Flags to say what kind of events should be sent through this stream.</param> /// <returns>On success, returns a valid SafeCreateHandle to an FSEventStream object; otherwise, returns an invalid SafeCreateHandle</returns> internal static SafeEventStreamHandle FSEventStreamCreate( FSEventStreamCallback cb, SafeCreateHandle pathsToWatch, FSEventStreamEventId sinceWhen, CFTimeInterval latency, FSEventStreamCreateFlags flags) { return(FSEventStreamCreate(IntPtr.Zero, cb, IntPtr.Zero, pathsToWatch, sinceWhen, latency, flags)); }
/// <summary> /// Creates a new EventStream to listen to events from the core OS (such as File System events). /// </summary> /// <param name="cb">A callback instance that will be called for every event batch.</param> /// <param name="pathsToWatch">A CFArray of the path(s) to watch for events.</param> /// <param name="sinceWhen"> /// The start point to receive events from. This can be to retrieve historical events or only new events. /// To get historical events, pass in the corresponding ID of the event you want to start from. /// To get only new events, pass in kFSEventStreamEventIdSinceNow. /// </param> /// <param name="latency">Coalescing period to wait before sending events.</param> /// <param name="flags">Flags to say what kind of events should be sent through this stream.</param> /// <returns>On success, returns a pointer to an FSEventStream object; otherwise, returns IntPtr.Zero</returns> public static FSEventStreamRef FSEventStreamCreate( FSEventStreamCallback cb, CFArrayRef pathsToWatch, FSEventStreamEventId sinceWhen, CFTimeInterval latency, FSEventStreamCreateFlags flags) { return(FSEventStreamCreate(IntPtr.Zero, cb, IntPtr.Zero, pathsToWatch, sinceWhen, latency, flags)); }
public FSEventStream(CFAllocator allocator, NSArray pathsToWatch, ulong sinceWhenId, TimeSpan latency, FSEventStreamCreateFlags flags) { if (pathsToWatch == null) { throw new ArgumentNullException("pathsToWatch"); } eventsCallback = new FSEventStreamCallback(EventsCallback); handle = FSEventStreamCreate( allocator == null ? IntPtr.Zero : allocator.Handle, eventsCallback, IntPtr.Zero, pathsToWatch.Handle, sinceWhenId, latency.TotalSeconds, flags | (FSEventStreamCreateFlags)0x1 /* UseCFTypes */); if (handle == IntPtr.Zero) { throw new Exception("Unable to create FSEventStream"); } }
void FSEventStreamInit(CFAllocator allocator, ulong deviceToWatch, NSArray pathsToWatchRelativeToDevice, ulong sinceWhen, TimeSpan latency, FSEventStreamCreateFlags flags) { if (pathsToWatchRelativeToDevice == null) { throw new ArgumentNullException(nameof(pathsToWatchRelativeToDevice)); } eventsCallback = new FSEventStreamCallback(EventsCallback); handle = FSEventStreamCreateRelativeToDevice( allocator.GetHandle(), eventsCallback, IntPtr.Zero, deviceToWatch, pathsToWatchRelativeToDevice.GetHandle(), sinceWhen, latency.TotalSeconds, flags | (FSEventStreamCreateFlags)0x1); if (handle == IntPtr.Zero) { throw new InvalidOperationException("Unable to create FSEventStream"); } }
static extern IntPtr FSEventStreamCreate(IntPtr allocator, FSEventStreamCallback callback, IntPtr context, IntPtr pathsToWatch, ulong sinceWhen, double latency, FSEventStreamCreateFlags flags);
public FSEventStream(string [] pathsToWatch, TimeSpan latency, FSEventStreamCreateFlags flags) : this(null, NSArray.FromStrings(pathsToWatch), FSEvent.SinceNowId, latency, flags) { }
/// <summary> /// Creates a new EventStream to listen to events from the core OS (such as File System events). /// </summary> /// <param name="cb">A callback instance that will be called for every event batch.</param> /// <param name="pathsToWatch">A CFArray of the path(s) to watch for events.</param> /// <param name="sinceWhen"> /// The start point to receive events from. This can be to retrieve historical events or only new events. /// To get historical events, pass in the corresponding ID of the event you want to start from. /// To get only new events, pass in kFSEventStreamEventIdSinceNow. /// </param> /// <param name="latency">Coalescing period to wait before sending events.</param> /// <param name="flags">Flags to say what kind of events should be sent through this stream.</param> /// <returns>On success, returns a valid SafeCreateHandle to an FSEventStream object; otherwise, returns an invalid SafeCreateHandle</returns> internal static SafeEventStreamHandle FSEventStreamCreate( FSEventStreamCallback cb, SafeCreateHandle pathsToWatch, FSEventStreamEventId sinceWhen, CFTimeInterval latency, FSEventStreamCreateFlags flags) { return FSEventStreamCreate(IntPtr.Zero, cb, IntPtr.Zero, pathsToWatch, sinceWhen, latency, flags); }
static void RunTest(FSEventStreamCreateFlags createFlags) => new TestFSMonitor( Xamarin.Cache.CreateTemporaryDirectory(), createFlags, maxFilesToCreate: 256).Run();
public FSEventStream(string [] pathsToWatch, TimeSpan latency, FSEventStreamCreateFlags flags) : this(null, NSArray.FromStrings (pathsToWatch), FSEvent.SinceNowId, latency, flags) { }
public FSEventStream(CFAllocator allocator, NSArray pathsToWatch, ulong sinceWhenId, TimeSpan latency, FSEventStreamCreateFlags flags) { if (pathsToWatch == null) { throw new ArgumentNullException ("pathsToWatch"); } eventsCallback = new FSEventStreamCallback (EventsCallback); handle = FSEventStreamCreate ( allocator == null ? IntPtr.Zero : allocator.Handle, eventsCallback, IntPtr.Zero, pathsToWatch.Handle, sinceWhenId, latency.TotalSeconds, flags | (FSEventStreamCreateFlags)0x1 /* UseCFTypes */); if (handle == IntPtr.Zero) { throw new Exception ("Unable to create FSEventStream"); } }
public FSEventStream(ulong deviceToWatch, NSArray pathsToWatchRelativeToDevice, ulong sinceWhen, TimeSpan latency, FSEventStreamCreateFlags flags) => FSEventStreamInit(null, deviceToWatch, pathsToWatchRelativeToDevice, sinceWhen, latency, flags);
static extern IntPtr FSEventStreamCreateRelativeToDevice(IntPtr allocator, FSEventStreamCallback callback, IntPtr context, ulong deviceToWatch, IntPtr pathsToWatchRelativeToDevice, ulong sinceWhen, double latency, FSEventStreamCreateFlags flags);