public void editVariable(m_Variable v_origin) { addNew = false; this.Title = "Edit Variable"; butAdd.Content = "Edit"; this.v_origin = v_origin; textBox1.Text = v_origin.name; textBox2.Text = v_origin.value.ToString(); }
void finish() { try { String name = textBox1.Text; if (name != "") { if (addNew) { m_Variable v = new m_Variable(); loadData(v); form_editor.addVariable(v, addIndex); } else { int[] loc = form_editor.getTVI_Location(self); loadData(v_origin); form_editor.reloadTree_map_variable(loc); } this.Close(); } } catch { } }
void loadData(m_Variable v) { v.name = textBox1.Text; v.value = TheTool.getInt(textBox2.Text); }