// Token: 0x060021BA RID: 8634 RVA: 0x000A8248 File Offset: 0x000A6448
        internal void CompileAttribute(ArrayList xamlNodes, AttributeData data)
        {
            string fullName  = data.DeclaringType.Assembly.FullName;
            string fullName2 = data.DeclaringType.FullName;
            Type   propertyType;
            bool   propertyCanWrite;

            XamlTypeMapper.GetPropertyType(data.Info, out propertyType, out propertyCanWrite);
            XamlNode value;
            XamlNode value2;

            switch (BamlRecordManager.GetPropertyStartRecordType(propertyType, propertyCanWrite))
            {
            case BamlRecordType.PropertyArrayStart:
                value  = new XamlPropertyArrayStartNode(data.LineNumber, data.LinePosition, data.Depth, data.Info, fullName, fullName2, data.PropertyName);
                value2 = new XamlPropertyArrayEndNode(data.LineNumber, data.LinePosition, data.Depth);
                goto IL_164;

            case BamlRecordType.PropertyIListStart:
                value  = new XamlPropertyIListStartNode(data.LineNumber, data.LinePosition, data.Depth, data.Info, fullName, fullName2, data.PropertyName);
                value2 = new XamlPropertyIListEndNode(data.LineNumber, data.LinePosition, data.Depth);
                goto IL_164;

            case BamlRecordType.PropertyIDictionaryStart:
                value  = new XamlPropertyIDictionaryStartNode(data.LineNumber, data.LinePosition, data.Depth, data.Info, fullName, fullName2, data.PropertyName);
                value2 = new XamlPropertyIDictionaryEndNode(data.LineNumber, data.LinePosition, data.Depth);
                goto IL_164;
            }
            value  = new XamlPropertyComplexStartNode(data.LineNumber, data.LinePosition, data.Depth, data.Info, fullName, fullName2, data.PropertyName);
            value2 = new XamlPropertyComplexEndNode(data.LineNumber, data.LinePosition, data.Depth);
IL_164:
            xamlNodes.Add(value);
            this.CompileAttributeCore(xamlNodes, data);
            xamlNodes.Add(value2);
        }
        // Token: 0x060020F0 RID: 8432 RVA: 0x000975CC File Offset: 0x000957CC
        public void WriteStartComplexProperty(string assemblyName, string ownerTypeFullName, string propName)
        {
            this.VerifyWriteState();
            this._parserContext.PushScope();
            this.ProcessMarkupExtensionNodes();
            Type   type             = null;
            bool   propertyCanWrite = true;
            object obj;
            Type   type2;

            this.GetDpOrPi(assemblyName, ownerTypeFullName, propName, out obj, out type2);
            if (obj == null)
            {
                MethodInfo mi = this.GetMi(assemblyName, ownerTypeFullName, propName, out type2);
                if (mi != null)
                {
                    XamlTypeMapper.GetPropertyType(mi, out type, out propertyCanWrite);
                }
            }
            else
            {
                type = XamlTypeMapper.GetPropertyType(obj);
                PropertyInfo propertyInfo = obj as PropertyInfo;
                if (propertyInfo != null)
                {
                    propertyCanWrite = propertyInfo.CanWrite;
                }
                else
                {
                    DependencyProperty dependencyProperty = obj as DependencyProperty;
                    if (dependencyProperty != null)
                    {
                        propertyCanWrite = !dependencyProperty.ReadOnly;
                    }
                }
            }
            int depth;

            if (type == null)
            {
                this.Push(BamlRecordType.PropertyComplexStart);
                int lineNumber   = 0;
                int linePosition = 0;
                depth       = this._depth;
                this._depth = depth + 1;
                XamlPropertyComplexStartNode xamlComplexPropertyNode = new XamlPropertyComplexStartNode(lineNumber, linePosition, depth, null, assemblyName, ownerTypeFullName, propName);
                this._bamlRecordWriter.WritePropertyComplexStart(xamlComplexPropertyNode);
                return;
            }
            BamlRecordType propertyStartRecordType = BamlRecordManager.GetPropertyStartRecordType(type, propertyCanWrite);

            this.Push(propertyStartRecordType);
            switch (propertyStartRecordType)
            {
            case BamlRecordType.PropertyArrayStart:
            {
                int lineNumber2   = 0;
                int linePosition2 = 0;
                depth       = this._depth;
                this._depth = depth + 1;
                XamlPropertyArrayStartNode xamlPropertyArrayStartNode = new XamlPropertyArrayStartNode(lineNumber2, linePosition2, depth, obj, assemblyName, ownerTypeFullName, propName);
                this._bamlRecordWriter.WritePropertyArrayStart(xamlPropertyArrayStartNode);
                return;
            }

            case BamlRecordType.PropertyIListStart:
            {
                int lineNumber3   = 0;
                int linePosition3 = 0;
                depth       = this._depth;
                this._depth = depth + 1;
                XamlPropertyIListStartNode xamlPropertyIListStart = new XamlPropertyIListStartNode(lineNumber3, linePosition3, depth, obj, assemblyName, ownerTypeFullName, propName);
                this._bamlRecordWriter.WritePropertyIListStart(xamlPropertyIListStart);
                return;
            }

            case BamlRecordType.PropertyIDictionaryStart:
            {
                int lineNumber4   = 0;
                int linePosition4 = 0;
                depth       = this._depth;
                this._depth = depth + 1;
                XamlPropertyIDictionaryStartNode xamlPropertyIDictionaryStartNode = new XamlPropertyIDictionaryStartNode(lineNumber4, linePosition4, depth, obj, assemblyName, ownerTypeFullName, propName);
                this._bamlRecordWriter.WritePropertyIDictionaryStart(xamlPropertyIDictionaryStartNode);
                return;
            }
            }
            int lineNumber5   = 0;
            int linePosition5 = 0;

            depth       = this._depth;
            this._depth = depth + 1;
            XamlPropertyComplexStartNode xamlComplexPropertyNode2 = new XamlPropertyComplexStartNode(lineNumber5, linePosition5, depth, obj, assemblyName, ownerTypeFullName, propName);

            this._bamlRecordWriter.WritePropertyComplexStart(xamlComplexPropertyNode2);
        }
        // Token: 0x060020EB RID: 8427 RVA: 0x000970C0 File Offset: 0x000952C0
        public void WriteProperty(string assemblyName, string ownerTypeFullName, string propName, string value, BamlAttributeUsage propUsage)
        {
            this.VerifyWriteState();
            BamlRecordType bamlRecordType = this.PeekRecordType();

            if (bamlRecordType != BamlRecordType.ElementStart)
            {
                throw new InvalidOperationException(SR.Get("BamlWriterNoInElement", new object[]
                {
                    "WriteProperty",
                    bamlRecordType.ToString()
                }));
            }
            object obj;
            Type   declaringType;

            this.GetDpOrPi(assemblyName, ownerTypeFullName, propName, out obj, out declaringType);
            AttributeData attributeData = this._extensionParser.IsMarkupExtensionAttribute(declaringType, propName, ref value, 0, 0, 0, obj);

            if (attributeData == null)
            {
                XamlPropertyNode xamlPropertyNode = new XamlPropertyNode(0, 0, this._depth, obj, assemblyName, ownerTypeFullName, propName, value, propUsage, false);
                Type             propertyType     = XamlTypeMapper.GetPropertyType(obj);
                if (propertyType == typeof(DependencyProperty))
                {
                    Type declaringType2 = null;
                    this._dpProperty = XamlTypeMapper.ParsePropertyName(this._parserContext, value, ref declaringType2);
                    if (this._bamlRecordWriter != null && this._dpProperty != null)
                    {
                        short valueId;
                        short attributeOrTypeId = this._parserContext.MapTable.GetAttributeOrTypeId(this._bamlRecordWriter.BinaryWriter, declaringType2, this._dpProperty.Name, out valueId);
                        if (attributeOrTypeId < 0)
                        {
                            xamlPropertyNode.ValueId    = attributeOrTypeId;
                            xamlPropertyNode.MemberName = null;
                        }
                        else
                        {
                            xamlPropertyNode.ValueId    = valueId;
                            xamlPropertyNode.MemberName = this._dpProperty.Name;
                        }
                    }
                }
                else if (this._dpProperty != null)
                {
                    xamlPropertyNode.ValuePropertyType   = this._dpProperty.PropertyType;
                    xamlPropertyNode.ValuePropertyMember = this._dpProperty;
                    xamlPropertyNode.ValuePropertyName   = this._dpProperty.Name;
                    xamlPropertyNode.ValueDeclaringType  = this._dpProperty.OwnerType;
                    string fullName = this._dpProperty.OwnerType.Assembly.FullName;
                    this._dpProperty = null;
                }
                this._bamlRecordWriter.WriteProperty(xamlPropertyNode);
                return;
            }
            if (!attributeData.IsSimple)
            {
                this._extensionParser.CompileAttribute(this._markupExtensionNodes, attributeData);
                return;
            }
            if (attributeData.IsTypeExtension)
            {
                Type typeFromBaseString = this._xamlTypeMapper.GetTypeFromBaseString(attributeData.Args, this._parserContext, true);
                XamlPropertyWithTypeNode xamlPropertyWithType = new XamlPropertyWithTypeNode(0, 0, this._depth, obj, assemblyName, ownerTypeFullName, propName, typeFromBaseString.FullName, typeFromBaseString.Assembly.FullName, typeFromBaseString, string.Empty, string.Empty);
                this._bamlRecordWriter.WritePropertyWithType(xamlPropertyWithType);
                return;
            }
            XamlPropertyWithExtensionNode xamlPropertyNode2 = new XamlPropertyWithExtensionNode(0, 0, this._depth, obj, assemblyName, ownerTypeFullName, propName, attributeData.Args, attributeData.ExtensionTypeId, attributeData.IsValueNestedExtension, attributeData.IsValueTypeExtension);

            this._bamlRecordWriter.WritePropertyWithExtension(xamlPropertyNode2);
        }