/// <summary> /// Write menu template to a binary stream. /// </summary> /// <param name="w">Binary stream.</param> internal override void Write(BinaryWriter w) { w.Write(_header.wVersion); w.Write(_header.wOffset); ResourceUtil.Pad(w, _header.wOffset); _menuItems.Write(w); }
/// <summary> /// Write the menu template. /// </summary> /// <param name="w">Binary stream.</param> internal override void Write(System.IO.BinaryWriter w) { long head = w.BaseStream.Position; // write header w.Write(_header.wVersion); w.Write(_header.wOffset); // w.Write(_header.dwHelpId); // pad to match the offset value ResourceUtil.Pad(w, (UInt16)(_header.wOffset - 4)); // seek to the beginning of the menu item per offset value // this may be behind, ie. the help id structure is part of the first popup menu w.BaseStream.Seek(head + _header.wOffset + 4, System.IO.SeekOrigin.Begin); // write menu items _menuItems.Write(w); }