public WatcherExecutionResult(IWatcher watcher, WatcherResultState currentState, WatcherResultState previousState, IWardenCheckResult wardenCheckResult, Exception exception = null) { Watcher = watcher; CurrentState = currentState; PreviousState = previousState; WardenCheckResult = wardenCheckResult; Exception = exception; }
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(); }
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(); }