Exemplo n.º 1
0
        private TerrainList LoadImagesIntoImageList(string path)
        {
            string path2 = Path.Combine(Environment.CurrentDirectory, path, string.Format("{0}.txt", path));

            string[] lines = FileReader.ReadFile(path2);

            var terrainList = new TerrainList();

            foreach (string line in lines)
            {
                string[] pieces  = line.Split(':');
                var      terrain = new Terrain
                {
                    Id       = Convert.ToInt32(pieces[0]),
                    Filename = pieces[1].Replace("\"", string.Empty)
                };
                terrain.Name = Path.GetFileNameWithoutExtension(terrain.Filename);
                terrainList.Add(terrain);
            }

            return(terrainList);
        }
Exemplo n.º 2
0
 protected void TerrainButton_Click(object sender, ImageClickEventArgs e)
 {
     ActiveIndex = null;
     TerrainList.Add(new Terrain((sender as ImageButton).CommandArgument));
     BindRepeater();
 }