Example #1
0
 public void Update(IMessage message)
 {
     if (message is Disappeared)
     {
         Disappeared disappeared = message as Disappeared;
         this.otherClients.Remove(disappeared.ID);
         this.panel.Invalidate();
         return;
     }
     if (message is Position2DUpdated)
     {
         Position2DUpdated         position2DUpdated = message as Position2DUpdated;
         VirtualClient.OtherClient otherClient;
         if (this.otherClients.TryGetValue(position2DUpdated.ID, out otherClient))
         {
             otherClient.x = position2DUpdated.X;
             otherClient.y = position2DUpdated.Y;
         }
         else
         {
             this.otherClients[position2DUpdated.ID] = new VirtualClient.OtherClient
             {
                 id = position2DUpdated.ID,
                 x  = position2DUpdated.X,
                 y  = position2DUpdated.Y
             };
         }
         if (position2DUpdated.ID == this.ID)
         {
             Console.WriteLine("Receive my Pos : {0} ({1},{2}), ({3},{4})", new object[]
             {
                 this.ID,
                 this.x,
                 this.y,
                 position2DUpdated.X,
                 position2DUpdated.Y
             });
         }
         this.panel.Invalidate();
     }
 }
Example #2
0
 internal void InvokeDisappeared()
 {
     Disappeared?.Invoke(this, new PageDisappearedEventArgs());
 }
Example #3
0
 public override void RunDismissalAnimation() => Disappeared?.Invoke();