1 write to Value
System.CodeDom (1)
System\CodeDom\CodePrimitiveExpression.cs (1)
12
Value
= value;
70 references to Value
System.CodeDom (64)
Microsoft\CSharp\CSharpCodeGenerator.cs (30)
679
if (e.
Value
is char)
681
GeneratePrimitiveChar((char)e.
Value
);
683
else if (e.
Value
is sbyte)
686
Output.Write(((sbyte)e.
Value
).ToString(CultureInfo.InvariantCulture));
688
else if (e.
Value
is ushort)
692
Output.Write(((ushort)e.
Value
).ToString(CultureInfo.InvariantCulture));
694
else if (e.
Value
is uint)
696
Output.Write(((uint)e.
Value
).ToString(CultureInfo.InvariantCulture));
699
else if (e.
Value
is ulong)
701
Output.Write(((ulong)e.
Value
).ToString(CultureInfo.InvariantCulture));
704
else if (e.
Value
== null)
708
else if (e.
Value
is string)
710
Output.Write(QuoteSnippetString((string)e.
Value
));
712
else if (e.
Value
is byte)
714
Output.Write(((byte)e.
Value
).ToString(CultureInfo.InvariantCulture));
716
else if (e.
Value
is short)
718
Output.Write(((short)e.
Value
).ToString(CultureInfo.InvariantCulture));
720
else if (e.
Value
is int)
722
Output.Write(((int)e.
Value
).ToString(CultureInfo.InvariantCulture));
724
else if (e.
Value
is long)
726
Output.Write(((long)e.
Value
).ToString(CultureInfo.InvariantCulture));
728
else if (e.
Value
is float)
730
GenerateSingleFloatValue((float)e.
Value
);
732
else if (e.
Value
is double)
734
GenerateDoubleValue((double)e.
Value
);
736
else if (e.
Value
is decimal)
738
GenerateDecimalValue((decimal)e.
Value
);
740
else if (e.
Value
is bool)
742
if ((bool)e.
Value
)
753
throw new ArgumentException(SR.Format(SR.InvalidPrimitiveType, e.
Value
.GetType()), nameof(e));
Microsoft\VisualBasic\VBCodeGenerator.cs (12)
651
if (e.Right is CodePrimitiveExpression && ((CodePrimitiveExpression)e.Right).
Value
== null)
656
if (e.Left is CodePrimitiveExpression && ((CodePrimitiveExpression)e.Left).
Value
== null)
815
if (e.
Value
is char)
817
Output.Write("Global.Microsoft.VisualBasic.ChrW(" + ((IConvertible)e.
Value
).ToInt32(CultureInfo.InvariantCulture).ToString(CultureInfo.InvariantCulture) + ")");
819
else if (e.
Value
is sbyte)
822
Output.Write(((sbyte)e.
Value
).ToString(CultureInfo.InvariantCulture));
825
else if (e.
Value
is ushort)
827
Output.Write(((ushort)e.
Value
).ToString(CultureInfo.InvariantCulture));
830
else if (e.
Value
is uint)
832
Output.Write(((uint)e.
Value
).ToString(CultureInfo.InvariantCulture));
835
else if (e.
Value
is ulong)
837
Output.Write(((ulong)e.
Value
).ToString(CultureInfo.InvariantCulture));
System\CodeDom\Compiler\CodeGenerator.cs (22)
1421
if (e.
Value
== null)
1425
else if (e.
Value
is string)
1427
Output.Write(QuoteSnippetString((string)e.
Value
));
1429
else if (e.
Value
is char)
1431
Output.Write("'" + e.
Value
.ToString() + "'");
1433
else if (e.
Value
is byte)
1435
Output.Write(((byte)e.
Value
).ToString(CultureInfo.InvariantCulture));
1437
else if (e.
Value
is short)
1439
Output.Write(((short)e.
Value
).ToString(CultureInfo.InvariantCulture));
1441
else if (e.
Value
is int)
1443
Output.Write(((int)e.
Value
).ToString(CultureInfo.InvariantCulture));
1445
else if (e.
Value
is long)
1447
Output.Write(((long)e.
Value
).ToString(CultureInfo.InvariantCulture));
1449
else if (e.
Value
is float)
1451
GenerateSingleFloatValue((float)e.
Value
);
1453
else if (e.
Value
is double)
1455
GenerateDoubleValue((double)e.
Value
);
1457
else if (e.
Value
is decimal)
1459
GenerateDecimalValue((decimal)e.
Value
);
1461
else if (e.
Value
is bool)
1463
if ((bool)e.
Value
)
1474
throw new ArgumentException(SR.Format(SR.InvalidPrimitiveType, e.
Value
.GetType()), nameof(e));
System.Windows.Forms.Design (1)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (1)
665
result = primitiveEx.
Value
;
System.Windows.Forms.Design.Tests (5)
CodeDomHelpers.cs (3)
85
if (cpe.
Value
is null)
89
else if (cpe.
Value
is string s)
94
return $"new CodePrimitiveExpression({cpe.
Value
})";
Serialization\PrimitiveCodeDomSerializerTests.cs (2)
34
Assert.Equal(input, result.
Value
);
51
Assert.Equal((byte)42, primitive.
Value
);