protected void Validate(CBoolean cBoolean) { this.ValidateBase((CPrimitive)cBoolean); Invariant(cBoolean.TrueValid || cBoolean.FalseValid, CommonStrings.CBooleanInvariant); Invariant(((bool)(cBoolean.DefaultValue) && cBoolean.TrueValid) || (!((bool)(cBoolean.DefaultValue)) && cBoolean.FalseValid), CommonStrings.CBooleanDefaultInvalid); }
private static CBoolean Map(this C_BOOLEAN model) { var primitive = new CBoolean { IsFalseValid = model.false_valid, IsTrueValid = model.true_valid }; if (model.assumed_value.HasValue) { primitive.AssumedValue = model.assumed_value.Value; } return(primitive); }
internal static OpenEhr.AM.Archetype.ConstraintModel.Primitive.CPrimitive CPrimitive(string typeName) { DesignByContract.Check.Require(!string.IsNullOrEmpty(typeName), string.Format(CommonStrings.XMustNotBeNullOrEmpty, "typeName")); OpenEhr.AM.Archetype.ConstraintModel.Primitive.CPrimitive cPrimitive = null; switch (typeName) { case "C_BOOLEAN": cPrimitive = new CBoolean(); break; case "C_DATE": cPrimitive = new CDate(); break; case "C_DATE_TIME": cPrimitive = new CDateTime(); break; case "C_DURATION": cPrimitive = new CDuration(); break; case "C_TIME": cPrimitive = new CTime(); break; case "C_INTEGER": cPrimitive = new CInteger(); break; case "C_REAL": cPrimitive = new CReal(); break; case "C_STRING": cPrimitive = new CString(); break; default: throw new NotSupportedException("type not supported: " + typeName); } DesignByContract.Check.Ensure(cPrimitive != null, "cObject must not be null."); return(cPrimitive); }
public void AddInputOutputParameter(String name, CBoolean value) { _parameters.Add(new Parameter(name, value, ParameterDirection.InputOutput)); }
public Environment() { Output = new Output(); EmptyArgs = new SArgs(this); True = new LBoolean(this, true); False = new LBoolean(this, false); Undefined = new LUndefined(this); Null = new LNull(this); GlobalObject = new BGlobal(this); GlobalEnvironment = new SLexicalEnvironment(this, new SObjectEnvironmentRecord(this, GlobalObject, false), null); MathObject = new BMath(this); JsonObject = new BJson(this); ObjectConstructor = new CObject(this); FunctionConstructor = new CFunction(this); ArrayConstructor = new CArray(this); StringConstructor = new CString(this); BooleanConstructor = new CBoolean(this); NumberConstructor = new CNumber(this); DateConstructor = new CDate(this); RegExpConstructor = new CRegExp(this); ErrorConstructor = new CError(this); EvalErrorConstructor = new CEvalError(this); RangeErrorConstructor = new CRangeError(this); ReferenceErrorConstructor = new CReferenceError(this); SyntaxErrorConstructor = new CSyntaxError(this); TypeErrorConstructor = new CTypeError(this); UriErrorConstructor = new CUriError(this); ObjectPrototype = new PObject(this); FunctionPrototype = new PFunction(this); ArrayPrototype = new PArray(this); StringPrototype = new PString(this); BooleanPrototype = new PBoolean(this); NumberPrototype = new PNumber(this); DatePrototype = new PDate(this); RegExpPrototype = new PRegExp(this); ErrorPrototype = new PError(this); EvalErrorPrototype = new PEvalError(this); RangeErrorPrototype = new PRangeError(this); ReferenceErrorPrototype = new PReferenceError(this); SyntaxErrorPrototype = new PSyntaxError(this); TypeErrorPrototype = new PTypeError(this); UriErrorPrototype = new PUriError(this); GlobalObject.Initialize(); MathObject.Initialize(); JsonObject.Initialize(); ObjectConstructor.Initialize(); FunctionConstructor.Initialize(); ArrayConstructor.Initialize(); StringConstructor.Initialize(); BooleanConstructor.Initialize(); NumberConstructor.Initialize(); DateConstructor.Initialize(); RegExpConstructor.Initialize(); ErrorConstructor.Initialize(); EvalErrorConstructor.Initialize(); RangeErrorConstructor.Initialize(); ReferenceErrorConstructor.Initialize(); SyntaxErrorConstructor.Initialize(); TypeErrorConstructor.Initialize(); UriErrorConstructor.Initialize(); ObjectPrototype.Initialize(); FunctionPrototype.Initialize(); ArrayPrototype.Initialize(); StringPrototype.Initialize(); BooleanPrototype.Initialize(); NumberPrototype.Initialize(); DatePrototype.Initialize(); RegExpPrototype.Initialize(); ErrorPrototype.Initialize(); EvalErrorPrototype.Initialize(); RangeErrorPrototype.Initialize(); ReferenceErrorPrototype.Initialize(); SyntaxErrorPrototype.Initialize(); TypeErrorPrototype.Initialize(); UriErrorPrototype.Initialize(); }
public void IsValidValueThrowsException() { var instance = new CBoolean(); instance.IsValidValue(false); }