19 implementations of ToBoolean
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
LinkTagHelperTest.cs (1)
1227public bool ToBoolean(IFormatProvider provider)
Microsoft.Build.Engine.UnitTests (1)
BackEnd\TaskBuilderTestTask.cs (1)
43public bool ToBoolean(IFormatProvider provider) => Value.ToBoolean(provider);
Microsoft.Gen.Logging.Generated.Tests (1)
test\Generators\Microsoft.Gen.Logging\TestClasses\FormattableTestExtensions.cs (1)
31public readonly bool ToBoolean(IFormatProvider? provider) => throw new NotSupportedException();
System.Private.CoreLib (16)
src\libraries\System.Private.CoreLib\src\System\Boolean.cs (1)
326bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
182bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
517bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (1)
1976bool IConvertible.ToBoolean(IFormatProvider? provider) => throw InvalidCast(nameof(Boolean));
src\libraries\System.Private.CoreLib\src\System\DBNull.cs (1)
42bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
1034bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
452bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
2177bool IConvertible.ToBoolean(IFormatProvider? provider) => Convert.ToBoolean(GetValue());
src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
185bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
200bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
197bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
188bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\Single.cs (1)
447bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
179bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
195bool IConvertible.ToBoolean(IFormatProvider? provider)
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
194bool IConvertible.ToBoolean(IFormatProvider? provider)
52 references to ToBoolean
Microsoft.Build.Engine.UnitTests (1)
BackEnd\TaskBuilderTestTask.cs (1)
43public bool ToBoolean(IFormatProvider provider) => Value.ToBoolean(provider);
Microsoft.VisualBasic.Core (36)
Microsoft\VisualBasic\CompilerServices\BooleanType.vb (1)
68Return CBool(ValueInterface.ToBoolean(Nothing))
Microsoft\VisualBasic\CompilerServices\ByteType.vb (1)
57Return CByte(ValueInterface.ToBoolean(Nothing))
Microsoft\VisualBasic\CompilerServices\Conversions.vb (15)
75Return CBool(ValueInterface.ToBoolean(Nothing)) 137Return ValueInterface.ToBoolean(Nothing) 219Return CByte(ValueInterface.ToBoolean(Nothing)) 366Return CSByte(ValueInterface.ToBoolean(Nothing)) 509Return CShort(ValueInterface.ToBoolean(Nothing)) 655Return CUShort(ValueInterface.ToBoolean(Nothing)) 798Return CInt(ValueInterface.ToBoolean(Nothing)) 943Return CUInt(ValueInterface.ToBoolean(Nothing)) 1089Return CLng(ValueInterface.ToBoolean(Nothing)) 1236Return CULng(ValueInterface.ToBoolean(Nothing)) 1395Return CDec(ValueInterface.ToBoolean(Nothing)) 1635Return CSng(ValueInterface.ToBoolean(Nothing)) 1780Return CDbl(ValueInterface.ToBoolean(Nothing)) 2262Return CStr(ValueInterface.ToBoolean(Nothing)) 2423Case TypeCode.Boolean : Return iconv.ToBoolean(Nothing)
Microsoft\VisualBasic\CompilerServices\DecimalType.vb (1)
72Return DecimalType.FromBoolean(valueInterface.ToBoolean(Nothing))
Microsoft\VisualBasic\CompilerServices\DoubleType.vb (1)
65Return CDbl(valueInterface.ToBoolean(Nothing))
Microsoft\VisualBasic\CompilerServices\IntegerType.vb (1)
57Return CInt(ValueInterface.ToBoolean(Nothing))
Microsoft\VisualBasic\CompilerServices\LongType.vb (1)
60Return CLng(ValueInterface.ToBoolean(Nothing))
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (10)
617Return ObjTstBoolean(conv1.ToBoolean(Nothing), BooleanType.FromString(conv2.ToString(Nothing))) 620Return ObjTstBoolean(BooleanType.FromString(conv1.ToString(Nothing)), conv2.ToBoolean(Nothing)) 899Return CShort(conv.ToBoolean(Nothing)) 969Int16Result = -CShort(conv.ToBoolean(Nothing)) 1142Return Not iconv.ToBoolean(Nothing) 1810If conv.ToBoolean(Nothing) Then 1818If conv.ToBoolean(Nothing) Then 3360Return CShort(conv1.ToBoolean(Nothing)) << amount 3397Return CShort(conv1.ToBoolean(Nothing)) >> amount 3644Return iconv.ToBoolean(Nothing)
Microsoft\VisualBasic\CompilerServices\ShortType.vb (1)
57Return CShort(ValueInterface.ToBoolean(Nothing))
Microsoft\VisualBasic\CompilerServices\SingleType.vb (1)
71Return CSng(ValueInterface.ToBoolean(Nothing))
Microsoft\VisualBasic\CompilerServices\StringType.vb (1)
115Return FromBoolean(ValueInterface.ToBoolean(Nothing))
Microsoft\VisualBasic\Conversion.vb (1)
496If ValueInterface.ToBoolean(Nothing) Then
Microsoft\VisualBasic\Strings.vb (1)
1282Return System.String.Format(cp, Style, CStr(ConvertibleExpression.ToBoolean(Nothing)))
System.Data.Common (2)
System\Data\Common\BooleanStorage.cs (2)
121value = ((IConvertible)value).ToBoolean(FormatProvider); 157_values[record] = ((IConvertible)value).ToBoolean(FormatProvider);
System.Data.Odbc (2)
Common\System\Data\Common\DbConnectionStringCommon.cs (2)
186return ((IConvertible)value).ToBoolean(CultureInfo.InvariantCulture); 225return ((IConvertible)value).ToBoolean(CultureInfo.InvariantCulture);
System.Private.CoreLib (7)
src\libraries\System.Private.CoreLib\src\System\Convert.cs (7)
146TypeCode.Boolean => v.ToBoolean(provider), 180return value.ToBoolean(provider); 252return ic.ToBoolean(provider); 317return value == null ? false : ((IConvertible)value).ToBoolean(null); 322return value == null ? false : ((IConvertible)value).ToBoolean(provider); 340return ((IConvertible)value).ToBoolean(null); 412return ((IConvertible)value).ToBoolean(null);
System.Windows.Forms.Design (4)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (4)
1442result = (left.ToBoolean(null) || right.ToBoolean(null)); 1445result = (left.ToBoolean(null) && right.ToBoolean(null));