private void Save(object sender, EventArgs e) { if (!view.Validate()) { MessageBoxUtilities.ShowWarning(Resources.ViewNotValidated); DialogResult = DialogResult.None; return; } try { for (var i = 0; i < view.RowCount && i < Points.Count; ++i) { var point = Points[i]; var row = view.Rows[i]; point.Description = row.GetValue <string>(DescriptionColumn); point.AutoManual = row.GetValue <AutoManual>(AutoManualColumn); point.Value = TViewUtilities.GetVariableValue(row, ValueColumn, UnitColumn, RangeColumn, CustomUnits); point.Label = row.GetValue <string>(LabelColumn); } } catch (Exception exception) { MessageBoxUtilities.ShowException(exception); DialogResult = DialogResult.None; return; } DialogResult = DialogResult.OK; Close(); }
public void ExternalSaveValue(int pos, DataGridViewRow erow) { try { for (var i = 0; i < view.RowCount && i < Points.Count; ++i) { var point = Points[i]; var row = erow; if (i == pos) { point.Value = TViewUtilities.GetVariableValue(row, ValueColumn, UnitColumn, RangeColumn, CustomUnits); } } } catch (Exception exception) { MessageBoxUtilities.ShowException(exception); } }