private IEnumerable <EdmError> ComputeErrors() { bool?value; if (!EdmValueParser.TryParseBool(this.expression.Value, out value)) { return(new EdmError[] { new EdmError(this.Location, EdmErrorCode.InvalidBoolean, Edm.Strings.ValueParser_InvalidBoolean(this.expression.Value)) }); } return(Enumerable.Empty <EdmError>()); }
private bool ComputeValue() { bool?nullable; if (EdmValueParser.TryParseBool(this.expression.Value, out nullable)) { return(nullable.Value); } else { return(false); } }
private IEnumerable <EdmError> ComputeErrors() { bool?nullable; if (EdmValueParser.TryParseBool(this.expression.Value, out nullable)) { return(Enumerable.Empty <EdmError>()); } else { EdmError[] edmError = new EdmError[1]; edmError[0] = new EdmError(base.Location, EdmErrorCode.InvalidBoolean, Strings.ValueParser_InvalidBoolean(this.expression.Value)); return(edmError); } }
protected bool?OptionalBoolean(string attributeName) { XmlAttributeInfo attr = GetOptionalAttribute(this.currentElement, attributeName); if (!attr.IsMissing) { bool?value; if (!EdmValueParser.TryParseBool(attr.Value, out value)) { this.ReportError(this.currentElement.Location, EdmErrorCode.InvalidBoolean, Edm.Strings.ValueParser_InvalidBoolean(attr.Value)); } return(value); } return(null); }
protected bool?OptionalBoolean(string attributeName) { bool? nullable; XmlAttributeInfo optionalAttribute = this.GetOptionalAttribute(this.currentElement, attributeName); if (optionalAttribute.IsMissing) { bool?nullable1 = null; return(nullable1); } else { if (!EdmValueParser.TryParseBool(optionalAttribute.Value, out nullable)) { base.ReportError(this.currentElement.Location, EdmErrorCode.InvalidBoolean, Strings.ValueParser_InvalidBoolean(optionalAttribute.Value)); } return(nullable); } }
private bool ComputeValue() { bool?local; return(EdmValueParser.TryParseBool(this.expression.Value, out local) ? local.Value : false); }