public virtual void Unschedule(NSRunLoop aRunLoop, string forMode) { if (aRunLoop == null) throw new ArgumentNullException ("aRunLoop"); if (forMode == null) throw new ArgumentNullException ("forMode"); var nsforMode = NSString.CreateNative (forMode); if (IsDirectBinding) { Messaging.void_objc_msgSend_IntPtr_IntPtr (this.Handle, selUnscheduleFromRunLoopForMode_, aRunLoop.Handle, nsforMode); } else { Messaging.void_objc_msgSendSuper_IntPtr_IntPtr (this.SuperHandle, selUnscheduleFromRunLoopForMode_, aRunLoop.Handle, nsforMode); } NSString.ReleaseNative (nsforMode); }
public virtual void Unschedule(NSRunLoop aRunLoop, string forMode) { if (aRunLoop == null) { throw new ArgumentNullException("aRunLoop"); } if (forMode == null) { throw new ArgumentNullException("forMode"); } var nsforMode = NSString.CreateNative(forMode); if (IsDirectBinding) { Messaging.void_objc_msgSend_IntPtr_IntPtr(this.Handle, selUnscheduleFromRunLoopForMode_, aRunLoop.Handle, nsforMode); } else { Messaging.void_objc_msgSendSuper_IntPtr_IntPtr(this.SuperHandle, selUnscheduleFromRunLoopForMode_, aRunLoop.Handle, nsforMode); } NSString.ReleaseNative(nsforMode); }
/// <summary> /// Initializes a new instance of the <see cref="CmisSync.Lib.Sync.Strategy.MacWatcher"/> class. /// </summary> /// <param name="pathname">Path to be monitored.</param> /// <param name="queue">Queue to pass the new events to.</param> /// <param name="latency">Maximum latency for file system events.</param> public MacWatcher(string pathname, ISyncEventQueue queue, TimeSpan latency) { if (string.IsNullOrEmpty(pathname)) { throw new ArgumentNullException("pathname", "The given fs stream must not be null"); } if (queue == null) { throw new ArgumentNullException("queue", "The given queue must not be null"); } this.Queue = queue; this.RunLoopThread = new Thread(() => { this.RunLoop = NSRunLoop.Current; while (!this.StopRunLoop) { this.RunLoop.RunUntil(NSDate.FromTimeIntervalSinceNow(1)); this.CleanLastRenameEvent(); } }); this.RunLoopThread.Start(); while (RunLoop == null) { Thread.Sleep(10); } this.FsStream = new FSEventStream(new [] { pathname }, latency, FSEventStreamCreateFlags.FileEvents); this.EnableEvents = false; this.FsStream.ScheduleWithRunLoop(this.RunLoop); }
public CMTimebaseError AddTimer (NSTimer timer, NSRunLoop runloop) { if (timer == null) throw new ArgumentNullException ("timer"); if (runloop == null) throw new ArgumentNullException ("runloop"); // FIXME: Crashes inside CoreMedia return CMTimebaseAddTimer (Handle, timer.Handle, runloop.Handle); }