Example #1
0
        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();
            }
        }
Example #2
0
 private void EditEnvVar(string varName, EnvironmentVariableTarget varType)
 {
     frmEditVariable = new FrmEditEnvVar(varName, varType);
     frmEditVariable.ShowDialog();
     frmEditVariable.Dispose();
 }