Ejemplo n.º 1
0
        /// <summary>
        /// Reads section keys information which can be used to match "ref lib" component names into
        /// usable compound storage section names.
        /// <para>
        /// Data read can be accessed through the <see cref="GetSectionKeyFromRefName"/> method.
        /// </para>
        /// </summary>
        private void ReadSectionKeys()
        {
            SectionKeys.Clear();

            var data = Cf.TryGetStream("SectionKeys");

            if (data == null)
            {
                return;
            }

            BeginContext("SectionKeys");

            using (var reader = data.GetBinaryReader())
            {
                var parameters = ReadBlock(reader, size => ReadParameters(reader, size));
                var keyCount   = parameters["KEYCOUNT"].AsIntOrDefault();
                for (int i = 0; i < keyCount; ++i)
                {
                    var libRef     = parameters[$"LIBREF{i}"].AsString();
                    var sectionKey = parameters[$"SECTIONKEY{i}"].AsString();
                    SectionKeys.Add(libRef, sectionKey);
                }
            }

            EndContext();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Reads section keys information which can be used to match "ref lib" component names into
        /// usable compound storage section names.
        /// <para>
        /// Data read can be accessed through the <see cref="GetSectionKeyFromRefName"/> method.
        /// </para>
        /// </summary>
        private void ReadSectionKeys()
        {
            SectionKeys.Clear();

            var data = Cf.TryGetStream("SectionKeys");

            if (data == null)
            {
                return;
            }

            BeginContext("SectionKeys");

            using (var reader = data.GetBinaryReader())
            {
                var keyCount = reader.ReadInt32();
                for (int i = 0; i < keyCount; ++i)
                {
                    var libRef     = ReadPascalString(reader);
                    var sectionKey = ReadStringBlock(reader);
                    SectionKeys.Add(libRef, sectionKey);
                }
            }

            EndContext();
        }