Beispiel #1
0
        /// <summary>
        /// 编辑地图
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EditMap_Click(object sender, RoutedEventArgs e)
        {
            Ga_Map ga_Map = SelectMap();

            if (ga_Map == null)
            {
                return;
            }

            MapEdit map = new MapEdit(ga_Map, true);

            map.Show();
            this.Close();
        }
Beispiel #2
0
 private void MapAdd_Click(object sender, RoutedEventArgs e)
 {
     if (FormatVerification.IsFloat(mapHeight.Text.Trim()) && FormatVerification.IsFloat(mapWidth.Text.Trim()) && !string.IsNullOrEmpty(mapHeight.Text.Trim()) && !string.IsNullOrEmpty(mapWidth.Text.Trim()) && !string.IsNullOrEmpty(mapName.Text.Trim()))
     {
         MapEdit map = new MapEdit(
             new Ga_Map()
         {
             CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
             Height     = Convert.ToDouble(mapHeight.Text),
             Width      = Convert.ToDouble(mapWidth.Text),
             Name       = mapName.Text,
         }, false);
         map.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show("格式输入错误!!!", "提示", MessageBoxButton.OK, MessageBoxImage.Exclamation);
     }
 }