Exemplo n.º 1
0
 private void LoadData()
 {
     CityDM cityDM = new CityDM();
     var cityList = cityDM.Load();
     cityList.All(city =>
     {
         cityCodeDic.Add(city.Name, city.ID);
         cityLocationDic.Add(city.ID, new Point() { X = city.X, Y = city.Y });
         return true;
     });
 }
Exemplo n.º 2
0
 public MainForm()
 {
     InitializeComponent();
     Rectangle cloneRect = new Rectangle(0, 0, pictureBox.Image.Width, pictureBox.Image.Height);
     pictureBox.Image = (pictureBox.Image as Bitmap).Clone(cloneRect, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
     CityDM dm = new CityDM();
     var cityList = dm.Load();
     foreach (City city in cityList)
     {
         Draw(city);
     }
 }
Exemplo n.º 3
0
 public static string[] cityNames()
 {
     CityDM dm = new CityDM();
     return dm.Load().Select(city =>
     {
         return city.Name;
     }).ToArray();
 }