Beispiel #1
0
 //-------------------------------------------------------------
 public override void UpdateLike(DTO_Like like)
 //-------------------------------------------------------------
 {
     if (!Likes.Contains(like.address))
     {
         Likes.Add(like.address);
         label_likes.Text = Likes.Count.ToString("D2");
     }
 }
Beispiel #2
0
        //-------------------------------------------------------------
        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);
        }
Beispiel #3
0
        //-------------------------------------------------------------
        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
        }
Beispiel #4
0
        //-------------------------------------------------------------
        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);