void EventsCallback(IntPtr handle, IntPtr userData, nint numEvents, IntPtr eventPaths, IntPtr eventFlags, IntPtr eventIds) { if (numEvents == 0) { return; } var events = new FSEvent[numEvents]; var pathArray = new CFArray(eventPaths); for (int i = 0; i < events.Length; i++) { events[i].Flags = (FSEventStreamEventFlags)(uint)Marshal.ReadInt32(eventFlags, i * 4); events[i].Id = (uint)Marshal.ReadInt64(eventIds, i * 8); using (var cfstr = new CFString(pathArray.GetValue(i))) { events[i].Path = cfstr.ToString(); } } OnEvents(events); }
internal FSEventStreamEventsArgs(FSEvent [] events) { Events = events; }
void EventsCallback(IntPtr handle, IntPtr userData, nint numEvents, IntPtr eventPaths, IntPtr eventFlags, IntPtr eventIds) { if (numEvents == 0) { return; } var events = new FSEvent[numEvents]; var pathArray = new CFArray (eventPaths); for (int i = 0; i < events.Length; i++) { events[i].Flags = (FSEventStreamEventFlags)(uint)Marshal.ReadInt32 (eventFlags, i * 4); events[i].Id = (uint)Marshal.ReadInt64 (eventIds, i * 8); using (var cfstr = new CFString (pathArray.GetValue (i))) { events[i].Path = cfstr.ToString (); } } OnEvents (events); }
protected virtual void OnEvents(FSEvent [] events) { var handler = Events; if (handler != null) { handler (this, new FSEventStreamEventsArgs (events)); } }