/// <summary> /// Process to check watcher and evaluate what happens based on evaluation. /// </summary> public override void CheckProcess() { bool isOk = true; // Check. isOk = isOk ? (InternetConnection.IsSelected ? InternetConnection.Check() : true) : false; isOk = isOk ? (ProcessConnection.IsSelected ? ProcessConnection.Check() : true) : false; // Failure hook. if (!isOk && !mIsFailureRoutineFired) { mIsFailureRoutineFired = true; // Let know the procedure to do not fire this the same event again until the failure disappear. FailureRoutine.Do(); } // First occurance of recovery from failure. else if (isOk && mIsFailureRoutineFired) { mIsFailureRoutineFired = false; // Reset value back to false to be able to record failure event again when occurs. } }