Exemplo n.º 1
0
        private void WriteXmlnsProperty(BamlXmlnsProperty node)
        {
            BeginVarSize();

            _blob.WriteLengthPrefixedString(ref _pos, (string)node.Prefix);
            _blob.WriteLengthPrefixedString(ref _pos, (string)node.XmlNamespace);

            var assemblies = node.Assemblies;

            _blob.Write(ref _pos, (short)assemblies.Count);

            foreach (var assembly in assemblies)
            {
                _blob.Write(ref _pos, (short)GetAssemblyId(assembly));
            }

            WriteVarSize(RecordType.XmlnsProperty);
        }
Exemplo n.º 2
0
        private void ReadXmlnsProperty()
        {
            ReadRecordSize();

            var node = new BamlXmlnsProperty();

            node.Prefix       = _accessor.ReadLengthPrefixedString(Encoding.UTF8);
            node.XmlNamespace = _accessor.ReadLengthPrefixedString(Encoding.UTF8);

            int asssemblyCount = _accessor.ReadInt16();
            var assemblies     = node.Assemblies;

            for (int i = 0; i < asssemblyCount; i++)
            {
                assemblies.Add(GetAssembly(_accessor.ReadInt16()));
            }

            AddNode(node);
        }