示例#1
0
        // Token: 0x06001F55 RID: 8021 RVA: 0x00094A38 File Offset: 0x00092C38
        internal override void Copy(BamlRecord record)
        {
            base.Copy(record);
            BamlPresentationOptionsAttributeRecord bamlPresentationOptionsAttributeRecord = (BamlPresentationOptionsAttributeRecord)record;

            bamlPresentationOptionsAttributeRecord._name   = this._name;
            bamlPresentationOptionsAttributeRecord._nameId = this._nameId;
        }
示例#2
0
        // Read a PresentationOptions:foo="bar" record.
        protected virtual void ReadPresentationOptionsAttributeRecord(BamlPresentationOptionsAttributeRecord bamlPresentationOptionsAttributeRecord) 
        { 
            // Get the name of the attribute from the string table, and cache it in the
            // def record. 
            bamlPresentationOptionsAttributeRecord.Name = MapTable.GetStringFromStringId(
                                            bamlPresentationOptionsAttributeRecord.NameId);

            if (bamlPresentationOptionsAttributeRecord.Name == XamlReaderHelper.PresentationOptionsFreeze) 
            {
                // Handle PresentationOptions:Freeze attribute by setting 
                // a flag in the ParserContext.  When Freezables are added 
                // to the tree, they check this flag, and Freeze if required.
                bool freeze = Boolean.Parse(bamlPresentationOptionsAttributeRecord.Value); 

                _parserContext.FreezeFreezables = freeze;
            }
            else 
            {
                // You will only get this error if the XamlParser is out of [....] 
                // with the BamlRecordReader (since it should catch unknown def 
                // attributes), or if a BamlWriter was used to write
                // a bogus attribute. 
                ThrowException(SRID.ParserUnknownPresentationOptionsAttribute, bamlPresentationOptionsAttributeRecord.Name);
            }
        }