Example #1
0
 public static IDisposable SetupPressEnterToMoveFocus([NotNull] this TextBox textBox)
 {
     textBox.KeyDown += TextBox_OnKeyDown;
     return(Disposables.For(() => textBox.KeyDown -= TextBox_OnKeyDown));
 }
Example #2
0
 public static IDisposable AcquireWriteLock(this ReaderWriterLockSlim @lock)
 {
     @lock.EnterWriteLock();
     return(Disposables.For(@lock.ExitWriteLock));
 }