private void HandleBalloonStateUpdate(BalloonStateUpdateMessage bdm)
 {
     Balloon balloon = null;
     if (balloonCache.TryGetValue(bdm.BalloonID, out balloon))
     {
         balloon.OverlayType = bdm.OverlayType;
         balloon.BackgroundColor = bdm.BackgroundColor;
         balloon.Votes = bdm.Votes;
     }
 }
Beispiel #2
0
 private bool HandleBalloonStateUpdate(BalloonStateUpdateMessage bdm)
 {
     bdm.UpdateState(GetBalloon(bdm.ObjectID));
     return true;
 }
 public void OnBalloonStateUpdate(BalloonStateUpdateMessage bdm)
 {
     ClientBalloon balloon;
     if (balloons.TryGetValue(bdm.BalloonID, out balloon))
     {
         int oldVotes = balloon.Votes;
         balloon.OverlayType = bdm.OverlayType;
         balloon.BackgroundColor = bdm.BackgroundColor;
         balloon.Votes = bdm.Votes;
         // Generate the balloon's content again when the number of votes changes
         if (oldVotes != balloon.Votes)
         {
             contentBox.GenerateTextContent(balloon);
         }
     }
 }