// 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: 0x060020F1 RID: 8433 RVA: 0x00097790 File Offset: 0x00095990
        public void WriteEndComplexProperty()
        {
            this.VerifyWriteState();
            BamlRecordType bamlRecordType = this.Pop();

            switch (bamlRecordType)
            {
            case BamlRecordType.PropertyComplexStart:
            {
                int lineNumber   = 0;
                int linePosition = 0;
                int depth        = this._depth - 1;
                this._depth = depth;
                XamlPropertyComplexEndNode xamlPropertyComplexEnd = new XamlPropertyComplexEndNode(lineNumber, linePosition, depth);
                this._bamlRecordWriter.WritePropertyComplexEnd(xamlPropertyComplexEnd);
                goto IL_11F;
            }

            case BamlRecordType.PropertyArrayStart:
            {
                int lineNumber2   = 0;
                int linePosition2 = 0;
                int depth         = this._depth - 1;
                this._depth = depth;
                XamlPropertyArrayEndNode xamlPropertyArrayEndNode = new XamlPropertyArrayEndNode(lineNumber2, linePosition2, depth);
                this._bamlRecordWriter.WritePropertyArrayEnd(xamlPropertyArrayEndNode);
                goto IL_11F;
            }

            case BamlRecordType.PropertyIListStart:
            {
                int lineNumber3   = 0;
                int linePosition3 = 0;
                int depth         = this._depth - 1;
                this._depth = depth;
                XamlPropertyIListEndNode xamlPropertyIListEndNode = new XamlPropertyIListEndNode(lineNumber3, linePosition3, depth);
                this._bamlRecordWriter.WritePropertyIListEnd(xamlPropertyIListEndNode);
                goto IL_11F;
            }

            case BamlRecordType.PropertyIDictionaryStart:
            {
                int lineNumber4   = 0;
                int linePosition4 = 0;
                int depth         = this._depth - 1;
                this._depth = depth;
                XamlPropertyIDictionaryEndNode xamlPropertyIDictionaryEndNode = new XamlPropertyIDictionaryEndNode(lineNumber4, linePosition4, depth);
                this._bamlRecordWriter.WritePropertyIDictionaryEnd(xamlPropertyIDictionaryEndNode);
                goto IL_11F;
            }
            }
            throw new InvalidOperationException(SR.Get("BamlWriterBadScope", new object[]
            {
                bamlRecordType.ToString(),
                BamlRecordType.PropertyComplexEnd.ToString()
            }));
IL_11F:
            this._parserContext.PopScope();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Write the end of the complex property
        /// </summary>
        public void WriteEndComplexProperty()
        {
            VerifyWriteState();

            // The type of end record written depends on what the start record
            // was.  This is held on the _nodeTypeStack
            BamlRecordType startTagType = Pop();

            switch (startTagType)
            {
                case BamlRecordType.PropertyArrayStart:
                    XamlPropertyArrayEndNode arrayEnd = 
                                      new XamlPropertyArrayEndNode(
                                                  0, 
                                                  0, 
                                                  --_depth);
                    _bamlRecordWriter.WritePropertyArrayEnd(arrayEnd);
                    break;
                    
                case BamlRecordType.PropertyIListStart:
                    XamlPropertyIListEndNode listEnd = 
                                      new XamlPropertyIListEndNode(
                                                  0, 
                                                  0, 
                                                  --_depth);
                    _bamlRecordWriter.WritePropertyIListEnd(listEnd);
                    break;
        
                case BamlRecordType.PropertyIDictionaryStart:
                    XamlPropertyIDictionaryEndNode dictionaryEnd = 
                                      new XamlPropertyIDictionaryEndNode(
                                                  0, 
                                                  0, 
                                                  --_depth);
                    _bamlRecordWriter.WritePropertyIDictionaryEnd(dictionaryEnd);
                    break;
                    
                case BamlRecordType.PropertyComplexStart:
                    XamlPropertyComplexEndNode complexEnd = 
                                       new XamlPropertyComplexEndNode(
                                                  0, 
                                                  0, 
                                                  --_depth);
                    _bamlRecordWriter.WritePropertyComplexEnd(complexEnd);
                    break;

                default:
                    throw new InvalidOperationException(
                                    SR.Get(SRID.BamlWriterBadScope,
                                           startTagType.ToString(),
                                           BamlRecordType.PropertyComplexEnd.ToString()));
            }                        
            _parserContext.PopScope();
        }