private void EditErrorProperty(object sender, EventArgs e) { ErrorSurfaceProperty errProp = grdRegions.SelectedRows[0].DataBoundItem as ErrorSurfaceProperty; frmRegionErrorProperty frm = new frmRegionErrorProperty(errProp.Name, errProp, DEM.AssocSurfaces.ToList(), ErrorSurface == null); if (frm.ShowDialog() == DialogResult.OK) { ErrProps.ResetBindings(); } }
public frmRegionErrorProperty(string region, ErrorSurfaceProperty errProp, List <AssocSurface> assocs, bool bEdit) { InitializeComponent(); txtRegion.Text = region; ucErrProp.InitializeExisting(errProp, assocs, bEdit); if (!bEdit) { cmdOK.Visible = false; cmdCancel.Text = "Close"; } }
public void InitializeExisting(ErrorSurfaceProperty errProp, List <AssocSurface> assocs, bool editable = true) { AssociatedSurfaces = new BindingList <AssocSurface>(assocs); ErrSurfProperty = errProp; Editable = editable; }
public void InitializeNew(string regionName, List <AssocSurface> assocs) { AssociatedSurfaces = new BindingList <AssocSurface>(assocs); ErrSurfProperty = new ErrorSurfaceProperty(regionName); Editable = true; }