private short AddAssembly(BamlAssemblyInfo asembly) { short assemblyId = (short)_assemblyToID.Count; _assemblyToID.Add(asembly, assemblyId); return(assemblyId); }
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); }
private void ReadAssemblyInfo() { ReadRecordSize(); var node = new BamlAssemblyInfo(); short assemblyId = _accessor.ReadInt16(); node.Name = _accessor.ReadLengthPrefixedString(Encoding.UTF8); AddAssembly(assemblyId, node); AddNode(node); }
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); } }