예제 #1
0
 public WatcherExecutionResult(IWatcher watcher, WatcherResultState currentState,
                               WatcherResultState previousState, IWardenCheckResult wardenCheckResult,
                               Exception exception = null)
 {
     Watcher           = watcher;
     CurrentState      = currentState;
     PreviousState     = previousState;
     WardenCheckResult = wardenCheckResult;
     Exception         = exception;
 }
예제 #2
0
        private async Task UpdateWatcherResultStateAndExecuteHooksPossibleAsync(IWatcher watcher,
                                                                                WatcherResultState state, Func <Task> hooks, bool executeIfLatestStateIsNotSet = true)
        {
            var previousState = GetPreviousWatcherState(watcher);

            if (previousState == state)
            {
                return;
            }

            if (previousState == WatcherResultState.NotSet && !executeIfLatestStateIsNotSet)
            {
                return;
            }

            _latestWatcherResultStates[watcher] = state;
            await hooks();
        }
예제 #3
0
        private async Task UpdateWatcherResultStateAndExecuteHooksPossibleAsync(IWatcher watcher,
            WatcherResultState state, Func<Task> hooks, bool executeIfLatestStateIsNotSet = true)
        {
            var previousState = GetPreviousWatcherState(watcher);
            if (previousState == state)
                return;

            if (previousState == WatcherResultState.NotSet && !executeIfLatestStateIsNotSet)
                return;

            _latestWatcherResultStates[watcher] = state;
            await hooks();
        }
예제 #4
0
 public WatcherExecutionResult(IWatcher watcher, WatcherResultState currentState,
     WatcherResultState previousState, IWardenCheckResult wardenCheckResult, 
     Exception exception = null)
 {
     Watcher = watcher;
     CurrentState = currentState;
     PreviousState = previousState;
     WardenCheckResult = wardenCheckResult;
     Exception = exception;
 }