Exemplo n.º 1
0
        /// <summary>
        /// Read a string table.
        /// </summary>
        /// <param name="lpRes">Pointer to the beginning of the string table.</param>
        /// <returns>Pointer to the end of the string table.</returns>
        internal override IntPtr Read(IntPtr lpRes)
        {
            _strings.Clear();
            IntPtr pChild = base.Read(lpRes);

            while (pChild.ToInt32() < (lpRes.ToInt32() + _header.wLength))
            {
                StringTableEntry res = new StringTableEntry(pChild);
                _strings.Add(res.Key, res);
                pChild = ResourceUtil.Align(pChild.ToInt32() + res.Header.wLength);
            }

            return new IntPtr(lpRes.ToInt32() + _header.wLength);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Read a string table.
        /// </summary>
        /// <param name="lpRes">Pointer to the beginning of the string table.</param>
        /// <returns>Pointer to the end of the string table.</returns>
        internal override IntPtr Read(IntPtr lpRes)
        {
            _strings.Clear();
            IntPtr pChild = base.Read(lpRes);

            while (pChild.ToInt32() < (lpRes.ToInt32() + _header.wLength))
            {
                StringTableEntry res = new StringTableEntry(pChild);
                _strings.Add(res.Key, res);
                pChild = ResourceUtil.Align(pChild.ToInt32() + res.Header.wLength);
            }

            return(new IntPtr(lpRes.ToInt32() + _header.wLength));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Returns an entry within the string table.
        /// </summary>
        /// <param name="key">Key.</param>
        /// <returns>An entry within the string table.</returns>
        public string this[string key]
        {
            get
            {
                return(_strings[key].Value);
            }
            set
            {
                StringTableEntry sr = null;
                if (!_strings.TryGetValue(key, out sr))
                {
                    sr = new StringTableEntry(key);
                    _strings.Add(key, sr);
                }

                sr.Value = value;
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Returns an entry within the string table.
        /// </summary>
        /// <param name="key">Key.</param>
        /// <returns>An entry within the string table.</returns>
        public string this[string key]
        {
            get
            {
                return _strings[key].Value;
            }
            set
            {
                StringTableEntry sr = null;
                if (!_strings.TryGetValue(key, out sr))
                {
                    sr = new StringTableEntry(key);
                    _strings.Add(key, sr);
                }

                sr.Value = value;
            }
        }