1 implementation of IElementNode
Microsoft.Maui.Controls.Xaml (1)
XamlNode.cs (1)
155
class ElementNode : BaseNode, IValueNode,
IElementNode
216 references to IElementNode
Microsoft.Maui.Controls.Build.Tasks (149)
CompiledConverters\BindablePropertyConverter.cs (10)
36
var
parent = node.Parent?.Parent as
IElementNode
?? (node.Parent?.Parent as IListNode)?.Parent as
IElementNode
;
84
static string FindTypeNameForVisualState(
IElementNode
parent, IXmlLineInfo lineInfo)
89
if (!(parent.Parent is
IElementNode
target) || target.XmlType.NamespaceUri != XamlParser.MauiUri || target.XmlType.Name != nameof(VisualStateGroup))
94
|| ((target.Parent as
IElementNode
)?.XmlType.NamespaceUri == XamlParser.MauiUri
95
&& (target.Parent as
IElementNode
)?.XmlType.Name == nameof(VisualStateGroupList)))
96
target = target.Parent.Parent as
IElementNode
;
98
target = target.Parent as
IElementNode
;
102
return ((target?.Parent as
IElementNode
)?.Properties[new XmlName("", "TargetType")] as ValueNode)?.Value as string;
CompiledConverters\FontSizeTypeConverter.cs (2)
30
var
parent = node.Parent as
IElementNode
;
CompiledConverters\RDSourceTypeConverter.cs (4)
24
var
rdNode = node.Parent as
IElementNode
;
94
IElementNode
rdNode,
126
IElementNode
rdNode,
CompiledMarkupExtensions\ArrayExtension.cs (5)
11
public IEnumerable<Instruction> ProvideValue(
IElementNode
node, ModuleDefinition module, ILContext context, out TypeReference memberRef)
13
var
typeNode = node.Properties[new XmlName("", "Type")] as
IElementNode
;
29
var
node = items[i] as
IElementNode
;
CompiledMarkupExtensions\DataTemplateExtension.cs (1)
14
public IEnumerable<Instruction> ProvideValue(
IElementNode
node, ModuleDefinition module, ILContext context, out TypeReference typeRef)
CompiledMarkupExtensions\ICompiledMarkupExtension.cs (1)
10
IEnumerable<Instruction> ProvideValue(
IElementNode
node, ModuleDefinition module, ILContext context, out TypeReference typeRef);
CompiledMarkupExtensions\NullExtension.cs (1)
12
public IEnumerable<Instruction> ProvideValue(
IElementNode
node, ModuleDefinition module, ILContext context, out TypeReference typeRef)
CompiledMarkupExtensions\StaticExtension.cs (1)
13
public IEnumerable<Instruction> ProvideValue(
IElementNode
node, ModuleDefinition module, ILContext context, out TypeReference memberRef)
CompiledMarkupExtensions\StaticResourceExtension.cs (8)
32
if (resourcesNode is
IElementNode
irn
53
if (rn is
IElementNode
irn2
72
else if (resourcesNode is
IElementNode
resourceDictionary
77
if (rn is
IElementNode
irn3
111
public static IEnumerable<Instruction> TryConvert(ValueNode stringResourceNode,
IElementNode
node, VariableDefinitionReference vardefref, ModuleDefinition module, ILContext context)
116
var parentType = module.ImportReference((node.Parent as
IElementNode
).XmlType.GetTypeReference(context.Cache, module, (IXmlLineInfo)node));
151
public static IEnumerable<Instruction> FallBack(string key,
IElementNode
node, ModuleDefinition module, ILContext context)
171
if (node.Parent is
IElementNode
parentNode && propertyName != XmlName.Empty)
CompiledMarkupExtensions\TypeExtension.cs (1)
14
public IEnumerable<Instruction> ProvideValue(
IElementNode
node, ModuleDefinition module, ILContext context, out TypeReference memberRef)
CompiledValueProviders\SetterValueProvider.cs (8)
15
if (!((
IElementNode
)node).Properties.TryGetValue(new XmlName("", "Value"), out valueNode) &&
16
!((
IElementNode
)node).Properties.TryGetValue(new XmlName(XamlParser.MauiUri, "Value"), out valueNode) &&
17
((
IElementNode
)node).CollectionItems.Count == 1)
18
valueNode = ((
IElementNode
)node).CollectionItems[0];
20
var bpNode = ((ValueNode)((
IElementNode
)node).Properties[new XmlName("", "Property")]);
31
if (valueNode is
IElementNode
)
51
var items = (node as
IElementNode
)?.CollectionItems;
66
if (!(items[0] is
IElementNode
firstItem))
CompiledValueProviders\StyleSheetProvider.cs (6)
17
((
IElementNode
)node).Properties.TryGetValue(new XmlName("", "Source"), out sourceNode);
19
((
IElementNode
)node).Properties.TryGetValue(new XmlName(XamlParser.MauiUri, "Source"), out sourceNode);
22
if (!((
IElementNode
)node).Properties.TryGetValue(new XmlName("", "Style"), out styleNode) &&
23
!((
IElementNode
)node).Properties.TryGetValue(new XmlName(XamlParser.MauiUri, "Style"), out styleNode) &&
24
((
IElementNode
)node).CollectionItems.Count == 1)
25
styleNode = ((
IElementNode
)node).CollectionItems[0];
CreateObjectVisitor.cs (7)
34
var parentVar = Context.Variables[(
IElementNode
)node];
61
if (cnode is not
IElementNode
en)
309
if (node is
IElementNode
&& (vardef = Context.Variables[node as
IElementNode
]) != null)
347
if (arg is
IElementNode
&& (vardef = Context.Variables[arg as
IElementNode
]) != null)
362
static bool IsXaml2009LanguagePrimitive(
IElementNode
node)
ExpandMarkupsVisitor.cs (7)
31
var parentVar = Context.Variables[(
IElementNode
)node];
46
if (parentNode is
IElementNode
&& ((
IElementNode
)parentNode).SkipProperties.Contains(propertyName))
49
if (ParseExpression(ref markupString, Context, markupnode.NamespaceResolver, markupnode) is
IElementNode
node)
51
((
IElementNode
)parentNode).Properties[propertyName] = node;
71
if (!(parentNode is
IElementNode
parentElement))
115
IElementNode
_node;
ILContext.cs (2)
17
Variables = new Dictionary<
IElementNode
, VariableDefinition>();
30
public Dictionary<
IElementNode
, VariableDefinition> Variables { get; private set; }
MethodDefinitionExtensions.cs (1)
36
var argType = context.Variables[arguments[i] as
IElementNode
].VariableType;
NodeILExtensions.cs (5)
471
var nodes = new List<
IElementNode
>();
475
var
en = n as
IElementNode
;
544
var
en = nodes[i];
673
if (node.Parent is
IElementNode
elementNode &&
SetFieldVisitor.cs (4)
24
var parentVar = Context.Variables[(
IElementNode
)node];
37
Context.IL.Append(Context.Variables[(
IElementNode
)parentNode].LoadAs(Context.Cache, field.FieldType, Context.Module));
59
var
parentElement = parentNode as
IElementNode
;
SetNamescopesAndRegisterNamesVisitor.cs (4)
35
RegisterName((string)node.Value, Context.Scopes[node].Item1, Context.Scopes[node].Item2, Context.Variables[(
IElementNode
)parentNode], node);
36
SetStyleId((string)node.Value, Context.Variables[(
IElementNode
)parentNode]);
92
=> parentNode is
IElementNode
parentElement && parentElement.Properties.TryGetValue(XmlName._CreateContent, out INode createContent) && createContent == node;
99
=> parentNode is
IElementNode
parentElement && parentElement.Properties.TryGetValue(XmlName.xName, out INode xNameNode) && xNameNode == node;
SetPropertiesVisitor.cs (56)
44
var parentVar = Context.Variables[(
IElementNode
)node];
59
if (!Context.Variables.ContainsKey((
IElementNode
)parentNode))
61
var parentVar = Context.Variables[(
IElementNode
)parentNode];
63
propertyName = new XmlName(((
IElementNode
)parentNode).NamespaceURI, contentProperty);
68
if (TrySetRuntimeName(propertyName, Context.Variables[(
IElementNode
)parentNode], node))
72
if (parentNode is
IElementNode
&& ((
IElementNode
)parentNode).SkipProperties.Contains(propertyName))
76
Context.IL.Append(SetPropertyValue(Context.Variables[(
IElementNode
)parentNode], propertyName, node, Context, node));
100
SetDataTemplate((
IElementNode
)parentNode, node, Context, node);
112
if (parentNode is
IElementNode
&& propertyName != XmlName.Empty)
114
bpRef = GetBindablePropertyReference(Context.Variables[(
IElementNode
)parentNode], propertyName.NamespaceURI, ref localName, out _, Context, node);
115
propertyRef = Context.Variables[(
IElementNode
)parentNode].VariableType.GetProperty(Context.Cache, pd => pd.Name == localName, out declaringTypeReference);
129
if (parentNode is
IElementNode
&& ((
IElementNode
)parentNode).SkipProperties.Contains(propertyName))
132
Context.IL.Append(SetPropertyValue(Context.Variables[(
IElementNode
)parentNode], propertyName, node, Context, node));
134
else if (IsCollectionItem(node, parentNode) && parentNode is
IElementNode
)
136
var parentVar = Context.Variables[(
IElementNode
)parentNode];
149
if (parentNode is
IElementNode
&& ((
IElementNode
)parentNode).SkipProperties.Contains(propertyName))
151
Context.IL.Append(SetPropertyValue(Context.Variables[(
IElementNode
)parentNode], name, node, Context, node));
170
throw new BuildException(BuildExceptionCode.ContentPropertyAttributeMissing, node, null, ((
IElementNode
)parentNode).XmlType.Name);
180
var parent = Context.Variables[((
IElementNode
)parentNode.Parent)];
184
if (parentNode is
IElementNode
&& ((
IElementNode
)parentNode).SkipProperties.Contains(propertyName))
221
if (!(parentNode is
IElementNode
parentElement))
442
IElementNode
n = node;
449
IElementNode
skipNode = null;
574
static
IElementNode
GetParent(
IElementNode
node)
578
{ Parent: ListNode { Parent:
IElementNode
parentNode } } => parentNode,
579
{ Parent:
IElementNode
parentNode } => parentNode,
587
return GetParent(node) is
IElementNode
parentNode
593
bool DoesNotInheritDataType(
IElementNode
node)
595
return GetParent(node) is
IElementNode
parentNode
1113
return SetDynamicResource(parent, bpRef, valueNode as
IElementNode
, iXmlLineInfo, context);
1117
return SetBinding(parent, bpRef, valueNode as
IElementNode
, iXmlLineInfo, context);
1274
var
elementNode = valueNode as
IElementNode
;
1279
if (!context.Variables.TryGetValue(valueNode as
IElementNode
, out varValue))
1284
static IEnumerable<Instruction> SetDynamicResource(VariableDefinition parent, FieldReference bpRef,
IElementNode
elementNode, IXmlLineInfo iXmlLineInfo, ILContext context)
1311
if (!(valueNode is
IElementNode
elementNode))
1314
if (!context.Variables.TryGetValue(valueNode as
IElementNode
, out VariableDefinition varValue))
1323
static IEnumerable<Instruction> SetBinding(VariableDefinition parent, FieldReference bpRef,
IElementNode
elementNode, IXmlLineInfo iXmlLineInfo, ILContext context)
1353
if (!(node is
IElementNode
elementNode))
1393
var
elementNode = node as
IElementNode
;
1493
var
elementNode = node as
IElementNode
;
1557
var
elementNode = node as
IElementNode
;
1615
if (!(valueNode is
IElementNode
elementNode))
1645
static bool CanAddToResourceDictionary(VariableDefinition parent, TypeReference collectionType,
IElementNode
node, IXmlLineInfo lineInfo, ILContext context)
1675
var
elementNode = node as
IElementNode
;
1700
static IEnumerable<Instruction> AddToResourceDictionary(VariableDefinition parent,
IElementNode
node, IXmlLineInfo lineInfo, ILContext context)
1748
static void SetDataTemplate(
IElementNode
parentNode, ElementNode node, ILContext parentContext,
SetResourcesVisitor.cs (15)
27
if (!IsResourceDictionary((
IElementNode
)parentNode))
46
Context.IL.Append(SetPropertiesVisitor.SetPropertyValue(Context.Variables[(
IElementNode
)parentNode], propertyName, node, Context, node));
52
if (parentNode is
IElementNode
53
&& IsResourceDictionary((
IElementNode
)parentNode)
54
&& !((
IElementNode
)parentNode).Properties.ContainsKey(XmlName.xKey))
57
&& IsResourceDictionary((
IElementNode
)parentNode.Parent)
58
&& !((
IElementNode
)parentNode.Parent).Properties.ContainsKey(XmlName.xKey))
70
public bool IsResourceDictionary(ElementNode node) => IsResourceDictionary((
IElementNode
)node);
72
bool IsResourceDictionary(
IElementNode
node)
74
var parentVar = Context.Variables[(
IElementNode
)node];
84
if (parentNode is
IElementNode
85
&& IsResourceDictionary((
IElementNode
)parentNode)
86
&& !((
IElementNode
)parentNode).Properties.ContainsKey(XmlName.xKey))
89
&& IsResourceDictionary((
IElementNode
)parentNode.Parent)
90
&& !((
IElementNode
)parentNode.Parent).Properties.ContainsKey(XmlName.xKey))
Microsoft.Maui.Controls.Xaml (67)
ApplyPropertiesVisitor.cs (9)
51
var
parentElement = parentNode as
IElementNode
;
69
else if (IsCollectionItem(node, parentNode) && parentNode is
IElementNode
)
101
var
parentElement = parentNode as
IElementNode
;
109
parentElement = parentNode as
IElementNode
;
127
else if (IsCollectionItem(node, parentNode) && parentNode is
IElementNode
)
184
xpe = xpe ?? new XamlParseException($"Cannot set the content of {((
IElementNode
)parentNode).XmlType.Name} as it doesn't have a ContentPropertyAttribute", node);
349
var xKey = node is
IElementNode
eNode && eNode.Properties.ContainsKey(XmlName.xKey) ? ((ValueNode)eNode.Properties[XmlName.xKey]).Value as string : null;
CreateValuesVisitor.cs (8)
163
if (value is BindableObject bindableValue && node.NameScopeRef != (parentNode as
IElementNode
)?.NameScopeRef)
202
bool ValidateCtorArguments(Type nodeType,
IElementNode
node, out string missingArgName)
229
public object CreateFromParameterizedConstructor(Type nodeType,
IElementNode
node)
241
public object CreateFromFactory(Type nodeType,
IElementNode
node)
284
public object[] CreateArgumentsArray(
IElementNode
enode)
306
public object[] CreateArgumentsArray(
IElementNode
enode, ConstructorInfo ctorInfo)
333
static bool IsXaml2009LanguagePrimitive(
IElementNode
node) => node.NamespaceURI == XamlParser.X2009Uri;
335
static object CreateLanguagePrimitive(Type nodeType,
IElementNode
node)
ExpandMarkupsVisitor.cs (6)
46
var
parentElement = parentNode as
IElementNode
;
56
var
node =
57
ParseExpression(ref markupString, markupnode.NamespaceResolver, markupnode, markupnode, parentNode) as
IElementNode
;
60
((
IElementNode
)parentNode).Properties[propertyName] = node;
117
IElementNode
_node;
FillResourceDictionariesVisitor.cs (11)
30
if (!Context.Types.TryGetValue((
IElementNode
)parentNode, out var type) || !typeof(ResourceDictionary).IsAssignableFrom(type))
58
if (parentNode is
IElementNode
59
&& Context.Types.TryGetValue((
IElementNode
)parentNode, out var parentType)
61
&& !((
IElementNode
)parentNode).Properties.ContainsKey(XmlName.xKey))
64
&& typeof(ResourceDictionary).IsAssignableFrom(Context.Types[((
IElementNode
)parentNode.Parent)])
65
&& !((
IElementNode
)parentNode.Parent).Properties.ContainsKey(XmlName.xKey))
81
if (parentNode is
IElementNode
82
&& Context.Types.TryGetValue((
IElementNode
)parentNode, out var parentType)
84
&& !((
IElementNode
)parentNode).Properties.ContainsKey(XmlName.xKey))
87
&& typeof(ResourceDictionary).IsAssignableFrom(Context.Types[((
IElementNode
)parentNode.Parent)])
88
&& !((
IElementNode
)parentNode.Parent).Properties.ContainsKey(XmlName.xKey))
HydrationContext.cs (2)
12
Types = new Dictionary<
IElementNode
, Type>();
16
public Dictionary<
IElementNode
, Type> Types { get; }
NamescopingVisitor.cs (1)
36
if (parentNode is
IElementNode
parentElement
NodeExtensions.cs (1)
9
if (parentNode is not
IElementNode
parentElement)
PruneIgnoredNodesVisitor.cs (3)
45
var propNs = (propertyKvp.Value as
IElementNode
)?.NamespaceURI ?? "";
53
var propNs = (prop as
IElementNode
)?.NamespaceURI ?? "";
79
var propNs = (prop as
IElementNode
)?.NamespaceURI ?? "";
RegisterXNamesVisitor.cs (2)
31
((
IElementNode
)parentNode).NameScopeRef.NameScope.RegisterName((string)node.Value, Values[parentNode]);
76
=> parentNode is
IElementNode
parentElement && parentElement.Properties.TryGetValue(XmlName.xName, out INode xNameNode) && xNameNode == node;
SimplifyOnPlatformVisitor.cs (3)
57
if (parentNode is
IElementNode
parentEnode)
64
if (parentNode is
IElementNode
parentEnode)
73
if (parentNode is
IElementNode
parentEnode)
SimplifyTypeExtensionVisitor.cs (1)
35
(parentNode as
IElementNode
).Properties[propertyName] = typeNameValueNode;
XamlLoader.cs (2)
164
var
rNode = (
IElementNode
)rootNode;
XamlNode.cs (1)
195
if (parentNode is
IElementNode
parentElement &&
XamlParser.cs (3)
52
static void ParseXamlElementFor(
IElementNode
node, XmlReader reader)
171
((
IElementNode
)node).Properties.AddRange(attributes);
174
ParseXamlElementFor((
IElementNode
)node, reader);
XamlServiceProvider.cs (14)
39
if (node is
IElementNode
elementNode)
106
if (n.Parent is
IElementNode
)
272
if ((value = (n as
IElementNode
)?.NameScopeRef.NameScope?.FindByName(name)) != null)
303
public XamlDataTypeProvider(
IElementNode
node, HydrationContext context)
308
static
IElementNode
GetParent(
IElementNode
node)
312
{ Parent: ListNode { Parent:
IElementNode
parentNode } } => parentNode,
313
{ Parent:
IElementNode
parentNode } => parentNode,
318
static bool IsBindingContextBinding(
IElementNode
node)
327
static bool DoesNotInheritDataType(
IElementNode
node, HydrationContext context)
330
&& node.Parent is
IElementNode
parent
343
IElementNode
n = node as
IElementNode
;
350
IElementNode
skipNode = null;