public void LoadScene(string name) { try { var scene = LoadFFScene(name); var rect = new System.Windows.Shapes.Rectangle(); foreach (var item in _entitiesController.CanvasValues()) { item.Select(); } _entitiesController.DeleteSelectedEntities(); _window.RemoveEntitiesFromList(_window.dataListEntities); foreach (Entities.Entity entity in scene.entities) { entity.DeserializeData(); entity.originalImage.Name = "_" + entity.entity_id.ToString(); entity.canvas_image_data.image_id = entity.originalImage.Name; _entitiesController.AddCanvasEntity(entity.Name, entity); _entitiesController.generator.Update(); _window.AddEntityToList(entity); Canvas.SetLeft(entity.originalImage, entity.Transform.x); Canvas.SetTop(entity.originalImage, entity.Transform.y); } } catch (Exception exception) { #if DEBUG throw exception; #else MessageBox.Show("Il semblerait qu'il y ait eu une erreur durant l'ouverture de votre scène.", "Erreur d'Ouverture de scène"); #endif } finally { _entitiesController.UnselectAll(); } }