1 write to Cache
Microsoft.Maui.Controls.Build.Tasks (1)
ILContext.cs (1)
22
Cache
= cache;
435 references to Cache
Microsoft.Maui.Controls.Build.Tasks (435)
CompiledConverters\BindablePropertyConverter.cs (2)
71
var typeRef = XmlTypeExtensions.GetTypeReference(context.
Cache
, typeName, module, node);
75
bpRef = GetBindablePropertyFieldReference(context.
Cache
, typeRef, propertyName, module);
CompiledConverters\BoundsTypeConverter.cs (1)
71
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Graphics", "Microsoft.Maui.Graphics", "Rect"), parameterTypes: new[] {
CompiledConverters\BrushTypeConverter.cs (2)
25
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "SolidColorBrush"), parameterTypes: new[] {
31
var propertyGetterReference = module.ImportPropertyGetterReference(context.
Cache
,
CompiledConverters\ColorTypeConverter.cs (3)
32
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Graphics", "Microsoft.Maui.Graphics", "Color"), parameterTypes: new[] {
52
var fieldReference = module.ImportFieldReference(context.
Cache
, ("Microsoft.Maui.Graphics", "Microsoft.Maui.Graphics", "Colors"),
63
var propertyGetterReference = module.ImportPropertyGetterReference(context.
Cache
, ("Microsoft.Maui.Graphics", "Microsoft.Maui.Graphics", "Colors"),
CompiledConverters\ColumnDefinitionCollectionTypeConverter.cs (3)
23
yield return Create(Newarr, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ColumnDefinition")));
30
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
,
35
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
,
CompiledConverters\ConstraintTypeConverter.cs (1)
23
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Compatibility", "Constraint"),
CompiledConverters\CornerRadiusTypeConverter.cs (1)
43
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui", "CornerRadius"), parameterTypes: args.Select(a => ("mscorlib", "System", "Double")).ToArray()));
CompiledConverters\EasingTypeConverter.cs (1)
28
var fieldReference = module.ImportFieldReference(context.
Cache
, assemblyTypeInfo, value, isStatic: true, caseSensitive: false);
CompiledConverters\FlexBasisTypeConverter.cs (3)
22
module.ImportFieldReference(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui.Layouts", "FlexBasis"),
32
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui.Layouts", "FlexBasis"), parameterTypes: new[] {
41
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui.Layouts", "FlexBasis"), parameterTypes: new[] {
CompiledConverters\FontSizeTypeConverter.cs (4)
35
context.
Cache
,
41
yield return Instruction.Create(OpCodes.Ldtoken, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "Label")));
43
context.
Cache
,
50
context.
Cache
,
CompiledConverters\GridLengthTypeConverter.cs (7)
24
yield return Create(Ldsfld, module.ImportFieldReference(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui", "GridLength"), nameof(GridLength.Auto), isStatic: true));
29
yield return Create(Ldsfld, module.ImportFieldReference(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui", "GridLength"), nameof(GridLength.Star), isStatic: true));
36
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
,
37
type: module.GetTypeDefinition(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui", "GridLength")),
38
parameterTypes: new[] { module.TypeSystem.Double, module.GetTypeDefinition(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui", "GridUnitType")) }));
44
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
,
45
type: module.GetTypeDefinition(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui", "GridLength")),
CompiledConverters\ImageSourceTypeConverter.cs (3)
22
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("System", "System", "Uri"), parameterTypes: new[] {
25
yield return Instruction.Create(OpCodes.Call, module.ImportMethodReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ImageSource"), "FromUri", parameterTypes: new[] {
31
yield return Instruction.Create(OpCodes.Call, module.ImportMethodReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ImageSource"), "FromFile", parameterTypes: new[] {
CompiledConverters\LayoutOptionsConverter.cs (1)
29
var fieldReference = module.ImportFieldReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "LayoutOptions"),
CompiledConverters\ListStringTypeConverter.cs (2)
26
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
, ("System.Collections", "System.Collections.Generic", "List`1"),
33
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System.Collections.Generic", "ICollection`1"),
CompiledConverters\PointTypeConverter.cs (1)
30
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Graphics", "Microsoft.Maui.Graphics", "Point"), parameterTypes: new[] {
CompiledConverters\RDSourceTypeConverter.cs (14)
26
var rootTargetPath = XamlCTask.GetPathForType(context.
Cache
, currentModule, ((ILRootNode)rootNode).TypeReference);
50
var uriVarDef = new VariableDefinition(currentModule.ImportReference(context.
Cache
, ("System", "System", "Uri")));
54
var resourceTypeRef = GetTypeForPath(context.
Cache
, module, resourcePath);
65
var resourceId = XamlCTask.GetResourceIdForPath(context.
Cache
, module, resourcePath);
106
context.
Cache
,
115
foreach (var instruction in context.Variables[rdNode].LoadAs(context.
Cache
, currentModule.GetTypeDefinition(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ResourceDictionary")), currentModule))
132
foreach (var instruction in context.Variables[rdNode].LoadAs(context.
Cache
, currentModule.GetTypeDefinition(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ResourceDictionary")), currentModule))
140
yield return Create(Call, currentModule.ImportMethodReference(context.
Cache
, ("mscorlib", "System.Reflection", "Assembly"), methodName: "Load", parameterTypes: new[] { ("mscorlib", "System", "String") }, isStatic: true));
145
yield return Create(Call, currentModule.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
146
yield return Create(Callvirt, currentModule.ImportPropertyGetterReference(context.
Cache
, ("mscorlib", "System", "Type"), propertyName: "Assembly", flatten: true));
153
context.
Cache
,
169
if (!TypeRefComparer.Default.Equals(ca.AttributeType, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "XamlResourceIdAttribute"))))
CompiledConverters\RectangleTypeConverter.cs (1)
44
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Graphics", "Microsoft.Maui.Graphics", "Rect"), parameterTypes: new[] {
CompiledConverters\RowDefinitionCollectionTypeConverter.cs (3)
23
yield return Create(Newarr, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "RowDefinition")));
31
context.
Cache
,
37
context.
Cache
,
CompiledConverters\StrokeShapeTypeConverter.cs (26)
26
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Ellipse"), parameterTypes: null));
36
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Line"), parameterTypes: null));
45
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Line"), parameterTypes: null));
56
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Line"), parameterTypes: new[] {
71
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Line"), parameterTypes: new[] {
88
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Path"), parameterTypes: null));
92
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Path"), parameterTypes: null));
94
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "PathGeometryConverter"), parameterTypes: null));
96
yield return Instruction.Create(OpCodes.Call, module.ImportMethodReference(context.
Cache
, ("System", "System.ComponentModel", "TypeConverter"), "ConvertFromInvariantString", parameterTypes: new[] {
98
yield return Instruction.Create(OpCodes.Call, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Path"), "Data"));
107
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polygon"), parameterTypes: null));
116
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polygon"), parameterTypes: null));
125
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polygon"), parameterTypes: new[] {
135
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polyline"), parameterTypes: null));
144
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polyline"), parameterTypes: null));
153
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Polyline"), parameterTypes: new[] {
160
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Rectangle"), parameterTypes: null));
169
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "RoundRectangle"), parameterTypes: null));
173
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "RoundRectangle"), parameterTypes: null));
184
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui", "CornerRadius"), parameterTypes: new[] {
190
yield return Instruction.Create(OpCodes.Call, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "RoundRectangle"), "CornerRadius"));
196
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "Rectangle"), parameterTypes: null));
204
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui", "CornerRadius"), parameterTypes: new[] {
210
yield return Instruction.Create(OpCodes.Call, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Shapes", "RoundRectangle"), "CornerRadius"));
219
var pointType = module.ImportReference(context.
Cache
, ("Microsoft.Maui.Graphics", "Microsoft.Maui.Graphics", "Point"));
238
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, type: ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "PointCollection"), paramCount: 1));
CompiledConverters\ThicknessTypeConverter.cs (1)
48
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui", "Microsoft.Maui", "Thickness"), parameterTypes: args.Select(a => ("mscorlib", "System", "Double")).ToArray()));
CompiledConverters\TypeTypeConverter.cs (2)
31
var typeRef = xmlType.GetTypeReference(context.
Cache
, module, (IXmlLineInfo)node);
36
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"),
CompiledConverters\UriTypeConverter.cs (1)
24
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
, ("System", "System", "Uri"), parameterTypes: new[] {
CompiledMarkupExtensions\ArrayExtension.cs (2)
45
foreach (var instruction in vardef.LoadAs(context.
Cache
, typeTypeRef, module))
53
foreach (var instruction in vardef.LoadAs(context.
Cache
, typeTypeRef, module))
CompiledMarkupExtensions\DataTemplateExtension.cs (5)
16
typeRef = module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "DataTemplate"));
25
var contentTypeRef = module.ImportReference(XmlTypeExtensions.GetTypeReference(context.
Cache
, valueNode.Value as string, module, node as BaseNode))
28
var dataTemplateCtor = module.ImportCtorReference(context.
Cache
, typeRef, new[] { module.ImportReference(context.
Cache
, ("mscorlib", "System", "Type")) });
31
Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true)),
CompiledMarkupExtensions\StaticExtension.cs (4)
27
var typeRef = module.ImportReference(XmlTypeExtensions.GetTypeReference(context.
Cache
, typename, module, node as BaseNode, expandToExtension: false));
28
var fieldRef = GetFieldReference(context.
Cache
, typeRef, membername, module);
29
var propertyDef = GetPropertyDefinition(context.
Cache
, typeRef, membername, module);
64
if (memberRef.ResolveCached(context.
Cache
).IsEnum)
CompiledMarkupExtensions\StaticResourceExtension.cs (11)
116
var parentType = module.ImportReference((node.Parent as IElementNode).XmlType.GetTypeReference(context.
Cache
, module, (IXmlLineInfo)node));
122
var targetTypeRef = module.ImportReference(bpRef.GetBindablePropertyType(context.
Cache
, node as IXmlLineInfo, module));
131
var propertyRef = parentType.GetProperty(context.
Cache
, pd => pd.Name == localName, out var declaringTypeReference);
139
[propertyRef, propertyType.ResolveCached(context.
Cache
)],
153
var staticResourceExtensionType = module.ImportReference(context.
Cache
,
155
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
,
163
var keyProperty = staticResourceExtensionType.GetProperty(context.
Cache
, pd => pd.Name == "Key", out _);
173
var parentType = module.ImportReference(parentNode.XmlType.GetTypeReference(context.
Cache
, module, (IXmlLineInfo)node));
180
propertyRef = parentType.GetProperty(context.
Cache
, pd => pd.Name == localName, out declaringTypeReference);
184
var requiredServices = staticResourceExtensionType.GetRequiredServices(context.
Cache
, module);
188
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
,
CompiledMarkupExtensions\TypeExtension.cs (3)
16
memberRef = module.ImportReference(context.
Cache
, ("mscorlib", "System", "Type"));
31
var typeref = module.ImportReference(XmlTypeExtensions.GetTypeReference(context.
Cache
, valueNode.Value as string, module, node as BaseNode));
37
Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"),
CompiledValueProviders\SetterValueProvider.cs (5)
38
foreach (var instruction in vardefref.VariableDefinition.LoadAs(context.
Cache
, module.GetTypeDefinition(context.
Cache
, setterType), module))
46
yield return Instruction.Create(OpCodes.Callvirt, module.ImportPropertySetterReference(context.
Cache
, setterType, propertyName: "Value"));
57
var generic = bindablePropertyReference.GetBindablePropertyType(context.
Cache
, node, module) as GenericInstanceType;
69
return context.Variables[firstItem].VariableType.InheritsFromOrImplements(context.
Cache
, genericType);
CompiledValueProviders\StyleSheetProvider.cs (6)
43
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.StyleSheets", "StyleSheet"),
60
if (XamlCTask.GetResourceIdForPath(context.
Cache
, module, resourcePath) == null)
66
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
67
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, ("mscorlib", "System", "Type"), propertyName: "Assembly", flatten: true)); //assembly
72
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.StyleSheets", "StyleSheet"),
79
var vardef = new VariableDefinition(module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.StyleSheets", "StyleSheet")));
CreateObjectVisitor.cs (21)
51
var typeref = Module.ImportReference(node.XmlType.GetTypeReference(Context.
Cache
, Module, node));
52
TypeDefinition typedef = typeref.ResolveCached(Context.
Cache
);
99
.GetCustomAttribute(Context.
Cache
, Module, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "ProvideCompiledAttribute"))
134
factoryCtorInfo = typedef.AllMethods(Context.
Cache
).FirstOrDefault(md => md.methodDef.IsConstructor &&
145
factoryMethodInfo = typedef.AllMethods(Context.
Cache
).FirstOrDefault(md => !md.methodDef.IsConstructor &&
310
foreach (var instruction in vardef.LoadAs(Context.
Cache
, parameter.ParameterType.ResolveGenericParameters(ctorinfo), Module))
316
[parameter, parameter.ParameterType.ResolveCached(Context.
Cache
)],
348
foreach (var instruction in vardef.LoadAs(Context.
Cache
, parameter.ParameterType.ResolveGenericParameters(factoryCtorInfo), Module))
354
[parameter, parameter.ParameterType.ResolveCached(Context.
Cache
)],
459
module.TypeSystem.Object.ResolveCached(Context.
Cache
)
474
var vardef = new VariableDefinition(module.ImportReference(Context.
Cache
, ("mscorlib", "System", "Decimal")));
485
yield return Create(Call, module.ImportPropertyGetterReference(Context.
Cache
, ("mscorlib", "System.Globalization", "CultureInfo"),
489
yield return Create(Call, module.ImportMethodReference(Context.
Cache
, ("mscorlib", "System", "Decimal"),
504
yield return Create(Newobj, module.ImportCtorReference(Context.
Cache
, ("mscorlib", "System", "Decimal"), parameterTypes: new[] { ("mscorlib", "System", "Int32") }));
522
var vardef = new VariableDefinition(module.ImportReference(Context.
Cache
, ("mscorlib", "System", "TimeSpan")));
526
yield return Create(Call, module.ImportPropertyGetterReference(Context.
Cache
, ("mscorlib", "System.Globalization", "CultureInfo"),
529
yield return Create(Call, module.ImportMethodReference(Context.
Cache
, ("mscorlib", "System", "TimeSpan"),
543
yield return Create(Newobj, module.ImportCtorReference(Context.
Cache
, ("mscorlib", "System", "TimeSpan"), parameterTypes: new[] { ("mscorlib", "System", "Int64") }));
549
var vardef = new VariableDefinition(module.ImportReference(Context.
Cache
, ("System", "System", "Uri")));
555
yield return Create(Call, module.ImportMethodReference(Context.
Cache
, ("System", "System", "Uri"),
570
var defaultCtor = module.ImportCtorReference(Context.
Cache
, typedef, parameterTypes: null);
ExpandMarkupsVisitor.cs (1)
193
if (!type.TryGetTypeReference(contextProvider.Context.
Cache
, contextProvider.Context.Module, null, expandToExtension: true, out _))
MethodDefinitionExtensions.cs (1)
37
if (!argType.InheritsFromOrImplements(context.
Cache
, paramType))
NodeILExtensions.cs (66)
40
var targetTypeRef = bpRef.GetBindablePropertyType(context.
Cache
, node, module);
41
var typeConverter = bpRef.GetBindablePropertyTypeConverter(context.
Cache
, module);
55
if (targetTypeRef.ResolveCached(context.
Cache
).FullName == "System.Nullable`1")
57
if (targetTypeRef.ResolveCached(context.
Cache
).BaseType != null && targetTypeRef.ResolveCached(context.
Cache
).BaseType.FullName == "System.Enum")
93
var implicitOperator = module.TypeSystem.String.GetImplicitOperatorTo(context.
Cache
, targetTypeRef, module);
125
var targetTypeRef = bpRef.GetBindablePropertyType(context.
Cache
, node, module);
126
var typeConverter = bpRef.GetBindablePropertyTypeConverter(context.
Cache
, module);
129
if (targetTypeRef.ResolveCached(context.
Cache
).FullName == "System.Nullable`1")
153
var knownCompiledTypeConverters = context.
Cache
.GetKnownCompiledTypeConverters(module);
158
if (typeConverter?.GetCustomAttribute(context.
Cache
, module, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "ProvideCompiledAttribute"))?.ConstructorArguments?.First().Value is string compiledConverterName
188
var isExtendedConverter = typeConverter.ImplementsInterface(context.
Cache
, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "IExtendedTypeConverter")));
189
var typeConverterCtorRef = module.ImportCtorReference(context.
Cache
, typeConverter, paramCount: 0);
191
? module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "IExtendedTypeConverter"))
192
.ResolveCached(context.
Cache
)
194
: typeConverter.ResolveCached(context.
Cache
)
195
.AllMethods(context.
Cache
)
204
var requiredServiceType = typeConverter.GetRequiredServices(context.
Cache
, module);
220
if (targetTypeRef.ResolveCached(context.
Cache
).FullName == "System.Nullable`1")
225
nullableCtor = originalTypeRef.GetMethods(context.
Cache
, md => md.IsConstructor && md.Parameters.Count == 1, module).Single().Item1;
229
var implicitOperator = module.TypeSystem.String.GetImplicitOperatorTo(context.
Cache
, targetTypeRef, module);
232
if (targetTypeRef.ResolveCached(context.
Cache
).BaseType != null && targetTypeRef.ResolveCached(context.
Cache
).BaseType.FullName == "System.Enum")
233
yield return PushParsedEnum(context.
Cache
, targetTypeRef, str, node);
268
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("mscorlib", "System", "TimeSpan"), parameterTypes: new[] { ("mscorlib", "System", "Int64") }));
275
yield return Instruction.Create(OpCodes.Newobj, module.ImportCtorReference(context.
Cache
, ("mscorlib", "System", "DateTime"), parameterTypes: new[] { ("mscorlib", "System", "Int64") }));
288
var vardef = new VariableDefinition(module.ImportReference(context.
Cache
, ("mscorlib", "System", "Decimal")));
299
yield return Create(Call, module.ImportPropertyGetterReference(context.
Cache
, ("mscorlib", "System.Globalization", "CultureInfo"),
302
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Decimal"),
317
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
, ("mscorlib", "System", "Decimal"), parameterTypes: new[] { ("mscorlib", "System", "Int32") }));
453
ctor = module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "XmlLineInfo"), parameterTypes: new[] {
459
ctor = module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "XmlLineInfo"), parameterTypes: null);
513
var finalArray = new VariableDefinition(module.ImportArrayReference(context.
Cache
, ("mscorlib", "System", "Object")));
526
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Array"),
547
foreach (var instruction in context.Variables[en].LoadAs(context.
Cache
, module.TypeSystem.Object, module))
564
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
566
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("System.Reflection.Extensions", "System.Reflection", "RuntimeReflectionExtensions"),
592
yield return Instruction.Create(OpCodes.Newarr, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "NameScope")));
616
var addService = module.ImportMethodReference(context.
Cache
, ("Microsoft.Maui.Controls.Xaml", "Microsoft.Maui.Controls.Xaml.Internals", "XamlServiceProvider"),
623
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls.Xaml", "Microsoft.Maui.Controls.Xaml.Internals", "XamlServiceProvider"), parameterTypes: null));
627
|| requiredServices.Contains(module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IProvideParentValues")), TypeRefComparer.Default)
628
|| requiredServices.Contains(module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IReferenceProvider")), TypeRefComparer.Default))
635
yield return Create(Ldtoken, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IProvideValueTarget")));
636
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
648
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
,
653
var refProvider = new VariableDefinition(module.ImportReference(context.
Cache
, ("mscorlib", "System", "Object")));
659
yield return Create(Ldtoken, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IReferenceProvider")));
660
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
667
if (!alreadyContainsProvideValueTarget && requiredServices.Contains(module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IProvideValueTarget")), TypeRefComparer.Default))
670
yield return Create(Ldtoken, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IProvideValueTarget")));
671
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
676
foreach (var instruction in variableDefinition.LoadAs(context.
Cache
, module.TypeSystem.Object, module))
689
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls.Xaml", "Microsoft.Maui.Controls.Xaml.Internals", "ValueTargetProvider"), paramCount: 2));
694
if (node.NamespaceResolver != null && createAllServices || requiredServices.Contains(module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IXamlTypeResolver")), TypeRefComparer.Default))
697
yield return Create(Ldtoken, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IXamlTypeResolver")));
698
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
699
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls.Xaml", "Microsoft.Maui.Controls.Xaml.Internals", "XmlNamespaceResolver"), parameterTypes: null));
705
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
, ("Microsoft.Maui.Controls.Xaml", "Microsoft.Maui.Controls.Xaml.Internals", "XmlNamespaceResolver"),
713
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
714
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, ("mscorlib", "System", "Type"), propertyName: "Assembly", flatten: true));
715
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls.Xaml", "Microsoft.Maui.Controls.Xaml.Internals", "XamlTypeResolver"), paramCount: 2));
719
if (node is IXmlLineInfo && createAllServices || requiredServices.Contains(module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IXmlLineInfoProvider")), TypeRefComparer.Default))
722
yield return Create(Ldtoken, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IXmlLineInfoProvider")));
723
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
726
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
, ("Microsoft.Maui.Controls.Xaml", "Microsoft.Maui.Controls.Xaml.Internals", "XmlLineInfoProvider"), parameterTypes: new[] { ("System.Xml.ReaderWriter", "System.Xml", "IXmlLineInfo") }));
SetFieldVisitor.cs (1)
37
Context.IL.Append(Context.Variables[(IElementNode)parentNode].LoadAs(Context.
Cache
, field.FieldType, Context.Module));
SetNamescopesAndRegisterNamesVisitor.cs (36)
60
if (setNameScope && Context.Variables[node].VariableType.InheritsFromOrImplements(Context.
Cache
, Context.Body.Method.Module.ImportReference(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindableObject"))))
63
else if (Context.Variables[node].VariableType.InheritsFromOrImplements(Context.
Cache
, Context.Body.Method.Module.ImportReference(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "Element"))))
70
Context.IL.Append(Context.Variables[node].LoadAs(Context.
Cache
, module.GetTypeDefinition(Context.
Cache
, parameterTypes[0]), module));
71
Context.IL.Append(namescopeVarDef.LoadAs(Context.
Cache
, module.GetTypeDefinition(Context.
Cache
, parameterTypes[1]), module));
72
Context.IL.Emit(OpCodes.Stfld, module.ImportFieldReference(Context.
Cache
, parameterTypes[0], nameof(Element.transientNamescope)));
81
if (Context.Variables[node].VariableType.InheritsFromOrImplements(Context.
Cache
, Context.Body.Method.Module.ImportReference(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindableObject"))))
104
var vardef = new VariableDefinition(module.ImportReference(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "NameScope")));
108
if (Context.Variables[node].VariableType.InheritsFromOrImplements(Context.
Cache
, Context.Body.Method.Module.ImportReference(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindableObject"))))
111
Context.IL.Append(Context.Variables[node].LoadAs(Context.
Cache
, module.GetTypeDefinition(Context.
Cache
, namescoperef), module));
112
Context.IL.Emit(OpCodes.Call, module.ImportMethodReference(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "NameScope"),
121
Context.IL.Emit(OpCodes.Newobj, module.ImportCtorReference(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "NameScope"), parameterTypes: null));
130
var vardef = new VariableDefinition(module.ImportReference(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "NameScope")));
132
Context.IL.Emit(OpCodes.Newobj, module.ImportCtorReference(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "NameScope"), parameterTypes: null));
144
Context.IL.Append(Context.Variables[node].LoadAs(Context.
Cache
, module.GetTypeDefinition(Context.
Cache
, parameterTypes[0]), module));
145
Context.IL.Append(ns.LoadAs(Context.
Cache
, module.GetTypeDefinition(Context.
Cache
, parameterTypes[1]), module));
146
Context.IL.Emit(OpCodes.Call, module.ImportMethodReference(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "NameScope"),
160
Context.IL.Append(namescopeVarDef.LoadAs(Context.
Cache
, module.GetTypeDefinition(Context.
Cache
, namescopeType), module));
162
Context.IL.Append(element.LoadAs(Context.
Cache
, module.TypeSystem.Object, module));
163
Context.IL.Emit(OpCodes.Callvirt, module.ImportMethodReference(Context.
Cache
,
174
if (!element.VariableType.InheritsFromOrImplements(Context.
Cache
, Context.Body.Method.Module.ImportReference(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "Element"))))
179
var elementTypeRef = module.GetTypeDefinition(Context.
Cache
, elementType);
182
Context.IL.Append(element.LoadAs(Context.
Cache
, elementTypeRef, module));
183
Context.IL.Emit(OpCodes.Callvirt, module.ImportPropertyGetterReference(Context.
Cache
, elementType, propertyName: "StyleId"));
185
Context.IL.Append(element.LoadAs(Context.
Cache
, elementTypeRef, module));
187
Context.IL.Emit(OpCodes.Callvirt, module.ImportPropertySetterReference(Context.
Cache
, elementType, propertyName: "StyleId"));
SetPropertiesVisitor.cs (189)
62
if ((contentProperty = GetContentProperty(Context.
Cache
, parentVar.VariableType)) != null)
115
propertyRef = Context.Variables[(IElementNode)parentNode].VariableType.GetProperty(Context.
Cache
, pd => pd.Name == localName, out declaringTypeReference);
141
Context.IL.Append(parentVar.LoadAs(Context.
Cache
, Module.GetTypeDefinition(Context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ResourceDictionary")), Module));
144
else if ((contentProperty = GetContentProperty(Context.
Cache
, parentVar.VariableType)) != null)
154
else if (parentVar.VariableType.ImplementsInterface(Context.
Cache
, Module.ImportReference(Context.
Cache
, ("mscorlib", "System.Collections", "IEnumerable")))
155
&& parentVar.VariableType.GetMethods(Context.
Cache
, md => md.Name == "Add" && md.Parameters.Count == 1, Module).Any())
158
var adderTuple = elementType.GetMethods(Context.
Cache
, md => md.Name == "Add" && md.Parameters.Count == 1, Module).First();
163
Context.IL.Append(vardef.LoadAs(Context.
Cache
, adderRef.Parameters[0].ParameterType.ResolveGenericParameters(adderRef), Module));
197
var adderTuple = propertyType.GetMethods(Context.
Cache
, md => md.Name == "Add" && md.Parameters.Count == 1, Module).FirstOrDefault() ??
203
Context.IL.Append(vardef.LoadAs(Context.
Cache
, adderRef.Parameters[0].ParameterType.ResolveGenericParameters(adderRef), Module));
260
vardefref.VariableDefinition.VariableType.ImplementsGenericInterface(context.
Cache
, "Microsoft.Maui.Controls.Xaml.IMarkupExtension`1",
263
var markExt = markupExtension.ResolveCached(context.
Cache
);
275
foreach (var instruction in context.Variables[node].LoadAs(context.
Cache
, markupExtension, module))
284
else if (vardefref.VariableDefinition.VariableType.ImplementsGenericInterface(context.
Cache
, "Microsoft.Maui.Controls.Xaml.IMarkupExtension`1",
287
var acceptEmptyServiceProvider = vardefref.VariableDefinition.VariableType.GetCustomAttribute(context.
Cache
, module, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "AcceptEmptyServiceProviderAttribute")) != null;
288
var requiredServiceType = vardefref.VariableDefinition.VariableType.GetRequiredServices(context.
Cache
, module);
318
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "TypedBinding"));
320
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "Mode"));
321
yield return Create(Callvirt, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindingBase"), propertyName: "Mode"));
324
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "TypedBinding"));
326
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "Converter"));
327
yield return Create(Callvirt, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "TypedBindingBase"), propertyName: "Converter"));
330
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "TypedBinding"));
332
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "ConverterParameter"));
333
yield return Create(Callvirt, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "TypedBindingBase"), propertyName: "ConverterParameter"));
336
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "TypedBinding"));
338
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "StringFormat"));
339
yield return Create(Callvirt, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindingBase"), propertyName: "StringFormat"));
345
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "TypedBinding"));
347
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "Source"));
348
yield return Create(Callvirt, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "TypedBindingBase"), propertyName: "Source"));
351
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "TypedBinding"));
353
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "UpdateSourceEventName"));
354
yield return Create(Callvirt, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "TypedBindingBase"), propertyName: "UpdateSourceEventName"));
357
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "TypedBinding"));
359
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "FallbackValue"));
360
yield return Create(Callvirt, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindingBase"), propertyName: "FallbackValue"));
363
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "TypedBinding"));
365
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "TargetNullValue"));
366
yield return Create(Callvirt, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindingBase"), propertyName: "TargetNullValue"));
372
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "TypedBinding"));
373
yield return Create(Call, module.ImportPropertyGetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "RelativeBindingSource"), propertyName: "TemplatedParent", isStatic: true));
374
yield return Create(Callvirt, module.ImportPropertySetterReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "TypedBindingBase"), propertyName: "Source"));
379
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, bindingExtensionType.Value, propertyName: "TypedBinding"));
392
var markExt = markupExtension.ResolveCached(context.
Cache
);
398
foreach (var instruction in context.Variables[node].LoadAs(context.
Cache
, markupExtension, module))
408
else if (context.Variables[node].VariableType.ImplementsInterface(context.
Cache
, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IMarkupExtension"))))
410
var acceptEmptyServiceProvider = context.Variables[node].VariableType.GetCustomAttribute(context.
Cache
, module, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "AcceptEmptyServiceProviderAttribute")) != null;
411
var requiredServiceType = vardefref.VariableDefinition.VariableType.GetRequiredServices(context.
Cache
, module);
418
var compiledValueProviderName = context.Variables[node].VariableType.GetCustomAttribute(context.
Cache
, module, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "ProvideCompiledAttribute"))?.ConstructorArguments?[0].Value as string;
438
foreach (var instruction in context.Variables[node].LoadAs(context.
Cache
, module.GetTypeDefinition(context.
Cache
, markupExtensionType), module))
445
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
,
451
else if (context.Variables[node].VariableType.ImplementsInterface(context.
Cache
, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "IValueProvider"))))
453
var acceptEmptyServiceProvider = context.Variables[node].VariableType.GetCustomAttribute(context.
Cache
, module, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "AcceptEmptyServiceProviderAttribute")) != null;
454
var requiredServiceType = vardefref.VariableDefinition.VariableType.GetRequiredServices(context.
Cache
, module);
461
var compiledValueProviderName = valueProviderType?.GetCustomAttribute(context.
Cache
, module, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Xaml", "ProvideCompiledAttribute"))?.ConstructorArguments?[0].Value as string;
479
foreach (var instruction in context.Variables[node].LoadAs(context.
Cache
, module.GetTypeDefinition(context.
Cache
, valueProviderInterface), module))
486
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
,
581
var tSourceRef = dtXType.GetTypeReference(context.
Cache
, module, (IXmlLineInfo)node);
602
tPropertyRef = lastProp.propDeclTypeRef.ResolveCached(context.
Cache
);
605
var valuetupleRef = context.Module.ImportReference(module.ImportReference(context.
Cache
, ("mscorlib", "System", "ValueTuple`2")).MakeGenericInstanceType(new[] { tPropertyRef, module.TypeSystem.Boolean }));
606
var funcRef = module.ImportReference(module.ImportReference(context.
Cache
, ("mscorlib", "System", "Func`2")).MakeGenericInstanceType(new[] { tSourceRef, valuetupleRef }));
607
var actionRef = module.ImportReference(module.ImportReference(context.
Cache
, ("mscorlib", "System", "Action`2")).MakeGenericInstanceType(new[] { tSourceRef, tPropertyRef }));
608
var funcObjRef = module.ImportReference(module.ImportReference(context.
Cache
, ("mscorlib", "System", "Func`2")).MakeGenericInstanceType(new[] { tSourceRef, module.TypeSystem.Object }));
609
var tupleRef = module.ImportReference(module.ImportReference(context.
Cache
, ("mscorlib", "System", "Tuple`2")).MakeGenericInstanceType(new[] { funcObjRef, module.TypeSystem.String }));
610
var typedBindingRef = module.ImportReference(module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "TypedBinding`2")).MakeGenericInstanceType(new[] { tSourceRef, tPropertyRef }));
613
var ctorInfo = module.ImportReference(typedBindingRef.ResolveCached(context.
Cache
).Methods.FirstOrDefault(md =>
617
&& !md.HasCustomAttributes(module.ImportReference(context.
Cache
, ("mscorlib", "System", "ObsoleteAttribute")))));
620
foreach (var instruction in bindingExt.LoadAs(context.
Cache
, module.GetTypeDefinition(context.
Cache
, bindingExtensionType), module))
639
yield return Create(Callvirt, module.ImportPropertySetterReference(context.
Cache
, bindingExtensionType, propertyName: "TypedBinding"));
665
&& parentNode.XmlType.TryGetTypeReference(context.
Cache
, module, (IXmlLineInfo)node, false, out TypeReference parentTypeRef)
666
&& parentTypeRef.ResolveCached(context.
Cache
) is TypeDefinition parentType
667
&& parentType.GetProperty(context.
Cache
, pd => pd.Name == propertyName.LocalName, out var propertyDeclaringTypeRef) is PropertyDefinition propertyDef
709
var property = previousPartTypeRef.GetProperty(context.
Cache
, pd => pd.Name == p && pd.GetMethod != null && pd.GetMethod.IsPublic && !pd.GetMethod.IsStatic, out var propDeclTypeRef);
721
var defaultMemberAttribute = previousPartTypeRef.GetCustomAttribute(context.
Cache
, module, ("mscorlib", "System.Reflection", "DefaultMemberAttribute"));
726
indexer = previousPartTypeRef.GetProperty(context.
Cache
,
729
&& TypeRefComparer.Default.Equals(pd.GetMethod.Parameters[0].ParameterType.ResolveGenericParameters(previousPartTypeRef), module.ImportReference(context.
Cache
, ("mscorlib", "System", "Int32")))
731
indexer = indexer ?? previousPartTypeRef.GetProperty(context.
Cache
,
734
&& TypeRefComparer.Default.Equals(pd.GetMethod.Parameters[0].ParameterType.ResolveGenericParameters(previousPartTypeRef), module.ImportReference(context.
Cache
, ("mscorlib", "System", "String")))
736
indexer = indexer ?? previousPartTypeRef.GetProperty(context.
Cache
,
739
&& TypeRefComparer.Default.Equals(pd.GetMethod.Parameters[0].ParameterType.ResolveGenericParameters(previousPartTypeRef), module.ImportReference(context.
Cache
, ("mscorlib", "System", "Object")))
755
previousPartTypeRef.ResolveCached(context.
Cache
);
844
var tupleRef = module.ImportReference(module.ImportReference(context.
Cache
, ("mscorlib", "System", "ValueTuple`2")).MakeGenericInstanceType(new[] { tPropertyRef, module.TypeSystem.Boolean }));
845
var tupleCtorRef = module.ImportCtorReference(context.
Cache
, tupleRef, 2);
847
var getter = new MethodDefinition($"<{context.Body.Method.Name}>typedBindingsM__{context.
Cache
.TypedBindingCount++}",
852
CustomAttributes = { new CustomAttribute(module.ImportCtorReference(context.
Cache
, ("mscorlib", "System.Runtime.CompilerServices", "CompilerGeneratedAttribute"), parameterTypes: null)) }
912
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
, ("mscorlib", "System", "Func`2"), paramCount: 2, classArguments: new[] { tSourceRef, tupleRef }));
935
var setter = new MethodDefinition($"<{context.Body.Method.Name}>typedBindingsM__{context.
Cache
.TypedBindingCount++}",
944
new CustomAttribute (module.ImportCtorReference(context.
Cache
, ("mscorlib", "System.Runtime.CompilerServices", "CompilerGeneratedAttribute"), parameterTypes: null))
1034
yield return Create(Newobj, module.ImportCtorReference(context.
Cache
, ("mscorlib", "System", "Action`2"),
1067
var partGetter = new MethodDefinition($"<{context.Body.Method.Name}>typedBindingsM__{context.
Cache
.TypedBindingCount++}", MethodAttributes.Private | MethodAttributes.HideBySig | MethodAttributes.Static, module.TypeSystem.Object)
1073
new CustomAttribute (module.ImportCtorReference(context.
Cache
, ("mscorlib", "System.Runtime.CompilerServices", "CompilerGeneratedAttribute"), parameterTypes: null))
1108
var funcObjRef = context.Module.ImportReference(module.ImportReference(context.
Cache
, ("mscorlib", "System", "Func`2")).MakeGenericInstanceType(new[] { tSourceRef, module.TypeSystem.Object }));
1109
var tupleRef = context.Module.ImportReference(module.ImportReference(context.
Cache
, ("mscorlib", "System", "Tuple`2")).MakeGenericInstanceType(new[] { funcObjRef, module.TypeSystem.String }));
1110
var funcCtor = module.ImportReference(funcObjRef.ResolveCached(context.
Cache
).GetConstructors().First());
1112
var tupleCtor = module.ImportReference(tupleRef.ResolveCached(context.
Cache
).GetConstructors().First());
1231
FieldDefinition bpDef = bpOwnerType.GetField(context.
Cache
,
1249
return !attached && valueNode is ValueNode && parent.VariableType.GetEvent(context.
Cache
, ed => ed.Name == localName, out _) != null;
1257
var eventinfo = elementType.GetEvent(context.
Cache
, ed => ed.Name == localName, out eventDeclaringTypeRef);
1278
var handler = declaringType.AllMethods(context.
Cache
).FirstOrDefault(md =>
1284
var invoke = module.ImportReference(eventinfo.EventType.ResolveCached(context.
Cache
).GetMethods().First(eventmd => eventmd.Name == "Invoke"));
1286
if (!md.methodDef.ReturnType.InheritsFromOrImplements(context.
Cache
, invoke.ReturnType) || invoke.Parameters.Count != md.methodDef.Parameters.Count)
1291
if (!invoke.Parameters[i].ParameterType.InheritsFromOrImplements(context.
Cache
, md.methodDef.Parameters[i].ParameterType))
1304
var ctor = module.ImportReference(eventinfo.EventType.ResolveCached(context.
Cache
).GetConstructors().First());
1314
foreach (var instruction in (context.Root as VariableDefinition).LoadAs(context.
Cache
, ctor.Parameters[0].ParameterType.ResolveGenericParameters(ctor), module))
1358
foreach (var instruction in parent.LoadAs(context.
Cache
, module.GetTypeDefinition(context.
Cache
, dynamicResourceHandlerType), module))
1361
foreach (var instruction in context.Variables[elementNode].LoadAs(context.
Cache
, module.GetTypeDefinition(context.
Cache
, dynamicResourceType), module))
1363
yield return Create(Callvirt, module.ImportPropertyGetterReference(context.
Cache
, dynamicResourceType, propertyName: "Key"));
1364
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
,
1384
var implicitOperator = varValue.VariableType.GetImplicitOperatorTo(context.
Cache
, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindingBase")), module);
1388
return varValue.VariableType.InheritsFromOrImplements(context.
Cache
, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindingBase")));
1401
foreach (var instruction in parent.LoadAs(context.
Cache
, module.GetTypeDefinition(context.
Cache
, bindableObjectType), module))
1404
foreach (var instruction in context.Variables[elementNode].LoadAs(context.
Cache
, module.GetTypeDefinition(context.
Cache
, parameterTypes[1]), module))
1406
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindableObject"),
1427
var bpTypeRef = bpRef.GetBindablePropertyType(context.
Cache
, iXmlLineInfo, module);
1432
var implicitOperator = varValue.VariableType.GetImplicitOperatorTo(context.
Cache
, bpTypeRef, module);
1440
return varValue.VariableType.InheritsFromOrImplements(context.
Cache
, bpTypeRef) || varValue.VariableType.FullName == "System.Object";
1451
if (!parent.VariableType.InheritsFromOrImplements(context.
Cache
, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindableObject"))))
1454
propertyType = bpRef.GetBindablePropertyType(context.
Cache
, iXmlLineInfo, module);
1470
foreach (var instruction in parent.LoadAs(context.
Cache
, module.GetTypeDefinition(context.
Cache
, bindableObjectType), module))
1492
yield return Create(Ldtoken, module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "BindingBase")));
1493
yield return Create(Call, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "GetTypeFromHandle", parameterTypes: new[] { ("mscorlib", "System", "RuntimeTypeHandle") }, isStatic: true));
1495
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Object"), methodName: "GetType", paramCount: 0));
1496
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
, ("mscorlib", "System", "Type"), methodName: "IsAssignableFrom", parameterTypes: new[] { ("mscorlib", "System", "Type") }));
1504
var bpTypeRef = bpRef.GetBindablePropertyType(context.
Cache
, iXmlLineInfo, module);
1505
foreach (var instruction in context.Variables[elementNode].LoadAs(context.
Cache
, bpTypeRef, module))
1515
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
,
1526
propertyType = bpRef.GetBindablePropertyType(context.
Cache
, iXmlLineInfo, context.Body.Method.Module);
1535
foreach (var instruction in parent.LoadAs(context.
Cache
, module.GetTypeDefinition(context.
Cache
, bindableObjectType), module))
1539
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
,
1549
var property = parent.VariableType.GetProperty(context.
Cache
, pd => pd.Name == localName, out declaringTypeReference);
1558
if (valueNode != null && valueNode.CanConvertValue(context, propertyType, new ICustomAttributeProvider[] { property, propertyType.ResolveCached(context.
Cache
) }))
1566
var implicitOperator = vardef.VariableType.GetImplicitOperatorTo(context.
Cache
, propertyType, module);
1568
if (vardef.VariableType.InheritsFromOrImplements(context.
Cache
, propertyType))
1587
var property = parent.VariableType.GetProperty(context.
Cache
, pd => pd.Name == localName, out declaringTypeReference);
1594
module.ImportReference(parent.VariableType.ResolveCached(context.
Cache
));
1606
var property = parent.VariableType.GetProperty(context.
Cache
, pd => pd.Name == localName, out declaringTypeReference);
1620
module.ImportReference(parent.VariableType.ResolveCached(context.
Cache
));
1636
foreach (var instruction in valueNode.PushConvertedValue(context, propertyType, new ICustomAttributeProvider[] { property, propertyType.ResolveCached(context.
Cache
) }, (requiredServices) => valueNode.PushServiceProvider(context, requiredServices, propertyRef: property), false, true))
1645
foreach (var instruction in context.Variables[elementNode].LoadAs(context.
Cache
, propertyType, module))
1657
var property = parent.VariableType.GetProperty(context.
Cache
, pd => pd.Name == localName, out var declaringTypeReference);
1660
module.ImportReference(parent.VariableType.ResolveCached(context.
Cache
));
1693
var adderTuple = propertyType.GetMethods(context.
Cache
, md => md.Name == "Add"
1701
if (varValue.VariableType.InheritsFromOrImplements(context.
Cache
, paramType))
1704
if (varValue.VariableType.GetImplicitOperatorTo(context.
Cache
, paramType, module) != null)
1716
&& !collectionType.InheritsFromOrImplements(context.
Cache
, context.Module.ImportReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ResourceDictionary"))))
1723
var names = context.
Cache
.GetResourceNamesInUse(parent);
1732
if (module.ImportMethodReference(context.
Cache
,
1733
module.GetTypeDefinition(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ResourceDictionary")),
1757
var adderTuple = propertyType.GetMethods(context.
Cache
, md => md.Name == "Add" && md.Parameters.Count == 1, module).FirstOrDefault();
1761
foreach (var instruction in vardef.LoadAs(context.
Cache
, adderRef.Parameters[0].ParameterType.ResolveGenericParameters(adderRef), module))
1774
var names = context.
Cache
.GetResourceNamesInUse(parent);
1783
foreach (var instruction in context.Variables[node].LoadAs(context.
Cache
, module.TypeSystem.Object, module))
1785
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ResourceDictionary"),
1796
yield return Create(Callvirt, module.ImportMethodReference(context.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls", "ResourceDictionary"),
1810
elementType = new XmlType(namespaceURI, typename, null).GetTypeReference(context.
Cache
, context.Body.Method.Module, lineInfo);
1823
parentContext.IL.Append(parentVar.LoadAs(parentContext.
Cache
, module.GetTypeDefinition(parentContext.
Cache
, dataTemplateType), module));
1832
"<" + parentContext.Body.Method.Name + ">_anonXamlCDataTemplate_" + parentContext.
Cache
.DataTemplateCount++,
1839
new CustomAttribute (module.ImportCtorReference(parentContext.
Cache
, ("mscorlib", "System.Runtime.CompilerServices", "CompilerGeneratedAttribute"), parameterTypes: null)),
1844
var ctor = anonType.AddDefaultConstructor(parentContext.
Cache
);
1852
var parentValues = new FieldDefinition("parentValues", FieldAttributes.Assembly, module.ImportArrayReference(parentContext.
Cache
, ("mscorlib", "System", "Object")));
1869
var templateContext = new ILContext(templateIl, loadTemplate.Body, module, parentContext.
Cache
, parentValues)
1889
parentIl.Append(kvp.Value.Item1.LoadAs(parentContext.
Cache
, module.ImportReference(parentContext.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "NameScope")), module));
1890
var fieldDefScope = new FieldDefinition($"_scope{i++}", FieldAttributes.Assembly, module.ImportReference(parentContext.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "NameScope")));
1896
var varDefScope = new VariableDefinition(module.ImportReference(parentContext.
Cache
, ("Microsoft.Maui.Controls", "Microsoft.Maui.Controls.Internals", "NameScope")));
1910
templateIl.Append(templateContext.Variables[node].LoadAs(parentContext.
Cache
, module.TypeSystem.Object, module));
1920
parentIl.Append((parentContext.Root as VariableDefinition).LoadAs(parentContext.
Cache
, module.TypeSystem.Object, module));
1932
parentIl.Emit(Newobj, module.ImportCtorReference(parentContext.
Cache
, ("mscorlib", "System", "Func`1"),
1936
parentContext.IL.Emit(OpCodes.Callvirt, module.ImportPropertySetterReference(parentContext.
Cache
, dataTemplateType, propertyName: "LoadTemplate"));
1946
var attributes = variableDefinition.VariableType.ResolveCached(Context.
Cache
)
SetResourcesVisitor.cs (1)
76
|| parentVar.VariableType.ResolveCached(Context.
Cache
).BaseType?.FullName == "Microsoft.Maui.Controls.ResourceDictionary";