private void ConstructionReportsXtraForm_Load(object sender, EventArgs e) { viewModel = (ConstructionReportViewModel)Program.Kernel.GetService(typeof(ConstructionReportViewModel)); EnumWrapper <PartType> .LoadItems(type.Properties.Items, CheckState.Checked, enabled : true, skip0 : true); EnumWrapper <ReportType> .LoadItems(reportType.Properties.Items); EnumWrapper <PartType> .LoadItems(localizedAllPartType, skip0 : true); viewModel.LoadData(); start.Properties.DataSource = viewModel.JointsProjections; end.Properties.DataSource = viewModel.JointsProjections; startKPLookUp.Properties.DataSource = viewModel.AllKP; endKPLookUp.Properties.DataSource = viewModel.AllKP; BindToViewModel(); BindCommands(); RefreshTypes(); viewModel.ReportTypeIndex = reportType.SelectedIndex = 0; tracingModeRadioGroup_SelectedIndexChanged(tracingModeRadioGroup, e); viewModel.StartPK = int.MinValue; viewModel.EndPK = int.MinValue; }
private void ConstructionReportsXtraForm_Load(object sender, EventArgs e) { infoLabel.Text = Program.LanguageManager.GetString(StringResources.ConstructionReport_TracingReportInfoLabelText); viewModel = (ConstructionReportViewModel)Program.Kernel.GetService(typeof(ConstructionReportViewModel)); foreach (var item in EnumWrapper <PartType> .EnumerateItems(skip0:true)) { type.Properties.Items.Add(item.Item1, item.Item2, CheckState.Checked, true); } foreach (var item in EnumWrapper <ReportType> .EnumerateItems()) { reportType.Properties.Items.Add(item.Item2); } viewModel.LoadData(); foreach (var joint in viewModel.Joints) { start.Properties.Items.Add(joint); end.Properties.Items.Add(joint); } foreach (var kp in viewModel.AllKP) { startKPComboBox.Properties.Items.Add(kp); endKPComboBox.Properties.Items.Add(kp); } BindToViewModel(); BindCommands(); RefreshTypes(); startKPComboBox.SelectedIndex = 0; viewModel.StartPK = (startKPComboBox.EditValue != null) ? (int)startKPComboBox.EditValue: default(int); endKPComboBox.SelectedIndex = 0; viewModel.EndPK = (endKPComboBox.EditValue != null) ? (int)endKPComboBox.EditValue : default(int); viewModel.ReportTypeIndex = reportType.SelectedIndex = 0; tracingModeRadioGroup_SelectedIndexChanged(tracingModeRadioGroup, e); }
private void ConstructionReportsXtraForm_Load(object sender, EventArgs e) { viewModel = (ConstructionReportViewModel)Program.Kernel.GetService(typeof(ConstructionReportViewModel)); EnumWrapper<PartType>.LoadItems(type.Properties.Items, CheckState.Checked, enabled: true, skip0: true); EnumWrapper<ReportType>.LoadItems(reportType.Properties.Items); EnumWrapper<PartType>.LoadItems(localizedAllPartType, skip0: true); viewModel.LoadData(); start.Properties.DataSource = viewModel.JointsProjections; end.Properties.DataSource = viewModel.JointsProjections; startKPLookUp.Properties.DataSource = viewModel.AllKP; endKPLookUp.Properties.DataSource = viewModel.AllKP; BindToViewModel(); BindCommands(); RefreshTypes(); viewModel.ReportTypeIndex = reportType.SelectedIndex = 0; tracingModeRadioGroup_SelectedIndexChanged(tracingModeRadioGroup, e); viewModel.StartPK = int.MinValue; viewModel.EndPK = int.MinValue; }