// Token: 0x06006EB1 RID: 28337 RVA: 0x001FCAE4 File Offset: 0x001FACE4 private static bool GetBamlTreeNodeFromXmlNode(BamlLocalizableResourceKey key, XmlNode node, BamlTreeUpdater.BamlTreeUpdateMap bamlTreeMap, IList <BamlTreeNode> newChildrenList) { if (node.NodeType == XmlNodeType.Text) { return(BamlTreeUpdater.GetBamlTreeNodeFromText(key, node.Value, bamlTreeMap, newChildrenList)); } if (node.NodeType != XmlNodeType.Element) { return(true); } XmlElement xmlElement = node as XmlElement; string text = bamlTreeMap.Resolver.ResolveFormattingTagToClass(xmlElement.Name); bool flag = string.IsNullOrEmpty(text); string text2 = null; if (!flag) { text2 = bamlTreeMap.Resolver.ResolveAssemblyFromClass(text); flag = string.IsNullOrEmpty(text2); } if (flag) { bamlTreeMap.Resolver.RaiseErrorNotifyEvent(new BamlLocalizerErrorNotifyEventArgs(key, BamlLocalizerError.UnknownFormattingTag)); return(false); } string text3 = null; if (xmlElement.HasAttributes) { text3 = xmlElement.GetAttribute("Uid"); if (!string.IsNullOrEmpty(text3)) { text3 = BamlResourceContentUtil.UnescapeString(text3); } } BamlStartElementNode bamlStartElementNode = null; if (text3 != null) { bamlStartElementNode = bamlTreeMap.MapUidToBamlTreeElementNode(text3); } if (bamlStartElementNode == null) { bamlStartElementNode = new BamlStartElementNode(text2, text, false, false); if (text3 != null) { bamlTreeMap.AddBamlTreeNode(text3, new BamlLocalizableResourceKey(text3, text, "$Content", text2), bamlStartElementNode); bamlStartElementNode.AddChild(new BamlDefAttributeNode("Uid", text3)); } BamlTreeUpdater.TryAddContentPropertyToNewElement(bamlTreeMap, bamlStartElementNode); bamlStartElementNode.AddChild(new BamlEndElementNode()); } else if (bamlStartElementNode.TypeFullName != text) { bamlTreeMap.Resolver.RaiseErrorNotifyEvent(new BamlLocalizerErrorNotifyEventArgs(key, BamlLocalizerError.DuplicateUid)); return(false); } newChildrenList.Add(bamlStartElementNode); bool flag2 = true; if (xmlElement.HasChildNodes) { IList <BamlTreeNode> list = new List <BamlTreeNode>(); int num = 0; while (num < xmlElement.ChildNodes.Count && flag2) { flag2 = BamlTreeUpdater.GetBamlTreeNodeFromXmlNode(key, xmlElement.ChildNodes[num], bamlTreeMap, list); num++; } if (flag2) { BamlTreeUpdater.MergeChildrenList(key, bamlTreeMap, bamlStartElementNode, list); } } return(flag2); }
// Token: 0x06006EAD RID: 28333 RVA: 0x001FC7A0 File Offset: 0x001FA9A0 private static void ReArrangeChildren(BamlLocalizableResourceKey key, BamlTreeNode node, string translation, BamlTreeUpdater.BamlTreeUpdateMap treeMap) { IList <BamlTreeNode> newChildren = BamlTreeUpdater.SplitXmlContent(key, translation, treeMap); BamlTreeUpdater.MergeChildrenList(key, treeMap, node, newChildren); }