Esempio n. 1
0
        private void btOK_Click(object sender, System.EventArgs e)
        {
            int n = tbl.Rows.Count;

            obj.Clear();
            for (int i = 0; i < n; i++)
            {
                obj.SetKeyPair(tbl.Rows[i][0].ToString(), tbl.Rows[i][1].ToString());
            }
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }
Esempio n. 2
0
 public override object ConvertFrom(ITypeDescriptorContext context,
                                    CultureInfo culture, object value)
 {
     if (value is string)
     {
         string      s = value as string;
         KeyPairList l = new KeyPairList();
         while (!string.IsNullOrEmpty(s))
         {
             string keyVal = pop(ref s, PIPE);
             if (!string.IsNullOrEmpty(keyVal))
             {
                 string key = pop(ref keyVal, COLUMN);
                 if (!string.IsNullOrEmpty(key))
                 {
                     l.SetKeyPair(key, keyVal);
                 }
             }
         }
         return(l);
     }
     return(null);
 }