Ejemplo n.º 1
0
 private void client_SavePlacesCompleted(object sender, SavePlacesCompletedEventArgs e)
 {
     _placesSavedCount++;
     if (_placesSavedCount >= _placesToSaveCount)
     {
         _placesSavedCount  = 0;
         _placesToSaveCount = 0;
         ctlWait.Hide();
     }
     if (e.Result.Success)
     {
         // TODO: Display successful save.
         RdlTagCollection tags  = RdlTagCollection.FromString(e.Result.TagString);
         RdlPlace         place = e.UserState as RdlPlace;
         if (place != null)
         {
             var savedPlace = tags.GetPlaces().Where(p => p.X == place.X && p.Y == place.Y && p.Z == place.Z).FirstOrDefault();
             if (savedPlace != null)
             {
                 place = savedPlace;
             }
             var tile = _tiles.Where(t => t.Location.X == place.X &&
                                     t.Location.Y == place.Y &&
                                     t.Location.Z == place.Z).FirstOrDefault();
             if (tile != null)
             {
                 tile.IsModified = false;
                 tile.Refresh(place);
             }
         }
     }
     else
     {
         // TODO: Display error message.
     }
 }