internal static ConversationRenamedEventArgs Parse(string resultJson) { try { if (Util.IsValidJsonObjectString(resultJson)) { JObject jObjCreatedEvent = (JObject)((JObject.Parse(resultJson)).GetValue("created_event")); ConversationRenamedEventArgs e = new ConversationRenamedEventArgs( jObjCreatedEvent.SelectToken("conversation_id.id").ToString(), jObjCreatedEvent.SelectToken("sender_id.gaia_id").ToString(), jObjCreatedEvent.SelectToken("sender_id.chat_id").ToString(), long.Parse(jObjCreatedEvent.GetValue("timestamp").ToString()), jObjCreatedEvent.GetValue("event_type").ToString(), jObjCreatedEvent.GetValue("event_id").ToString(), jObjCreatedEvent.SelectToken("conversation_rename.old_name").ToString(), jObjCreatedEvent.SelectToken("conversation_rename.new_name").ToString() ); return e; } } catch (Exception ex) { throw new HangoutsException("ConversationUserAddedEventArgs.Parse : " + ex.Message + Environment.NewLine + ex.StackTrace); } return ConversationRenamedEventArgs.Empty; }
protected void OnConversationRenamed(ConversationRenamedEventArgs e) { var handler = ConversationRenamed; if (handler != null) handler(this, e); }