public void SetupForm(PipeTest current, BindingList <Category> categoryTypes, IReadOnlyList <PipeTest> pipeTestList) { this.pipeTestList = pipeTestList; viewModel = this.GetInspectionViewModel(current, categoryTypes); SetControlsTextLength(); ChangeExpected(); ChangeFrequency(); if (current != null) { this.Text = current.Name; } }
public void SetupForm(PipeTest current, BindingList<Category> categoryTypes, IReadOnlyList<PipeTest> pipeTestList, IReadOnlyList<string> usedCodes) { this.pipeTestList = pipeTestList; this.usedCodes = usedCodes; viewModel = this.GetInspectionViewModel(current, categoryTypes); SetControlsTextLength(); ChangeExpected(); ChangeFrequency(); if(current != null) { this.Text = current.Name; } }
private MillInspectionViewModel GetInspectionViewModel(PipeTest current, BindingList <Category> categoryTypes) { if (viewModel == null) { viewModel = new MillInspectionViewModel(current, categoryTypes); } else { viewModel.SetupViewModel(current, categoryTypes); } return(viewModel); }
private MillInspectionViewModel GetInspectionViewModel(PipeTest current, BindingList<Category> categoryTypes) { if(viewModel == null) { viewModel = new MillInspectionViewModel(current, categoryTypes, pipeTestList); } else { viewModel.SetupViewModel(current, categoryTypes, pipeTestList); } return viewModel; }