//------------------------------------------------------------- public override void UpdateLike(DTO_Like like) //------------------------------------------------------------- { if (!Likes.Contains(like.address)) { Likes.Add(like.address); label_likes.Text = Likes.Count.ToString("D2"); } }
//------------------------------------------------------------- public void SendLike(DTO_Like like) //------------------------------------------------------------- { //Send packet to LAN Log.Get().Write("Communication client prepare to send like"); communication.ClientSend(like); //Update own GUI with like GotLike(like); }
//------------------------------------------------------------- private void button_like_Click(object sender, EventArgs e) //------------------------------------------------------------- { button_like.Enabled = false; DTO_Like like = new DTO_Like() { address = Helper.GetHostIP(), key = GetKey() }; kobberLan.SendLike(like); // Parent.Parent.Parent => Flow.Groupbox.Form }
//------------------------------------------------------------- public void GotLike(DTO_Like like) //------------------------------------------------------------- { SuggestedGame suggestedGameControl = suggestedGames.Where(L => L.GetKey().Equals(like.key)).FirstOrDefault(); if (suggestedGameControl == null) { Log.Get().Write("KobberLan DTO_Like unknown title: " + like.key, Log.LogType.Error); } else { suggestedGameControl.UpdateLike(like); } }
//------------------------------------------------------------- public abstract void UpdateLike(DTO_Like like);