// Token: 0x060021BC RID: 8636 RVA: 0x000A85AC File Offset: 0x000A67AC internal ArrayList CompileDictionaryKeys(ArrayList complexDefAttributesList, int startingDepth) { ArrayList arrayList = new ArrayList(complexDefAttributesList.Count * 5); for (int i = 0; i < complexDefAttributesList.Count; i++) { DefAttributeData data = (DefAttributeData)complexDefAttributesList[i]; this.CompileDictionaryKey(arrayList, data); } return(arrayList); }
// Token: 0x060021C1 RID: 8641 RVA: 0x000A8C24 File Offset: 0x000A6E24 private void WriteConstructorParams(ArrayList xamlNodes, ArrayList list, DefAttributeData data, ref int listIndex) { if (list != null && listIndex < list.Count) { int lineNumber = data.LineNumber; int linePosition = data.LinePosition; int num = data.Depth + 1; data.Depth = num; xamlNodes.Add(new XamlConstructorParametersStartNode(lineNumber, linePosition, num)); while (listIndex < list.Count) { if (!(list[listIndex] is string)) { this.ThrowException("ParserMarkupExtensionBadConstructorParam", data.Args, data.LineNumber, data.LinePosition); } if (list.Count > listIndex + 1 && list[listIndex + 1] is char && (char)list[listIndex + 1] == '=') { break; } string textContent = (string)list[listIndex]; AttributeData attributeData = this.IsMarkupExtensionAttribute(data.DeclaringType, string.Empty, ref textContent, data.LineNumber, data.LinePosition, data.Depth, null); if (attributeData == null) { MarkupExtensionParser.RemoveEscapes(ref textContent); xamlNodes.Add(new XamlTextNode(data.LineNumber, data.LinePosition, data.Depth, textContent, null)); } else { this.CompileAttributeCore(xamlNodes, attributeData); } listIndex += 2; } int lineNumber2 = data.LineNumber; int linePosition2 = data.LinePosition; num = data.Depth; data.Depth = num - 1; xamlNodes.Add(new XamlConstructorParametersEndNode(lineNumber2, linePosition2, num)); } }
// Token: 0x060021BD RID: 8637 RVA: 0x000A85F0 File Offset: 0x000A67F0 internal void CompileDictionaryKey(ArrayList xamlNodes, DefAttributeData data) { ArrayList arrayList = this.TokenizeAttributes(data.Args, data.LineNumber, data.LinePosition, data.TargetType); int lineNumber = data.LineNumber; int linePosition = data.LinePosition; int num = data.Depth + 1; data.Depth = num; xamlNodes.Add(new XamlKeyElementStartNode(lineNumber, linePosition, num, data.TargetAssemblyName, data.TargetFullName, data.TargetType, null)); xamlNodes.Add(new XamlEndAttributesNode(data.LineNumber, data.LinePosition, data.Depth, true)); int listIndex = 0; if (arrayList != null && (arrayList.Count == 1 || (arrayList.Count > 1 && !(arrayList[1] is string) && (char)arrayList[1] == ','))) { this.WriteConstructorParams(xamlNodes, arrayList, data, ref listIndex); } this.WriteProperties(xamlNodes, arrayList, listIndex, data); int lineNumber2 = data.LineNumber; int linePosition2 = data.LinePosition; num = data.Depth; data.Depth = num - 1; xamlNodes.Add(new XamlKeyElementEndNode(lineNumber2, linePosition2, num)); }
// Token: 0x060020EE RID: 8430 RVA: 0x000973F4 File Offset: 0x000955F4 public void WriteDefAttribute(string name, string value) { this.VerifyWriteState(); BamlRecordType bamlRecordType = this.PeekRecordType(); if (bamlRecordType != BamlRecordType.ElementStart && name != "Uid") { throw new InvalidOperationException(SR.Get("BamlWriterNoInElement", new object[] { "WriteDefAttribute", bamlRecordType.ToString() })); } if (name == "Key") { DefAttributeData defAttributeData = this._extensionParser.IsMarkupExtensionDefAttribute(this.PeekElementType(), ref value, 0, 0, 0); if (defAttributeData != null) { if (name != "Key") { defAttributeData.IsSimple = false; } if (defAttributeData.IsSimple) { int num = defAttributeData.Args.IndexOf(':'); string prefix = string.Empty; string localName = defAttributeData.Args; if (num > 0) { prefix = defAttributeData.Args.Substring(0, num); localName = defAttributeData.Args.Substring(num + 1); } string namespaceURI = this._parserContext.XmlnsDictionary[prefix]; string empty = string.Empty; string empty2 = string.Empty; Type type = null; Type type2 = null; bool elementType = ((IParserHelper)this).GetElementType(false, localName, namespaceURI, ref empty, ref empty2, ref type, ref type2); if (elementType) { XamlDefAttributeKeyTypeNode xamlDefNode = new XamlDefAttributeKeyTypeNode(0, 0, this._depth, empty2, type.Assembly.FullName, type); this._bamlRecordWriter.WriteDefAttributeKeyType(xamlDefNode); } else { defAttributeData.IsSimple = false; DefAttributeData defAttributeData2 = defAttributeData; defAttributeData2.Args += "}"; } } if (!defAttributeData.IsSimple) { this._extensionParser.CompileDictionaryKey(this._markupExtensionNodes, defAttributeData); } return; } } XamlDefAttributeNode xamlDefNode2 = new XamlDefAttributeNode(0, 0, this._depth, name, value); this._bamlRecordWriter.WriteDefAttribute(xamlDefNode2); }
// Token: 0x060021C2 RID: 8642 RVA: 0x000A8D80 File Offset: 0x000A6F80 private void WriteProperties(ArrayList xamlNodes, ArrayList list, int listIndex, DefAttributeData data) { if (list != null && listIndex < list.Count) { ArrayList arrayList = new ArrayList(list.Count / 4); for (int i = listIndex; i < list.Count; i += 4) { if (i > list.Count - 3 || list[i + 1] is string || (char)list[i + 1] != '=') { this.ThrowException("ParserMarkupExtensionNoNameValue", data.Args, data.LineNumber, data.LinePosition); } string text = list[i] as string; text = text.Trim(); if (arrayList.Contains(text)) { this.ThrowException("ParserDuplicateMarkupExtensionProperty", text, data.LineNumber, data.LinePosition); } arrayList.Add(text); int num = text.IndexOf(':'); string text2 = (num < 0) ? text : text.Substring(num + 1); string prefix = (num < 0) ? string.Empty : text.Substring(0, num); string attributeNamespaceUri = this.ResolveAttributeNamespaceURI(prefix, text2, data.TargetNamespaceUri); object info; string text3; string text4; Type type; string text5; AttributeContext attributeContext = this.GetAttributeContext(data.TargetType, data.TargetNamespaceUri, attributeNamespaceUri, text2, out info, out text3, out text4, out type, out text5); string value = list[i + 2] as string; AttributeData attributeData = this.IsMarkupExtensionAttribute(data.TargetType, text, ref value, data.LineNumber, data.LinePosition, data.Depth, info); list[i + 2] = value; if (data.IsUnknownExtension) { return; } if (attributeData != null) { if (attributeData.IsSimple) { this.CompileProperty(xamlNodes, text, attributeData.Args, data.TargetType, data.TargetNamespaceUri, attributeData, attributeData.LineNumber, attributeData.LinePosition, attributeData.Depth); } else { this.CompileAttribute(xamlNodes, attributeData); } } else { this.CompileProperty(xamlNodes, text, (string)list[i + 2], data.TargetType, data.TargetNamespaceUri, null, data.LineNumber, data.LinePosition, data.Depth); } } } }