/** * This is the constructor for the BuildingHandler. * It creates the internal building list and registers a callback to it. * All the buillding are also being loaded and placed into objects of the type building. */ private BuildingHandler() { _handler = DatabaseHandler.GetInstance(); this._buildings = new ObservableCollection<Building>(); this._buildings.CollectionChanged += EventBuildingCollectionChanged; LoadBuildings(); }
/** * This is the constructor for the LocationHandler. * It creates the internal floor list and registers a callback to it. */ private LocationHandler() { this._handler = DatabaseHandler.GetInstance(); this._locations = new ObservableCollection<Location>(); this._locations.CollectionChanged += EventLocationCollectionChanged; LoadLocations(); }
/** * <returns> This method will return the singleton's instance. </returns> */ public static DatabaseHandler GetInstance() { if(_handler == null) { _handler = new DatabaseHandler(); } return _handler; }