Exemplo n.º 1
0
 public static ValueStringMap UpdateValueStringMap(ValueStringMap map = null)
 {
     frm     = new UpdateValueStringMapForm();
     frm.Map = map;
     frm.ShowDialog();
     return(frm.Map);
 }
Exemplo n.º 2
0
 private bool Submit(ValueStringMap map)
 {
     if (map != null)
     {
         if (textBox1.Text != "")
         {
             int index = 1;
             // map.ClearMap();//清空列表
             Dictionary <string, string> map_temp = new Dictionary <string, string>();
             foreach (var str in textBox1.Lines)
             {
                 if (CheckStr(str))
                 {
                     var line = str.Split(ValueStringMap.Separator.ToArray());
                     try
                     {
                         map_temp.Add(int.Parse(line[0]).ToString(), line[2]);
                     }
                     catch { }
                 }
                 else
                 {
                     MessageBox.Show("第" + index + "行格式不对(提示:123=>一二三)");
                     return(false);
                 }
                 index++;
             }
             map.FillMap(map_temp);
             this.map = map;
             return(true);
         }
         else
         {
             map = null;
             return(true);
         }
     }
     return(false);
 }