/// <summary> /// Construct an instance from the specified tagged JSONReader stream. /// </summary> /// <param name="JSONReader">Input stream</param> /// <param name="Out">The created object</param> public static void Deserialize(JSONReader JSONReader, out JSONObject Out) { JSONReader.StartObject (); if (JSONReader.EOR) { Out = null; return; } string token = JSONReader.ReadToken (); Out = null; switch (token) { case "MailProfile" : { var Result = new MailProfile (); Result.Deserialize (JSONReader); Out = Result; break; } case "MailProfilePrivate" : { var Result = new MailProfilePrivate (); Result.Deserialize (JSONReader); Out = Result; break; } default : { throw new Exception ("Not supported"); } } JSONReader.EndObject (); }
/// <summary> /// Deserialize a tagged stream /// </summary> /// <param name="JSONReader">The input stream</param> /// <returns>The created object.</returns> public static new MailProfile FromTagged (JSONReader JSONReader) { MailProfile Out = null; JSONReader.StartObject (); if (JSONReader.EOR) { return null; } string token = JSONReader.ReadToken (); switch (token) { case "MailProfile" : { var Result = new MailProfile (); Result.Deserialize (JSONReader); Out = Result; break; } default : { //Ignore the unknown data //throw new Exception ("Not supported"); break; } } JSONReader.EndObject (); return Out; }