Exemplo n.º 1
0
        private void toolStripButtonAddNew_Click(object sender, EventArgs e)
        {
            if (this.Type == null) { MessageBox.Show("参数文件尚未初始化!请手动添加一个参数。"); }
            var newObj = Activator.CreateInstance(this.Type);
            DisplayPropertyEditForm form = new DisplayPropertyEditForm(newObj);

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.Parameters.Add(newObj);
                ObjToUi();
                this.IsChangeSaved = false;
                //this.Object.Add(form.Object);
                SaveChanges();
            }
        }
Exemplo n.º 2
0
        private void EditCurrent()
        {
            var obj = Geo.Utils.DataGridViewUtil.GetSelectedObject(this.dataGridView1);
            if (obj == null)
            {
                MessageBox.Show("请选中后再试!");
                return;
            }

            DisplayPropertyEditForm form = new DisplayPropertyEditForm(obj);
            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                ObjToUi();
                this.IsChangeSaved = false;
                //this.Object.Add(form.Object);
                SaveChanges();
            }
        }