112 instantiations of CodePrimitiveExpression
Microsoft.Build.Tasks.Core (11)
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (1)
623
InitExpression = defaultValue == null ? null : new
CodePrimitiveExpression
(defaultValue)
system.design\stronglytypedresourcebuilder.cs (7)
304
var toolArg = new CodeAttributeArgument(new
CodePrimitiveExpression
(typeof(StronglyTypedResourceBuilder).FullName));
305
var versionArg = new CodeAttributeArgument(new
CodePrimitiveExpression
(MSBuildConstants.CurrentAssemblyVersion));
341
suppressMessageAttrib.Arguments.Add(new CodeAttributeArgument(new
CodePrimitiveExpression
("Microsoft.Performance")));
342
suppressMessageAttrib.Arguments.Add(new CodeAttributeArgument(new
CodePrimitiveExpression
("CA1811:AvoidUncalledPrivateCode")));
457
var isResMgrNull = new CodeMethodInvokeExpression(object_equalsMethod, field_resMgr, new
CodePrimitiveExpression
(null));
463
var newResMgr = new CodeObjectCreateExpression(ResMgrCodeTypeReference, new
CodePrimitiveExpression
(resMgrCtorParam), getAssembly);
645
var getValue = new CodeMethodInvokeExpression(resMgr, getMethodName, new
CodePrimitiveExpression
(resourceName), resCultureField);
WriteCodeFragment.cs (3)
569
return new
CodePrimitiveExpression
(rawValue);
581
return new
CodePrimitiveExpression
(rawValue);
601
return new
CodePrimitiveExpression
(Convert.ChangeType(value, targetType, CultureInfo.InvariantCulture));
PresentationBuildTasks (26)
MS\Internal\MarkupCompiler\MarkupCompiler.cs (26)
954
new
CodePrimitiveExpression
(connectionId))
1188
new
CodePrimitiveExpression
(connectionId))
1288
CodeAssignStatement casContentLoaded = new CodeAssignStatement(cfreContentLoaded, new
CodePrimitiveExpression
(true));
1489
new CodeAttributeArgument(new
CodePrimitiveExpression
(category)),
1490
new CodeAttributeArgument(new
CodePrimitiveExpression
(rule)));
1795
ce = new
CodePrimitiveExpression
(value);
1825
ce = new
CodePrimitiveExpression
(null);
2227
new CodeAttributeArgument(new
CodePrimitiveExpression
("Microsoft.Performance")),
2228
new CodeAttributeArgument(new
CodePrimitiveExpression
("CA1823:AvoidUnusedPrivateFields"))));
2447
new CodeAttributeArgument(new
CodePrimitiveExpression
(s_generatedCode_ToolName)),
2448
new CodeAttributeArgument(new
CodePrimitiveExpression
(s_generatedCode_ToolVersion)));
2636
new
CodePrimitiveExpression
(true));
2692
CodeExpression[] uriParams = { new
CodePrimitiveExpression
(uriPart), cfreRelUri };
2805
cmieCI.Parameters.Add(new
CodePrimitiveExpression
(null));
2806
cmieCI.Parameters.Add(new
CodePrimitiveExpression
(null));
2838
cmieGPV.Parameters.Add(new
CodePrimitiveExpression
(null));
2839
cmieGPV.Parameters.Add(new
CodePrimitiveExpression
(null));
2871
cmieSPV.Parameters.Add(new
CodePrimitiveExpression
(null));
2872
cmieSPV.Parameters.Add(new
CodePrimitiveExpression
(null));
2915
cmieCD.Parameters.Add(new
CodePrimitiveExpression
(CREATEDELEGATEHELPER));
2922
cmieCD.Parameters.Add(new
CodePrimitiveExpression
(null));
2931
cmieCD.Parameters.Add(new
CodePrimitiveExpression
(null));
2986
new CodeAttributeArgument(new
CodePrimitiveExpression
(DefaultNamespace)));
3298
new CodeAttributeArgument(new
CodePrimitiveExpression
(normalized)));
3329
CodeObjectCreateExpression coceApplicationSplashScreen = new CodeObjectCreateExpression(SPLASHCLASSNAME, new
CodePrimitiveExpression
(GetSplashResourceId()));
3336
CodeMethodInvokeExpression cmieShowSplashScreen = new CodeMethodInvokeExpression(cvreAppSplash, "Show", new
CodePrimitiveExpression
(true));
System.Runtime.Serialization.Schema (31)
System\Runtime\Serialization\Schema\CodeExporter.cs (31)
521
generatedCodeAttribute.Arguments.Add(new CodeAttributeArgument(new
CodePrimitiveExpression
(assemblyName.Name!)));
522
generatedCodeAttribute.Arguments.Add(new CodeAttributeArgument(new
CodePrimitiveExpression
(assemblyName.Version?.ToString()!)));
799
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.NameProperty, new
CodePrimitiveExpression
(dataContractName)));
800
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.NamespaceProperty, new
CodePrimitiveExpression
(classDataContract.XmlName.Namespace)));
802
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.IsReferenceProperty, new
CodePrimitiveExpression
(classDataContract.IsReference)));
865
dataMemberAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.NameProperty, new
CodePrimitiveExpression
(dataMemberName)));
867
dataMemberAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.IsRequiredProperty, new
CodePrimitiveExpression
(dataMember.IsRequired)));
869
dataMemberAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.EmitDefaultValueProperty, new
CodePrimitiveExpression
(dataMember.EmitDefaultValue)));
871
dataMemberAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.OrderProperty, new
CodePrimitiveExpression
(dataMember.Order)));
1082
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.NameProperty, new
CodePrimitiveExpression
(dataContractName)));
1083
dataContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.NamespaceProperty, new
CodePrimitiveExpression
(enumDataContract.XmlName.Namespace)));
1096
enumMember.InitExpression = new
CodePrimitiveExpression
(longValue);
1100
enumMemberAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.ValueProperty, new
CodePrimitiveExpression
(stringValue)));
1242
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.NameProperty, new
CodePrimitiveExpression
(dataContractName)));
1243
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.NamespaceProperty, new
CodePrimitiveExpression
(collectionContract.XmlName.Namespace)));
1245
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.IsReferenceProperty, new
CodePrimitiveExpression
(collectionContract.IsReference)));
1246
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.ItemNameProperty, new
CodePrimitiveExpression
(GetNameForAttribute(itemName!)))); // ItemName is never null for Collection contracts.
1252
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.KeyNameProperty, new
CodePrimitiveExpression
(GetNameForAttribute(keyName))));
1253
collectionContractAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.ValueNameProperty, new
CodePrimitiveExpression
(GetNameForAttribute(valueName))));
1294
new CodeAttributeArgument(ImportGlobals.IsAnyProperty, new
CodePrimitiveExpression
(true)))
1301
new CodeAttributeArgument(new
CodePrimitiveExpression
(ImportGlobals.ExportSchemaMethod)))
1309
typeNameField.InitExpression = new CodeObjectCreateExpression(ImportGlobals.TypeOfXmlQualifiedName, new
CodePrimitiveExpression
(typeName.Name), new
CodePrimitiveExpression
(typeName.Namespace));
1324
xmlRootAttribute.Arguments.Add(new CodeAttributeArgument("ElementName", new
CodePrimitiveExpression
(xmlDataContract.TopLevelElementName.Value)));
1328
xmlRootAttribute.Arguments.Add(new CodeAttributeArgument("Namespace", new
CodePrimitiveExpression
(xmlDataContract.TopLevelElementNamespace.Value)));
1332
xmlRootAttribute.Arguments.Add(new CodeAttributeArgument("IsNullable", new
CodePrimitiveExpression
(false)));
1361
namespaceAttribute.Arguments.Add(new CodeAttributeArgument(new
CodePrimitiveExpression
(dataContractNamespace)));
1362
namespaceAttribute.Arguments.Add(new CodeAttributeArgument(ImportGlobals.ClrNamespaceProperty, new
CodePrimitiveExpression
(clrNamespace)));
1675
get { return new
CodePrimitiveExpression
(null!); }
2021
right = new
CodePrimitiveExpression
(true);
2024
ifStatement.TrueStatements.Add(new CodeMethodInvokeExpression(ThisReference, RaisePropertyChangedEventMethod.Name, new
CodePrimitiveExpression
(propertyName)));
System.Windows.Forms.Design (17)
System\ComponentModel\Design\Serialization\LocalizationCodeDomSerializer.cs (1)
139
methodInvoke.Parameters.Add(new
CodePrimitiveExpression
(name));
System\ComponentModel\Design\Serialization\PrimitiveCodeDomSerializer.cs (2)
26
null or bool or char or int or float or double or string => new
CodePrimitiveExpression
(value),
29
_ => new CodeCastExpression(new CodeTypeReference(value.GetType()), new
CodePrimitiveExpression
(value)),
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.cs (2)
295
parameters = [new
CodePrimitiveExpression
(ResourceManagerName)];
347
methodInvoke.Parameters.Add(new
CodePrimitiveExpression
(resourceName));
System\Resources\Tools\StronglyTypedResourceBuilder.cs (7)
444
CodeAttributeArgument toolArg = new(new
CodePrimitiveExpression
(typeof(StronglyTypedResourceBuilder).FullName));
448
new(new
CodePrimitiveExpression
(
492
suppressAttribute.Arguments.Add(new CodeAttributeArgument(new
CodePrimitiveExpression
("Microsoft.Performance")));
493
suppressAttribute.Arguments.Add(new CodeAttributeArgument(new
CodePrimitiveExpression
("CA1811:AvoidUncalledPrivateCode")));
586
new
CodePrimitiveExpression
(null));
612
new
CodePrimitiveExpression
(resourceManagerConstructorParameter),
790
new
CodePrimitiveExpression
(resourceName),
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (1)
399
parameters.Add(new
CodePrimitiveExpression
(false));
System\Windows\Forms\Design\ImageCollectionCodeDomSerializer.cs (2)
64
new
CodePrimitiveExpression
(i), // SetKeyName(int,
65
new
CodePrimitiveExpression
(imageKey) // string);
System\Windows\Forms\Design\TableLayoutControlCollectionCodeDomSerializer.cs (2)
80
statement.Parameters.Add(new
CodePrimitiveExpression
(col));
81
statement.Parameters.Add(new
CodePrimitiveExpression
(row));
System.Windows.Forms.Design.Tests (27)
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs (27)
148
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name1"), "DefaultStringValue"), new
CodePrimitiveExpression
(null)),
149
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name1"), "IntValue"), new
CodePrimitiveExpression
(1)),
150
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name1"), "StringValue"), new
CodePrimitiveExpression
("Value"))
162
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name2"), "DefaultStringValue"), new
CodePrimitiveExpression
(null)),
163
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name2"), "IntValue"), new
CodePrimitiveExpression
(2)),
164
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name2"), "StringValue"), new
CodePrimitiveExpression
("OtherValue"))
250
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "DefaultStringValue"), new
CodePrimitiveExpression
(null)),
251
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "IntValue"), new
CodePrimitiveExpression
(1)),
252
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "StringValue"), new
CodePrimitiveExpression
("Value"))
352
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "DefaultStringValue"), new
CodePrimitiveExpression
(null)),
353
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "IntValue"), new
CodePrimitiveExpression
(1)),
354
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "StringValue"), new
CodePrimitiveExpression
("Value"))
397
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "DefaultStringValue"), new
CodePrimitiveExpression
(null)),
398
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "IntValue"), new
CodePrimitiveExpression
(1)),
399
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "StringValue"), new
CodePrimitiveExpression
("Value"))
443
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "IntValue"), new
CodePrimitiveExpression
(1)),
444
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "DefaultStringValue"), new
CodePrimitiveExpression
(null)),
445
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "IntValue"), new
CodePrimitiveExpression
(1)),
489
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "IntValue"), new
CodePrimitiveExpression
(1)),
490
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "DefaultStringValue"), new
CodePrimitiveExpression
(null)),
491
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "IntValue"), new
CodePrimitiveExpression
(1))
538
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "DefaultStringValue"), new
CodePrimitiveExpression
(null)),
539
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "IntValue"), new
CodePrimitiveExpression
(1)),
540
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "StringValue"), new
CodePrimitiveExpression
("Value"))
587
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "DefaultStringValue"), new
CodePrimitiveExpression
(null)),
588
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "IntValue"), new
CodePrimitiveExpression
(1)),
589
new CodeAssignStatement(new CodePropertyReferenceExpression(new CodeVariableReferenceExpression("name"), "StringValue"), new
CodePrimitiveExpression
("Value"))
21 references to CodePrimitiveExpression
System (1)
src\libraries\shims\System\ref\System.cs (1)
81
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.CodeDom.
CodePrimitiveExpression
))]
System.CodeDom (12)
Microsoft\CSharp\CSharpCodeGenerator.cs (3)
677
private void GeneratePrimitiveExpression(
CodePrimitiveExpression
e)
1206
else if (e is
CodePrimitiveExpression
)
1208
GeneratePrimitiveExpression((
CodePrimitiveExpression
)e);
Microsoft\VisualBasic\VBCodeGenerator.cs (5)
651
if (e.Right is
CodePrimitiveExpression
&& ((
CodePrimitiveExpression
)e.Right).Value == null)
656
if (e.Left is
CodePrimitiveExpression
&& ((
CodePrimitiveExpression
)e.Left).Value == null)
813
protected override void GeneratePrimitiveExpression(
CodePrimitiveExpression
e)
System\CodeDom\Compiler\CodeGenerator.cs (3)
583
else if (e is
CodePrimitiveExpression
)
585
GeneratePrimitiveExpression((
CodePrimitiveExpression
)e);
1414
protected virtual void GeneratePrimitiveExpression(
CodePrimitiveExpression
e)
System\CodeDom\Compiler\CodeValidator.cs (1)
747
else if (e is
CodePrimitiveExpression
)
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\CodeExporter.cs (1)
1673
private static
CodePrimitiveExpression
NullReference
System.Windows.Forms.Design (1)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (1)
663
if (result is
CodePrimitiveExpression
primitiveEx)
System.Windows.Forms.Design.Tests (6)
CodeDomHelpers.cs (1)
83
case
CodePrimitiveExpression
cpe:
Serialization\PrimitiveCodeDomSerializerTests.cs (5)
32
var
result = underTest.Serialize(manager, input) as
CodePrimitiveExpression
;
49
Assert.IsType<
CodePrimitiveExpression
>(cast.Expression);
50
var
primitive = cast.Expression as
CodePrimitiveExpression
;