public bool Load(String strFile) { try { // At least make sure the file is valid before anything TilesDataSet dsTiles = new TilesDataSet(); dsTiles.ReadXml(strFile); // Remove current tiles while (Count != 0) { RemoveTile(this[0]); } // Use this TileDataSet and load tiles m_dsTiles = dsTiles; foreach (TilesDataSet.TilesRow row in m_dsTiles.Tiles) { Tile tile = new Tile(row); m_alsTiles.Add(tile); OnTileAdded(tile); } return(true); } catch { return(false); } }
public bool Load(String strFile) { try { // At least make sure the file is valid before anything TilesDataSet dsTiles = new TilesDataSet(); dsTiles.ReadXml(strFile); // Remove current tiles while (Count != 0) RemoveTile(this[0]); // Use this TileDataSet and load tiles m_dsTiles = dsTiles; foreach (TilesDataSet.TilesRow row in m_dsTiles.Tiles) { Tile tile = new Tile(row); m_alsTiles.Add(tile); OnTileAdded(tile); } return true; } catch { return false; } }