예제 #1
0
        private short AddAssembly(BamlAssemblyInfo asembly)
        {
            short assemblyId = (short)_assemblyToID.Count;

            _assemblyToID.Add(asembly, assemblyId);

            return(assemblyId);
        }
예제 #2
0
        private void WriteAssemblyInfo(BamlAssemblyInfo record)
        {
            BeginVarSize();

            short asssemblyId = AddAssembly(record);

            _blob.Write(ref _pos, (short)asssemblyId);
            _blob.WriteLengthPrefixedString(ref _pos, record.Name);

            WriteVarSize(RecordType.AssemblyInfo);
        }
예제 #3
0
        private void ReadAssemblyInfo()
        {
            ReadRecordSize();

            var node = new BamlAssemblyInfo();

            short assemblyId = _accessor.ReadInt16();

            node.Name = _accessor.ReadLengthPrefixedString(Encoding.UTF8);

            AddAssembly(assemblyId, node);
            AddNode(node);
        }
예제 #4
0
        private void AddAssembly(short assemblyId, BamlAssemblyInfo assembly)
        {
            int assemblyCount = _assemblies.Count;

            if (assemblyId > assemblyCount)
            {
                throw new BamlException(SR.BamlLoadError);
            }

            if (assemblyId == assemblyCount)
            {
                _assemblies.Add(assembly);
            }
        }