Ejemplo n.º 1
0
 /// <summary>
 ///     Write accelerator to a binary stream.
 /// </summary>
 /// <param name="w">Binary stream.</param>
 internal void Write(BinaryWriter w)
 {
     w.Write(_accel.fVirt);
     w.Write(_accel.key);
     w.Write(_accel.cmd);
     ResourceUtil.PadToWORD(w);
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     Write a hardware-independent icon resource to a binary stream.
 /// </summary>
 /// <param name="w">Binary stream.</param>
 internal override void Write(BinaryWriter w)
 {
     w.Write(_header.wReserved);
     w.Write(_header.wType);
     w.Write((UInt16)_icons.Count);
     ResourceUtil.PadToWORD(w);
     foreach (var icon in _icons)
     {
         icon.Write(w);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     Write icon resource data to a binary stream.
 /// </summary>
 /// <param name="w">Binary stream.</param>
 internal override void Write(BinaryWriter w)
 {
     w.Write(_header.bWidth);
     w.Write(_header.bHeight);
     w.Write(_header.bColors);
     w.Write(_header.bReserved);
     w.Write(_header.wPlanes);
     w.Write(_header.wBitsPerPixel);
     w.Write(_header.dwImageSize);
     w.Write(_header.nID);
     ResourceUtil.PadToWORD(w);
 }
Ejemplo n.º 4
0
 internal virtual void Write(BinaryWriter w)
 {
     // menu string
     if (_menuString == null)
     {
         w.Write((UInt16)0);
     }
     else
     {
         w.Write(Encoding.Unicode.GetBytes(_menuString));
         w.Write((UInt16)0);
         ResourceUtil.PadToWORD(w);
     }
 }
Ejemplo n.º 5
0
 internal static void WriteResourceId(BinaryWriter w, ResourceId rc)
 {
     if (rc == null)
     {
         w.Write((UInt16)0);
     }
     else if (rc.IsIntResource())
     {
         w.Write((UInt16)0xFFFF);
         w.Write((UInt16)rc.Id);
     }
     else
     {
         ResourceUtil.PadToWORD(w);
         w.Write(Encoding.Unicode.GetBytes(rc.Name));
         w.Write((UInt16)0);
     }
 }
        /// <summary>
        ///     Write the dialog control to a binary stream.
        /// </summary>
        /// <param name="w">Binary stream.</param>
        public virtual void Write(BinaryWriter w)
        {
            // control class
            DialogTemplateUtil.WriteResourceId(w, _controlClassId);
            // caption
            DialogTemplateUtil.WriteResourceId(w, _captionId);

            if (_creationData == null)
            {
                w.Write((UInt16)0);
            }
            else
            {
                ResourceUtil.PadToWORD(w);
                w.Write((UInt16)_creationData.Length);
                w.Write(_creationData);
            }
        }