コード例 #1
0
ファイル: Semaphore.cs プロジェクト: k10czar/K10
    public static void BlockOn(this ISemaphoreInterection semaphore, IBoolStateObserver source, IEventValidator eventValidation)
    {
        Action releaseAction = () => semaphore.Release(source);

        source.RegisterOnTrue(new ConditionalEventListener(() => semaphore.Block(source), eventValidation.CurrentValidationCheck));
        source.RegisterOnFalse(new ConditionalEventListener(releaseAction, eventValidation.CurrentValidationCheck));

        eventValidation.OnVoid.Register(new CallOnce(releaseAction));
    }
コード例 #2
0
ファイル: Semaphore.cs プロジェクト: k10czar/K10
 public static void BlockOn(this ISemaphoreInterection semaphore, IBoolStateObserver source, Func <bool> eventValidation)
 {
     source.RegisterOnTrue(new ConditionalEventListener(() => semaphore.Block(source), eventValidation));
     source.RegisterOnFalse(new ConditionalEventListener(() => semaphore.Release(source), eventValidation));
 }
コード例 #3
0
ファイル: Semaphore.cs プロジェクト: k10czar/K10
 public void ReleaseOn(IBoolStateObserver source, Func <bool> eventValidation)
 {
     source.RegisterOnTrue(new ConditionalEventListener(() => Release(source), eventValidation));
     source.RegisterOnFalse(new ConditionalEventListener(() => Block(source), eventValidation));
 }
コード例 #4
0
ファイル: Semaphore.cs プロジェクト: k10czar/K10
 public static void BlockOn(this ISemaphoreInterection semaphore, IBoolStateObserver source)
 {
     source.RegisterOnTrue(() => semaphore.Block(source));
     source.RegisterOnFalse(() => semaphore.Release(source));
 }
コード例 #5
0
ファイル: Semaphore.cs プロジェクト: k10czar/K10
 public void ReleaseOn(IBoolStateObserver source)
 {
     source.RegisterOnTrue(() => Release(source));
     source.RegisterOnFalse(() => Block(source));
 }