public void WriteOptionalMemoryImage(MemoryImage image) { if (image == null) { Write(false); } else { Write(true); image.Save(this); } }
public override void Save(DataWriter writer) { base.Save(writer); writer.Write(CRC); if (writer.Version >= 76) { // We start with a boolean indicating whether it is an image (true) or string (false) if (m_Image != null) { writer.Write(true); m_Image.Save(writer); } else { writer.Write(false); writer.Write(m_ResourceName); } } else { m_Image.Save(writer); } }