private void ModifyEnvVar(ListBox lb, DataGridView dgv) { var snapshot = DgvSnapshot(lb, dgv); var variable = DgvVariable(lb, dgv); if (snapshot != null && variable != null) { frmEditVariable = new FrmEditEnvVar(ref snapshot, variable); frmEditVariable.ShowDialog(); if (frmEditVariable.DialogResult == DialogResult.OK) { variable.Name = frmEditVariable.Variable.Name; variable.Value = frmEditVariable.Variable.Value; FillEnvironmentVariables(dgv, snapshot); snapshotManager.SaveSnapshot(ref snapshot); } frmEditVariable.Dispose(); } }
private void EditEnvVar(string varName, EnvironmentVariableTarget varType) { frmEditVariable = new FrmEditEnvVar(varName, varType); frmEditVariable.ShowDialog(); frmEditVariable.Dispose(); }