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; }); }
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); } }
public static string[] cityNames() { CityDM dm = new CityDM(); return dm.Load().Select(city => { return city.Name; }).ToArray(); }