/// <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); }
/// <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)); }
/// <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; } }
/// <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; } }