static public ToBoolean ( string value ) : bool | ||
value | string | |
return | bool |
static public bool ToBoolean(string value)
{
try
{
return XmlConvert.ToBoolean(value);
}
catch (ArgumentException exception)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value, "Boolean", exception));
}
catch (FormatException exception)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(value, "Boolean", exception));
}
}
XmlConverter::ToBoolean ( byte buffer, int offset, int count ) : bool |
public bool ToBoolean() { ValueHandleType type = _type; if (type == ValueHandleType.False) { return(false); } if (type == ValueHandleType.True) { return(true); } if (type == ValueHandleType.UTF8) { return(XmlConverter.ToBoolean(_bufferReader.Buffer, _offset, _length)); } if (type == ValueHandleType.Int8) { int value = GetInt8(); if (value == 0) { return(false); } if (value == 1) { return(true); } } return(XmlConverter.ToBoolean(GetString())); }