private void ValidateAndSet(bool value) { if (!IsValid(value)) { throw new ArgumentException("Invalid variable value."); } else { this.value = value; } }