public static MG_Map LoadMap(string mapPath) { string mapName = Path.GetFileNameWithoutExtension(mapPath); MG_Map map = new MG_Map(); map.SetMapName(mapName); map.SetMapPath(mapPath); StreamReader sr = new StreamReader(mapPath); // stream reader int count = Int32.Parse(sr.ReadLine()); // layerCount for (int i = 0; i < count; i++) { string layerPath = sr.ReadLine(); // layerPath MG_Layer layer = LoadShapeFile(layerPath); map.AddLayer(layer); } sr.Close(); return(map); }