public static void Serialize(Stream stream, SuggestionAddedNotification instance) { if (instance.Suggestion == null) { throw new ArgumentNullException("Suggestion", "Required by proto specification."); } stream.WriteByte(10); ProtocolParser.WriteUInt32(stream, instance.Suggestion.GetSerializedSize()); Suggestion.Serialize(stream, instance.Suggestion); }