Beispiel #1
0
 public delegate void FuncO <T1>(out T1 arg1);    public static void LockedCall <T1>(string name, FuncO <T1> func, out T1 arg1)
 {
     while (true)
     {
         try { var mutex = new Mutex(false, name); mutex.WaitOne();            func(out arg1); mutex.ReleaseMutex(); } catch (AbandonedMutexException) { }
     }
 }
Beispiel #2
0
 public delegate U    FuncO <T1, U>(out T1 arg1);    public static U    LockedCall <T1, U>(string name, FuncO <T1, U> func, out T1 arg1)
 {
     while (true)
     {
         try { var mutex = new Mutex(false, name); mutex.WaitOne(); U result = func(out arg1); mutex.ReleaseMutex(); return(result); } catch (AbandonedMutexException) { }
     }
 }
 public BaseOutputProcessor(FuncO <string, T, bool> handler)
 {
     this.handler = handler;
 }
Beispiel #4
0
 /// <summary>
 /// The first input that the <paramref name="handler"/> returns true will be
 /// the result of this output processor, all other inputs will be ignored.
 /// </summary>
 /// <param name="handler"></param>
 public FirstResultOutputProcessor(FuncO <string, T, bool> handler = null)
     : base(handler)
 {
 }
 public BaseOutputListProcessor(FuncO <string, T, bool> handler) : base(handler)
 {
 }