Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 3
0
        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;
        }