private void setRelation(User user, User myData, Tokens tokens) { this.button_Follow.Text = " Follow "; string myRelation = " Following : {0} "; string following = "false"; string userRelation = " Followed : {0} "; string followed = "false"; try { string json = this.tokens.Friendships.Lookup(user_id => this.user.Id).Json; string cleanJson = new var_dump().GetCleanJson(json); var relationship = JsonConvert.DeserializeObject <Relationship>(cleanJson); if (relationship.connections.Contains("following")) { following = "true"; this.button_Follow.Text = " UnFollow "; } if (relationship.connections.Contains("followed_by")) { followed = "true"; } this.label_MyRelation.Text = string.Format(myRelation, following); this.label_UserRelation.Text = string.Format(userRelation, followed); } catch (Exception ex) { util.ShowExceptionMessageBox(ex.Message, ex.StackTrace); } }
private void setRelation(User user, User myData, Tokens tokens) { this.button_Follow.Text = " Follow "; string myRelation = " Following : {0} "; string following = "false"; string userRelation = " Followed : {0} "; string followed = "false"; try { string json = this.tokens.Friendships.Lookup(user_id => this.user.Id).Json; string cleanJson = new var_dump().GetCleanJson(json); var relationship = JsonConvert.DeserializeObject<Relationship>(cleanJson); if (relationship.connections.Contains("following")) { following = "true"; this.button_Follow.Text = " UnFollow "; } if (relationship.connections.Contains("followed_by")) { followed = "true"; } this.label_MyRelation.Text = string.Format(myRelation, following); this.label_UserRelation.Text = string.Format(userRelation, followed); } catch(Exception ex) { util.ShowExceptionMessageBox(ex.Message, ex.StackTrace); } }