// Token: 0x060020B2 RID: 8370 RVA: 0x00096920 File Offset: 0x00094B20
        internal override void Copy(BamlRecord record)
        {
            base.Copy(record);
            BamlStringInfoRecord bamlStringInfoRecord = (BamlStringInfoRecord)record;

            bamlStringInfoRecord._value = this._value;
        }
예제 #2
0
        // Token: 0x06001EC5 RID: 7877 RVA: 0x00093A70 File Offset: 0x00091C70
        internal BamlRecord ReadNextRecord(BinaryReader bamlBinaryReader, long bytesAvailable, BamlRecordType recordType)
        {
            BamlRecord bamlRecord;

            switch (recordType)
            {
            case BamlRecordType.AssemblyInfo:
                bamlRecord = new BamlAssemblyInfoRecord();
                goto IL_A6;

            case BamlRecordType.TypeInfo:
                bamlRecord = new BamlTypeInfoRecord();
                goto IL_A6;

            case BamlRecordType.TypeSerializerInfo:
                bamlRecord = new BamlTypeInfoWithSerializerRecord();
                goto IL_A6;

            case BamlRecordType.AttributeInfo:
                bamlRecord = new BamlAttributeInfoRecord();
                goto IL_A6;

            case BamlRecordType.StringInfo:
                bamlRecord = new BamlStringInfoRecord();
                goto IL_A6;

            case BamlRecordType.DefAttributeKeyString:
                bamlRecord = new BamlDefAttributeKeyStringRecord();
                goto IL_A6;

            case BamlRecordType.DefAttributeKeyType:
                bamlRecord = new BamlDefAttributeKeyTypeRecord();
                goto IL_A6;

            case BamlRecordType.KeyElementStart:
                bamlRecord = new BamlKeyElementStartRecord();
                goto IL_A6;
            }
            bamlRecord = this._readCache[(int)recordType];
            if (bamlRecord == null || bamlRecord.IsPinned)
            {
                bamlRecord = (this._readCache[(int)recordType] = this.AllocateRecord(recordType));
            }
IL_A6:
            bamlRecord.Next = null;
            if (bamlRecord != null)
            {
                if (bamlRecord.LoadRecordSize(bamlBinaryReader, bytesAvailable) && bytesAvailable >= (long)bamlRecord.RecordSize)
                {
                    bamlRecord.LoadRecordData(bamlBinaryReader);
                }
                else
                {
                    bamlRecord = null;
                }
            }
            return(bamlRecord);
        }
예제 #3
0
        // Add an already-loaded String info record to the map table.  This is generally
        // appended as the baml file is being built.  If we are loading a string 
        // into an already set up map table, just ensure that we don't try to overwrite
        // an existing record something different.
        internal void LoadStringInfoRecord(BamlStringInfoRecord record)
        { 
            Debug.Assert(StringIdMap.Count == record.StringId ||
                         record.Value == 
                         ((BamlStringInfoRecord)StringIdMap[record.StringId]).Value); 

            if (StringIdMap.Count == record.StringId) 
            {
                StringIdMap.Add(record);
            }
        } 
예제 #4
0
        // String table Map
        // This adds a new BamlStringInfoRecord to the string table for 
        // a given string.  This should NOT be called if the string already
        // is in the string table and in the known objects hash table. 
        internal Int16 AddStringInfoMap( 
            BinaryWriter binaryWriter,
            string stringValue) 
        {
            Debug.Assert(GetHashTableData(stringValue) == null,
                "Already have this String in the BamlMapTable string table");
 
            BamlStringInfoRecord stringInfo = new BamlStringInfoRecord();
            stringInfo.StringId = (short)StringIdMap.Add(stringInfo); 
            stringInfo.Value = stringValue; 

            // add to the hash 
            ObjectHashTable.Add(stringValue, stringInfo);

            // Write to BAML
            stringInfo.Write(binaryWriter); 

            // return the string id 
            return stringInfo.StringId; 
        }