/// <summary> /// Задается количество отображаемых элементов /// </summary> /// <param name="amount">Количество отображаемых элементов</param> public void SetVisibleItemsAmount(int amount) { if (amount < 0) { amount = 0; } if (amount > lifeLengthViewers.Count) { amount = lifeLengthViewers.Count; } for (int i = 0; i < lifeLengthViewers.Count; i++) { LifelengthViewer viewer = lifeLengthViewers[i]; viewer.Visible = i < amount; } }
private void InitializeComponent() { AutoSize = true; AutoSizeMode = AutoSizeMode.GrowAndShrink; BackColor = Css.CommonAppearance.Colors.BackColor; labelTitle = new Label(); textboxTitle = new TextBox(); labelReferences = new Label(); labelTLPNo = new Label(); labelRequirement = new Label(); labelRemarks = new Label(); labelHiddenRemarks = new Label(); labelNotifyBefore = new Label(); textBoxReferences = new TextBox(); textboxTLPNo = new TextBox(); textboxReqirement = new TextBox(); lifelengthViewerNotifyBefore = new LifelengthViewer(); lifelengthViewerFrequency = new LifelengthViewer(); textboxRemarks = new TextBox(); textboxHiddenRemarks = new TextBox(); labelEngOrderNo = new Label(); textboxEngOrderNo = new TextBox(); labelJobCardNo = new Label(); textboxJobCardNo = new TextBox(); labelFrequency = new Label(); // // labelTitle // labelTitle.Font = Css.OrdinaryText.Fonts.RegularFont; labelTitle.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelTitle.Location = new Point(MARGIN, MARGIN); labelTitle.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelTitle.Text = "Title"; // // textboxTitle // textboxTitle.ScrollBars = ScrollBars.Vertical; textboxTitle.BackColor = Color.White; textboxTitle.Font = Css.OrdinaryText.Fonts.RegularFont; textboxTitle.ForeColor = Css.OrdinaryText.Colors.ForeColor; textboxTitle.Location = new Point(labelTitle.Right, MARGIN); textboxTitle.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); textboxTitle.MaxLength = 50; // // labelRequirement // labelRequirement.Font = Css.OrdinaryText.Fonts.RegularFont; labelRequirement.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelRequirement.Location = new Point(MARGIN, textboxTitle.Bottom + HEIGHT_INTERVAL); labelRequirement.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelRequirement.Text = "Requirement"; // // textboxReqirement // textboxReqirement.ScrollBars = ScrollBars.Vertical; textboxReqirement.BackColor = Color.White; textboxReqirement.Font = Css.OrdinaryText.Fonts.RegularFont; textboxReqirement.ForeColor = Css.OrdinaryText.Colors.ForeColor; textboxReqirement.Location = new Point(labelRequirement.Right, textboxTitle.Bottom + HEIGHT_INTERVAL); textboxReqirement.Size = new Size(TEXTBOX_WIDTH, 3 * LABEL_HEIGHT + 2 * HEIGHT_INTERVAL); textboxReqirement.Multiline = true; textboxReqirement.MaxLength = 1000; // // labelFrequency // labelFrequency.Font = Css.OrdinaryText.Fonts.RegularFont; labelFrequency.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelFrequency.Location = new Point(MARGIN, textboxReqirement.Bottom + HEIGHT_INTERVAL + 18); labelFrequency.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelFrequency.Text = "Frequency"; // // lifelengthViewerFrequency // lifelengthViewerFrequency.ShowHeaders = true; lifelengthViewerFrequency.Font = Css.OrdinaryText.Fonts.RegularFont; lifelengthViewerFrequency.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerFrequency.ShowLeftHeader = false; lifelengthViewerFrequency.LeftHeaderWidth = 0; lifelengthViewerFrequency.ShowMinutes = false; lifelengthViewerFrequency.Location = new Point(labelFrequency.Right, textboxReqirement.Bottom + HEIGHT_LIFELENGTH_INTERVAL); // // labelNotifyBefore // labelNotifyBefore.Font = Css.OrdinaryText.Fonts.RegularFont; labelNotifyBefore.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelNotifyBefore.Location = new Point(MARGIN, lifelengthViewerFrequency.Bottom + HEIGHT_INTERVAL); labelNotifyBefore.Size = new Size(CHECK_BOX_WIDTH, LABEL_HEIGHT); labelNotifyBefore.Text = "Notify Before"; // // lifelengthViewerNotifyBefore // lifelengthViewerNotifyBefore.ShowHeaders = false; lifelengthViewerNotifyBefore.Font = Css.OrdinaryText.Fonts.RegularFont; lifelengthViewerNotifyBefore.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerNotifyBefore.ShowLeftHeader = false; lifelengthViewerNotifyBefore.LeftHeaderWidth = 0; lifelengthViewerNotifyBefore.ShowMinutes = false; lifelengthViewerNotifyBefore.Location = new Point(labelNotifyBefore.Right, lifelengthViewerFrequency.Bottom + HEIGHT_LIFELENGTH_INTERVAL); // // labelTLPNo // labelTLPNo.Font = Css.OrdinaryText.Fonts.RegularFont; labelTLPNo.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelTLPNo.Location = new Point(MARGIN, lifelengthViewerNotifyBefore.Bottom + HEIGHT_LIFELENGTH_INTERVAL); labelTLPNo.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelTLPNo.Text = "TPL No"; // // textboxTLPNo // textboxTLPNo.BackColor = Color.White; textboxTLPNo.Font = Css.OrdinaryText.Fonts.RegularFont; textboxTLPNo.ForeColor = Css.OrdinaryText.Colors.ForeColor; textboxTLPNo.Location = new Point(labelTLPNo.Right, lifelengthViewerNotifyBefore.Bottom + HEIGHT_LIFELENGTH_INTERVAL); textboxTLPNo.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); textboxTLPNo.MaxLength = 1000; //textboxThreshold.MaxLength = 1000; // // labelReferences // labelReferences.Font = Css.OrdinaryText.Fonts.RegularFont; labelReferences.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelReferences.Location = new Point(MARGIN, labelTLPNo.Bottom + HEIGHT_INTERVAL); labelReferences.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelReferences.Text = "References"; // // textBoxReferences // textBoxReferences.BackColor = Color.White; textBoxReferences.Font = Css.OrdinaryText.Fonts.RegularFont; textBoxReferences.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxReferences.Location = new Point(labelReferences.Right, labelTLPNo.Bottom + HEIGHT_INTERVAL); textBoxReferences.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); textBoxReferences.MaxLength = 400; // // labelEngOrderNo // labelEngOrderNo.Font = Css.OrdinaryText.Fonts.RegularFont; labelEngOrderNo.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelEngOrderNo.Location = new Point(MARGIN, labelReferences.Bottom + HEIGHT_INTERVAL); labelEngOrderNo.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelEngOrderNo.Text = "Eng. Order No"; // // textBoxEngOrderNo // textboxEngOrderNo.BackColor = Color.White; textboxEngOrderNo.Font = Css.OrdinaryText.Fonts.RegularFont; textboxEngOrderNo.ForeColor = Css.OrdinaryText.Colors.ForeColor; textboxEngOrderNo.Location = new Point(labelEngOrderNo.Right, labelReferences.Bottom + HEIGHT_INTERVAL); textboxEngOrderNo.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); textboxEngOrderNo.MaxLength = 400; // // labelJobCardNo // labelJobCardNo.Font = Css.OrdinaryText.Fonts.RegularFont; labelJobCardNo.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelJobCardNo.Location = new Point(MARGIN, labelEngOrderNo.Bottom + HEIGHT_INTERVAL); labelJobCardNo.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelJobCardNo.Text = "JobCard No"; // // textboxJobCardNo // textboxJobCardNo.BackColor = Color.White; textboxJobCardNo.Font = Css.OrdinaryText.Fonts.RegularFont; textboxJobCardNo.ForeColor = Css.OrdinaryText.Colors.ForeColor; textboxJobCardNo.Location = new Point(labelJobCardNo.Right, labelEngOrderNo.Bottom + HEIGHT_INTERVAL); textboxJobCardNo.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); textboxJobCardNo.MaxLength = 400; // // labelRemarks // labelRemarks.Font = Css.OrdinaryText.Fonts.RegularFont; labelRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelRemarks.Location = new Point(WIDTH_INTERVAL, MARGIN); labelRemarks.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelRemarks.Text = "Remarks"; // // textboxRemarks // textboxRemarks.ScrollBars = ScrollBars.Vertical; textboxRemarks.BackColor = Color.White; textboxRemarks.Font = Css.OrdinaryText.Fonts.RegularFont; textboxRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; textboxRemarks.Size = new Size(TEXTBOX_WIDTH, 3 * LABEL_HEIGHT + 2 * HEIGHT_INTERVAL); textboxRemarks.Multiline = true; textboxRemarks.MaxLength = 34000; textboxRemarks.Location = new Point(labelRemarks.Right, MARGIN); // // labelHiddenRemarks // labelHiddenRemarks.Font = Css.OrdinaryText.Fonts.RegularFont; labelHiddenRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelHiddenRemarks.Location = new Point(WIDTH_INTERVAL, textboxRemarks.Bottom + HEIGHT_INTERVAL); labelHiddenRemarks.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelHiddenRemarks.Text = "Hidden Remarks"; // // textboxHiddenRemarks // textboxHiddenRemarks.ScrollBars = ScrollBars.Vertical; textboxHiddenRemarks.BackColor = Color.White; textboxHiddenRemarks.Font = Css.OrdinaryText.Fonts.RegularFont; textboxHiddenRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; textboxHiddenRemarks.Size = new Size(TEXTBOX_WIDTH, 3 * LABEL_HEIGHT + 2 * HEIGHT_INTERVAL); textboxHiddenRemarks.Multiline = true; textboxHiddenRemarks.MaxLength = 34000; textboxHiddenRemarks.Location = new Point(labelRemarks.Right, textboxRemarks.Bottom + HEIGHT_INTERVAL); Controls.Add(labelTitle); Controls.Add(textboxTitle); Controls.Add(labelRequirement); Controls.Add(textboxReqirement); Controls.Add(labelFrequency); Controls.Add(lifelengthViewerFrequency); Controls.Add(labelNotifyBefore); Controls.Add(lifelengthViewerNotifyBefore); Controls.Add(labelTLPNo); Controls.Add(textboxTLPNo); Controls.Add(labelReferences); Controls.Add(textBoxReferences); Controls.Add(labelEngOrderNo); Controls.Add(textboxEngOrderNo); Controls.Add(labelJobCardNo); Controls.Add(textboxJobCardNo); Controls.Add(labelRemarks); Controls.Add(textboxRemarks); Controls.Add(labelHiddenRemarks); Controls.Add(textboxHiddenRemarks); }
private void InitializeComponent() { AutoSize = true; AutoSizeMode = AutoSizeMode.GrowAndShrink; BackColor = Css.CommonAppearance.Colors.BackColor; labelTitle = new Label(); labelDescription = new Label(); labelInitialDocuments = new Label(); labelRequiredInspection = new Label(); labelSinceNew = new Label(); labelRepeatInterval = new Label(); labelNotifyBefore = new Label(); labelRemarks = new Label(); labelHiddenRemarks = new Label(); labelLastCompliance = new Label(); labelDate = new Label(); labelLastComplianceTSNCSN = new Label(); labelInspectionDocument = new Label(); textboxTitle = new TextBox(); radioButtonSDR = new RadioButton(); radioButtonDBC = new RadioButton(); textboxDescription = new TextBox(); textBoxInitialDocuments = new TextBox(); textBoxRequiredInspection = new TextBox(); lifelengthViewerSinceNew = new LifelengthViewer(); lifelengthViewerRepeatInterval = new LifelengthViewer(); lifelengthViewerNotifyBefore = new LifelengthViewer(); textBoxRemarks = new TextBox(); textBoxHiddenRemarks = new TextBox(); dateTimePickerDate = new DateTimePicker(); lifelengthViewerLastCompliance = new LifelengthViewer(); textBoxInspectionDocument = new TextBox(); fileControl = new WindowsFormAttachedFileControl(null, "Adobe PDF Files|*.pdf", "This record does not contain a file proving the compliance. Enclose PDF file to prove the compliance.", "Attached file proves the compliance.", icons.PDFSmall); // // labelTitle // labelTitle.Font = Css.OrdinaryText.Fonts.RegularFont; labelTitle.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelTitle.Location = new Point(MARGIN, TOP_MARGIN); labelTitle.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelTitle.Text = "Title"; // // textboxTitle // textboxTitle.BackColor = Color.White; textboxTitle.Font = Css.OrdinaryText.Fonts.RegularFont; textboxTitle.ForeColor = Css.OrdinaryText.Colors.ForeColor; textboxTitle.Location = new Point(labelTitle.Right, TOP_MARGIN); textboxTitle.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); textboxTitle.MaxLength = 50; textboxTitle.TabIndex = 2; // // radioButtonSDR // radioButtonSDR.Cursor = Cursors.Hand; radioButtonSDR.FlatStyle = FlatStyle.Flat; radioButtonSDR.Font = new Font(Css.OrdinaryText.Fonts.RegularFont, FontStyle.Underline); radioButtonSDR.ForeColor = Css.SimpleLink.Colors.LinkColor; radioButtonSDR.Location = new Point(MARGIN + LABEL_WIDTH, textboxTitle.Bottom + HEIGHT_INTERVAL); radioButtonSDR.Size = new Size(TEXTBOX_WIDTH / 3, LABEL_HEIGHT); radioButtonSDR.Text = "SDR"; radioButtonSDR.Checked = true; // // radioButtonDBC // radioButtonDBC.Cursor = Cursors.Hand; radioButtonDBC.FlatStyle = FlatStyle.Flat; radioButtonDBC.Font = new Font(Css.OrdinaryText.Fonts.RegularFont, FontStyle.Underline); radioButtonDBC.ForeColor = Css.SimpleLink.Colors.LinkColor; radioButtonDBC.Location = new Point(radioButtonSDR.Right, textboxTitle.Bottom + HEIGHT_INTERVAL); radioButtonDBC.Size = new Size(TEXTBOX_WIDTH / 3, LABEL_HEIGHT); radioButtonDBC.Text = "DBC"; // // labelDescription // labelDescription.Font = Css.OrdinaryText.Fonts.RegularFont; labelDescription.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelDescription.Location = new Point(MARGIN, radioButtonSDR.Bottom + HEIGHT_INTERVAL); labelDescription.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelDescription.Text = "Description:"; // // textboxDescription // textboxDescription.BackColor = Color.White; textboxDescription.Font = Css.OrdinaryText.Fonts.RegularFont; textboxDescription.ForeColor = Css.OrdinaryText.Colors.ForeColor; textboxDescription.Location = new Point(labelDescription.Right, radioButtonSDR.Bottom + HEIGHT_INTERVAL); textboxDescription.Size = new Size(TEXTBOX_WIDTH, 3 * LABEL_HEIGHT + 2 * HEIGHT_INTERVAL); textboxDescription.Multiline = true; textboxDescription.ScrollBars = ScrollBars.Vertical; // // labelInitialDocuments // labelInitialDocuments.Font = Css.OrdinaryText.Fonts.RegularFont; labelInitialDocuments.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelInitialDocuments.Location = new Point(MARGIN, textboxDescription.Bottom + HEIGHT_INTERVAL); labelInitialDocuments.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelInitialDocuments.Text = "Initial Documents:"; // // textBoxInitialDocuments // textBoxInitialDocuments.BackColor = Color.White; textBoxInitialDocuments.Font = Css.OrdinaryText.Fonts.RegularFont; textBoxInitialDocuments.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxInitialDocuments.Location = new Point(labelInitialDocuments.Right, textboxDescription.Bottom + HEIGHT_INTERVAL); textBoxInitialDocuments.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); // // labelRequiredInspection // labelRequiredInspection.Font = Css.OrdinaryText.Fonts.RegularFont; labelRequiredInspection.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelRequiredInspection.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelRequiredInspection.Text = "Required Inspection:"; labelRequiredInspection.Location = new Point(MARGIN, textBoxInitialDocuments.Bottom + HEIGHT_INTERVAL); // // textBoxRequiredInspection // textBoxRequiredInspection.BackColor = Color.White; textBoxRequiredInspection.Font = Css.OrdinaryText.Fonts.RegularFont; textBoxRequiredInspection.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxRequiredInspection.Size = new Size(TEXTBOX_WIDTH, 3 * LABEL_HEIGHT + 2 * HEIGHT_INTERVAL); textBoxRequiredInspection.Multiline = true; textBoxRequiredInspection.ScrollBars = ScrollBars.Vertical; textBoxRequiredInspection.Location = new Point(labelRequiredInspection.Right, textBoxInitialDocuments.Bottom + HEIGHT_INTERVAL); // // labelSinceNew // labelSinceNew.Font = Css.OrdinaryText.Fonts.RegularFont; labelSinceNew.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelSinceNew.Location = new Point(MARGIN, textBoxRequiredInspection.Bottom + HEIGHT_INTERVAL + 17); labelSinceNew.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelSinceNew.Text = "First Inspection:"; // // lifelengthViewerSinceNew // lifelengthViewerSinceNew.Font = Css.OrdinaryText.Fonts.RegularFont; lifelengthViewerSinceNew.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerSinceNew.ShowLeftHeader = false; lifelengthViewerSinceNew.LeftHeaderWidth = 0; lifelengthViewerSinceNew.ShowMinutes = false; lifelengthViewerSinceNew.TabIndex = 13; lifelengthViewerSinceNew.Location = new Point(labelSinceNew.Right, textBoxRequiredInspection.Bottom + HEIGHT_LIFELENGTH_INTERVAL); // // labelRepeatInterval // labelRepeatInterval.Font = Css.OrdinaryText.Fonts.RegularFont; labelRepeatInterval.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelRepeatInterval.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelRepeatInterval.Text = "Repeat Interval:"; // // lifelengthViewerNotifyBefore // lifelengthViewerRepeatInterval.ShowHeaders = false; lifelengthViewerRepeatInterval.Font = Css.OrdinaryText.Fonts.RegularFont; lifelengthViewerRepeatInterval.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerRepeatInterval.ShowLeftHeader = false; lifelengthViewerRepeatInterval.LeftHeaderWidth = 0; lifelengthViewerRepeatInterval.ShowMinutes = false; // // labelNotifyBefore // labelNotifyBefore.Font = Css.OrdinaryText.Fonts.RegularFont; labelNotifyBefore.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelNotifyBefore.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelNotifyBefore.Text = "Notify Before:"; // // lifelengthViewerNotifyBefore // lifelengthViewerNotifyBefore.ShowHeaders = false; lifelengthViewerNotifyBefore.Font = Css.OrdinaryText.Fonts.RegularFont; lifelengthViewerNotifyBefore.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerNotifyBefore.ShowLeftHeader = false; lifelengthViewerNotifyBefore.LeftHeaderWidth = 0; lifelengthViewerNotifyBefore.ShowMinutes = false; // // labelRemarks // labelRemarks.Font = Css.OrdinaryText.Fonts.RegularFont; labelRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelRemarks.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelRemarks.Text = "Remarks:"; // // textBoxRemarks // textBoxRemarks.BackColor = Color.White; textBoxRemarks.Font = Css.OrdinaryText.Fonts.RegularFont; textBoxRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxRemarks.Size = new Size(TEXTBOX_WIDTH, 3 * LABEL_HEIGHT + 2 * HEIGHT_INTERVAL); textBoxRemarks.Multiline = true; textBoxRemarks.ScrollBars = ScrollBars.Vertical; // // labelHiddenRemarks // labelHiddenRemarks.Font = Css.OrdinaryText.Fonts.RegularFont; labelHiddenRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelHiddenRemarks.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelHiddenRemarks.Text = "Hidden remarks:"; // // textBoxHiddenRemarks // textBoxHiddenRemarks.BackColor = Color.White; textBoxHiddenRemarks.Font = Css.OrdinaryText.Fonts.RegularFont; textBoxHiddenRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxHiddenRemarks.Size = new Size(TEXTBOX_WIDTH, 3 * LABEL_HEIGHT + 2 * HEIGHT_INTERVAL); textBoxHiddenRemarks.Multiline = true; textBoxHiddenRemarks.ScrollBars = ScrollBars.Vertical; // // labelLastCompliance // labelLastCompliance.Font = Css.OrdinaryText.Fonts.BoldFont; labelLastCompliance.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelLastCompliance.Location = new Point(WIDTH_INTERVAL, TOP_MARGIN); labelLastCompliance.Size = new Size(WIDTH_INTERVAL, TOP_MARGIN); labelLastCompliance.Text = "Last Inspection"; // // labelDate // labelDate.Font = Css.OrdinaryText.Fonts.RegularFont; labelDate.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelDate.Location = new Point(WIDTH_INTERVAL, labelLastCompliance.Bottom + HEIGHT_INTERVAL); labelDate.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelDate.Text = "Date:"; labelDate.TextAlign = ContentAlignment.MiddleLeft; // // dateTimePickerDate // dateTimePickerDate.Font = Css.OrdinaryText.Fonts.RegularFont; dateTimePickerDate.ForeColor = Css.OrdinaryText.Colors.ForeColor; dateTimePickerDate.Location = new Point(labelDate.Right, labelLastCompliance.Bottom + HEIGHT_INTERVAL); dateTimePickerDate.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); dateTimePickerDate.Format = DateTimePickerFormat.Custom; dateTimePickerDate.CustomFormat = new TermsProvider()["DateFormat"].ToString(); dateTimePickerDate.Enabled = false; // // labelLastComplianceTSNCSN // labelLastComplianceTSNCSN.Font = Css.OrdinaryText.Fonts.RegularFont; labelLastComplianceTSNCSN.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelLastComplianceTSNCSN.Location = new Point(WIDTH_INTERVAL, dateTimePickerDate.Bottom + HEIGHT_INTERVAL + 17); labelLastComplianceTSNCSN.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelLastComplianceTSNCSN.Text = "TSN CSN:"; // // lifelengthViewerLastCompliance // lifelengthViewerLastCompliance.Font = Css.OrdinaryText.Fonts.RegularFont; lifelengthViewerLastCompliance.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerLastCompliance.ShowLeftHeader = false; lifelengthViewerLastCompliance.LeftHeaderWidth = 0; lifelengthViewerLastCompliance.ShowMinutes = false; lifelengthViewerLastCompliance.Location = new Point(labelLastComplianceTSNCSN.Right, dateTimePickerDate.Bottom + HEIGHT_LIFELENGTH_INTERVAL); lifelengthViewerLastCompliance.ReadOnly = true; // // labelInspectionDocument // labelInspectionDocument.Font = Css.OrdinaryText.Fonts.RegularFont; labelInspectionDocument.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelInspectionDocument.Location = new Point(WIDTH_INTERVAL, lifelengthViewerLastCompliance.Bottom + HEIGHT_INTERVAL); labelInspectionDocument.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelInspectionDocument.Text = "Inspection Document:"; // // textBoxInspectionDocument // textBoxInspectionDocument.Font = Css.OrdinaryText.Fonts.RegularFont; textBoxInspectionDocument.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxInspectionDocument.Location = new Point(labelInspectionDocument.Right, lifelengthViewerLastCompliance.Bottom + HEIGHT_INTERVAL); textBoxInspectionDocument.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); textBoxInspectionDocument.ReadOnly = true; // // fileControl // fileControl.Location = new Point(WIDTH_INTERVAL, textBoxInspectionDocument.Bottom + HEIGHT_INTERVAL); Controls.Add(labelTitle); Controls.Add(textboxTitle); Controls.Add(radioButtonSDR); Controls.Add(radioButtonDBC); Controls.Add(labelDescription); Controls.Add(textboxDescription); Controls.Add(labelInitialDocuments); Controls.Add(textBoxInitialDocuments); Controls.Add(labelRequiredInspection); Controls.Add(textBoxRequiredInspection); Controls.Add(labelSinceNew); Controls.Add(lifelengthViewerSinceNew); Controls.Add(labelRepeatInterval); Controls.Add(lifelengthViewerRepeatInterval); Controls.Add(labelNotifyBefore); Controls.Add(lifelengthViewerNotifyBefore); Controls.Add(labelRemarks); Controls.Add(textBoxRemarks); Controls.Add(labelHiddenRemarks); Controls.Add(textBoxHiddenRemarks); Controls.Add(labelLastCompliance); Controls.Add(labelDate); Controls.Add(dateTimePickerDate); Controls.Add(labelLastComplianceTSNCSN); Controls.Add(lifelengthViewerLastCompliance); Controls.Add(labelInspectionDocument); Controls.Add(textBoxInspectionDocument); Controls.Add(fileControl); labelRepeatInterval.Location = new Point(MARGIN, lifelengthViewerSinceNew.Bottom + HEIGHT_INTERVAL); lifelengthViewerRepeatInterval.Location = new Point(labelRepeatInterval.Right, lifelengthViewerSinceNew.Bottom + HEIGHT_LIFELENGTH_INTERVAL); labelNotifyBefore.Location = new Point(MARGIN, lifelengthViewerRepeatInterval.Bottom + HEIGHT_INTERVAL); lifelengthViewerNotifyBefore.Location = new Point(labelNotifyBefore.Right, lifelengthViewerRepeatInterval.Bottom + HEIGHT_LIFELENGTH_INTERVAL); labelRemarks.Location = new Point(MARGIN, labelNotifyBefore.Bottom + HEIGHT_INTERVAL); textBoxRemarks.Location = new Point(labelRemarks.Right, lifelengthViewerNotifyBefore.Bottom + HEIGHT_INTERVAL); labelHiddenRemarks.Location = new Point(MARGIN, textBoxRemarks.Bottom + HEIGHT_INTERVAL); textBoxHiddenRemarks.Location = new Point(labelHiddenRemarks.Right, textBoxRemarks.Bottom + HEIGHT_INTERVAL); }
private void InitializeComponent() { AutoSize = true; AutoSizeMode = AutoSizeMode.GrowAndShrink; BackColor = Css.CommonAppearance.Colors.BackColor; labelWorkType = new Label(); comboBoxWorkType = new ComboBox(); labelInterval = new Label(); lifelengthViewerInterval = new LifelengthViewer(); labelNotify = new Label(); lifelengthViewerNotify = new LifelengthViewer(); checkBoxLastCompliance = new CheckBox(); labelDate = new Label(); dateTimePickerDate = new DateTimePicker(); labelComponentTSNCSN = new Label(); lifelengthViewerComponentLastPerformance = new LifelengthViewer(); labelAircraftTSNCSN = new Label(); lifelengthViewerAircraftLastPerformance = new LifelengthViewer(); labelNext = new Label(); lifelengthViewerNext = new LifelengthViewer(); labelRemains = new Label(); lifelengthViewerRemains = new LifelengthViewer(); linkLabelClear = new LinkLabel(); delimiter1 = new Delimiter(); delimiter2 = new Delimiter(); // // labelWorkType // labelWorkType.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelWorkType.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelWorkType.Location = new Point(MARGIN, MARGIN); labelWorkType.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelWorkType.Text = "Work Type:"; labelWorkType.TextAlign = ContentAlignment.MiddleLeft; // // comboBoxWorkType // comboBoxWorkType.BackColor = Color.White; comboBoxWorkType.DropDownStyle = ComboBoxStyle.DropDown; comboBoxWorkType.Font = Css.OrdinaryText.Fonts.SmallRegularFont; comboBoxWorkType.ForeColor = Css.OrdinaryText.Colors.ForeColor; comboBoxWorkType.Size = new Size(DATE_TIME_PICKER_WIDTH, LABEL_HEIGHT); comboBoxWorkType.Location = new Point(labelWorkType.Right, MARGIN); // // labelInterval // labelInterval.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelInterval.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelInterval.Location = new Point(MARGIN, labelWorkType.Bottom + HEIGHT_INTERVAL); labelInterval.Size = new Size(LIFELENGTH_VIEWER_WIDTH, LABEL_HEIGHT); labelInterval.Text = "Repeat Interval:"; labelInterval.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerInterval // lifelengthViewerInterval.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerInterval.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerInterval.ShowLeftHeader = false; lifelengthViewerInterval.LeftHeaderWidth = 0; lifelengthViewerInterval.ShowMinutes = false; lifelengthViewerInterval.Location = new Point(MARGIN, labelInterval.Bottom + HEIGHT_LIFELENGTH_INTERVAL); lifelengthViewerInterval.LifelengthChanged += lifelengthViewerInterval_LifelengthChanged; // // labelNotify // labelNotify.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelNotify.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelNotify.Location = new Point(MARGIN, lifelengthViewerInterval.Bottom + HEIGHT_INTERVAL); labelNotify.Size = new Size(LIFELENGTH_VIEWER_WIDTH, LABEL_HEIGHT); labelNotify.Text = "Notify:"; labelNotify.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerNotify // lifelengthViewerNotify.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerNotify.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerNotify.ShowLeftHeader = false; lifelengthViewerNotify.LeftHeaderWidth = 0; lifelengthViewerNotify.ShowMinutes = false; lifelengthViewerNotify.Location = new Point(MARGIN, labelNotify.Bottom + HEIGHT_LIFELENGTH_INTERVAL); // // delimiter1 // delimiter1.Orientation = DelimiterOrientation.Vertical; delimiter1.Location = new Point(WIDTH_INTERVAL - (WIDTH_INTERVAL - MARGIN - LABEL_WIDTH - DATE_TIME_PICKER_WIDTH) / 2, MARGIN); delimiter1.Height = 265; // // checkBoxLastCompliance // checkBoxLastCompliance.Cursor = Cursors.Hand; checkBoxLastCompliance.FlatStyle = FlatStyle.Flat; checkBoxLastCompliance.Font = Css.SimpleLink.Fonts.SmallFont; checkBoxLastCompliance.ForeColor = Css.SimpleLink.Colors.LinkColor; checkBoxLastCompliance.Location = new Point(WIDTH_INTERVAL, MARGIN); checkBoxLastCompliance.Size = new Size(LABEL_WIDTH * 2, LABEL_HEIGHT); checkBoxLastCompliance.Text = "Last Compliance"; checkBoxLastCompliance.CheckedChanged += checkBoxLastCompliance_CheckedChanged; // // labelDate // labelDate.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelDate.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelDate.Location = new Point(WIDTH_INTERVAL, checkBoxLastCompliance.Bottom + HEIGHT_INTERVAL); labelDate.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelDate.Text = "Date:"; labelDate.TextAlign = ContentAlignment.MiddleLeft; // // dateTimePickerDate // dateTimePickerDate.ForeColor = Css.OrdinaryText.Colors.ForeColor; dateTimePickerDate.CalendarForeColor = Css.OrdinaryText.Colors.ForeColor; dateTimePickerDate.Font = Css.OrdinaryText.Fonts.SmallRegularFont; dateTimePickerDate.Location = new Point(labelDate.Right, checkBoxLastCompliance.Bottom + HEIGHT_INTERVAL); dateTimePickerDate.Size = new Size(DATE_TIME_PICKER_WIDTH, LABEL_HEIGHT); dateTimePickerDate.Format = DateTimePickerFormat.Custom; dateTimePickerDate.CustomFormat = new TermsProvider()["DateFormat"].ToString(); dateTimePickerDate.ValueChanged += dateTimePickerDate_ValueChanged; dateTimePickerDate.Enabled = false; // // labelComponentTSNCSN // labelComponentTSNCSN.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelComponentTSNCSN.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelComponentTSNCSN.Location = new Point(WIDTH_INTERVAL, labelDate.Bottom + HEIGHT_INTERVAL); labelComponentTSNCSN.Size = new Size(LIFELENGTH_VIEWER_WIDTH, LABEL_HEIGHT); labelComponentTSNCSN.Text = "Component TSN/CSN:"; labelComponentTSNCSN.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerComponentLastPerformance // lifelengthViewerComponentLastPerformance.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerComponentLastPerformance.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerComponentLastPerformance.ShowLeftHeader = false; lifelengthViewerComponentLastPerformance.LeftHeaderWidth = 0; lifelengthViewerComponentLastPerformance.ShowMinutes = false; lifelengthViewerComponentLastPerformance.Location = new Point(WIDTH_INTERVAL, labelComponentTSNCSN.Bottom + HEIGHT_LIFELENGTH_INTERVAL); lifelengthViewerComponentLastPerformance.LifelengthChanged += lifelengthViewerComponentLastPerformance_LifelengthChanged; lifelengthViewerComponentLastPerformance.ReadOnly = true; // // labelAircraftTSNCSN // labelAircraftTSNCSN.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelAircraftTSNCSN.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelAircraftTSNCSN.Location = new Point(WIDTH_INTERVAL, lifelengthViewerComponentLastPerformance.Bottom + HEIGHT_INTERVAL); labelAircraftTSNCSN.Size = new Size(LIFELENGTH_VIEWER_WIDTH, LABEL_HEIGHT); labelAircraftTSNCSN.Text = "Aircraft TSN/CSN:"; labelAircraftTSNCSN.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerAircraftLastPerformance // lifelengthViewerAircraftLastPerformance.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerAircraftLastPerformance.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerAircraftLastPerformance.ShowLeftHeader = false; lifelengthViewerAircraftLastPerformance.LeftHeaderWidth = 0; lifelengthViewerAircraftLastPerformance.ShowMinutes = false; lifelengthViewerAircraftLastPerformance.Location = new Point(WIDTH_INTERVAL, labelAircraftTSNCSN.Bottom + HEIGHT_LIFELENGTH_INTERVAL); lifelengthViewerAircraftLastPerformance.ReadOnly = true; // // delimiter2 // delimiter2.Orientation = DelimiterOrientation.Vertical; delimiter2.Location = new Point(WIDTH_INTERVAL_SECOND - (WIDTH_INTERVAL_SECOND - WIDTH_INTERVAL - LABEL_WIDTH - DATE_TIME_PICKER_WIDTH) / 2, MARGIN); delimiter2.Height = 265; // // labelNext // labelNext.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelNext.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelNext.Location = new Point(WIDTH_INTERVAL_SECOND, MARGIN); labelNext.Size = new Size(LIFELENGTH_VIEWER_WIDTH, LABEL_HEIGHT); labelNext.Text = "Next (Component TSN/CSN):"; labelNext.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerNext // lifelengthViewerNext.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerNext.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerNext.ShowLeftHeader = false; lifelengthViewerNext.LeftHeaderWidth = 0; lifelengthViewerNext.ShowMinutes = false; lifelengthViewerNext.Location = new Point(WIDTH_INTERVAL_SECOND, labelNext.Bottom + HEIGHT_LIFELENGTH_INTERVAL); lifelengthViewerNext.ReadOnly = true; // // labelRemains // labelRemains.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelRemains.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelRemains.Location = new Point(WIDTH_INTERVAL_SECOND, lifelengthViewerNext.Bottom + HEIGHT_INTERVAL); labelRemains.Size = new Size(LIFELENGTH_VIEWER_WIDTH, LABEL_HEIGHT); labelRemains.Text = "Remains:"; labelRemains.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerRemains // lifelengthViewerRemains.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerRemains.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerRemains.ShowLeftHeader = false; lifelengthViewerRemains.LeftHeaderWidth = 0; lifelengthViewerRemains.ShowMinutes = false; lifelengthViewerRemains.Location = new Point(WIDTH_INTERVAL_SECOND, labelRemains.Bottom + HEIGHT_LIFELENGTH_INTERVAL); lifelengthViewerRemains.ReadOnly = true; // // linkLabelClear // linkLabelClear.Font = Css.SimpleLink.Fonts.Font; linkLabelClear.LinkColor = Css.SimpleLink.Colors.LinkColor; linkLabelClear.Text = "Clear"; linkLabelClear.Location = new Point(lifelengthViewerRemains.Right - linkLabelClear.Width, lifelengthViewerAircraftLastPerformance.Bottom - linkLabelClear.Height); linkLabelClear.TextAlign = ContentAlignment.BottomRight; linkLabelClear.LinkClicked += linkLabelClear_LinkClicked; // // DetailGeneralInformationControl // BackColor = Css.CommonAppearance.Colors.BackColor; Controls.Add(labelWorkType); Controls.Add(comboBoxWorkType); Controls.Add(labelInterval); Controls.Add(lifelengthViewerInterval); Controls.Add(labelNotify); Controls.Add(lifelengthViewerNotify); Controls.Add(delimiter1); Controls.Add(checkBoxLastCompliance); Controls.Add(labelDate); Controls.Add(dateTimePickerDate); Controls.Add(labelComponentTSNCSN); Controls.Add(lifelengthViewerComponentLastPerformance); Controls.Add(labelAircraftTSNCSN); Controls.Add(lifelengthViewerAircraftLastPerformance); Controls.Add(delimiter2); Controls.Add(labelNext); Controls.Add(lifelengthViewerNext); Controls.Add(labelRemains); Controls.Add(lifelengthViewerRemains); Controls.Add(linkLabelClear); }
/// <summary> /// Инициализирует элементы управления /// </summary> public void InitializeComponent() { radioButtonNoWarranty = new RadioButton(); radioButtonExpires = new RadioButton(); radioButtonOperationalTime = new RadioButton(); dateTimePickerExpires = new DateTimePicker(); lifelengthViewerWarranty = new LifelengthViewer(); lifelengthViewerRemains = new LifelengthViewer(); // // radioButtonNoWarranty // radioButtonNoWarranty.Cursor = Cursors.Hand; radioButtonNoWarranty.FlatStyle = FlatStyle.Flat; radioButtonNoWarranty.Font = new Font(Css.OrdinaryText.Fonts.SmallRegularFont, FontStyle.Underline); radioButtonNoWarranty.ForeColor = Css.SimpleLink.Colors.LinkColor; radioButtonNoWarranty.Size = new Size(RADIO_BUTTON_WIDTH, LABEL_HEIGHT); radioButtonNoWarranty.Text = "No Warranty"; radioButtonNoWarranty.TextAlign = ContentAlignment.MiddleLeft; radioButtonNoWarranty.CheckedChanged += radioButtonNoWarranty_CheckedChanged; radioButtonNoWarranty.Checked = true; // // radioButtonExpires // radioButtonExpires.Cursor = Cursors.Hand; radioButtonExpires.FlatStyle = FlatStyle.Flat; radioButtonExpires.Font = new Font(Css.OrdinaryText.Fonts.SmallRegularFont, FontStyle.Underline); radioButtonExpires.ForeColor = Css.SimpleLink.Colors.LinkColor; radioButtonExpires.Location = new Point(0, radioButtonNoWarranty.Bottom + HEIGHT_INTERVAL); radioButtonExpires.Size = new Size(RADIO_BUTTON_WIDTH, LABEL_HEIGHT); radioButtonExpires.Text = "Expires"; radioButtonExpires.CheckedChanged += radioButtonExpires_CheckedChanged; // // dateTimePickerExpires // dateTimePickerExpires.ForeColor = Css.OrdinaryText.Colors.ForeColor; dateTimePickerExpires.Font = Css.OrdinaryText.Fonts.SmallRegularFont; dateTimePickerExpires.Location = new Point(radioButtonExpires.Right, radioButtonNoWarranty.Bottom + HEIGHT_INTERVAL); dateTimePickerExpires.Size = new Size(DATE_TIME_PICKER_WIDTH, LABEL_HEIGHT); dateTimePickerExpires.Format = DateTimePickerFormat.Custom; dateTimePickerExpires.CustomFormat = new TermsProvider()["DateFormat"].ToString(); // // radioButtonOperationalTime // radioButtonOperationalTime.Cursor = Cursors.Hand; radioButtonOperationalTime.FlatStyle = FlatStyle.Flat; radioButtonOperationalTime.Font = new Font(Css.OrdinaryText.Fonts.SmallRegularFont, FontStyle.Underline); radioButtonOperationalTime.ForeColor = Css.SimpleLink.Colors.LinkColor; radioButtonOperationalTime.Location = new Point(0, radioButtonExpires.Bottom + HEIGHT_INTERVAL); radioButtonOperationalTime.Size = new Size(RADIO_BUTTON_WIDTH, LABEL_HEIGHT); radioButtonOperationalTime.Text = "Operational Time"; radioButtonOperationalTime.CheckedChanged += radioButtonOperationalTime_CheckedChanged; // // lifelengthViewerWarranty // lifelengthViewerWarranty.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerWarranty.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerWarranty.LeftHeaderWidth = 0; lifelengthViewerWarranty.ShowMinutes = false; lifelengthViewerWarranty.Location = new Point(radioButtonOperationalTime.Right, radioButtonExpires.Bottom + HEIGHT_INTERVAL); // // lifelengthViewerRemains // lifelengthViewerRemains.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerRemains.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerRemains.LeftHeader = "Remains"; lifelengthViewerRemains.LeftHeaderWidth = RADIO_BUTTON_WIDTH; lifelengthViewerRemains.ShowMinutes = false; lifelengthViewerRemains.Location = new Point(lifelengthViewerWarranty.Right + 100, radioButtonExpires.Bottom + HEIGHT_INTERVAL); lifelengthViewerRemains.Enabled = false; // // DetailGeneralInformationControl // AutoSize = true; BackColor = Css.CommonAppearance.Colors.BackColor; Controls.Add(radioButtonNoWarranty); Controls.Add(radioButtonExpires); Controls.Add(dateTimePickerExpires); Controls.Add(radioButtonOperationalTime); Controls.Add(lifelengthViewerWarranty); Controls.Add(lifelengthViewerRemains); }
private void InitializeComponent() { AutoSize = true; AutoSizeMode = AutoSizeMode.GrowAndShrink; BackColor = Css.CommonAppearance.Colors.BackColor; imageLinkLabelStatus = new StatusImageLinkLabel(); labelManHours = new Label(); labelCost = new Label(); labelKitRequired = new Label(); labelRemarks = new Label(); textBoxManHours = new TextBox(); textBoxCost = new TextBox(); textBoxKitRequired = new TextBox(); textBoxRemarks = new TextBox(); linkLabelJobCard = new LinkLabel(); // fileControl = new WindowsFormAttachedFileControl(null, "Adobe PDF Files|*.pdf", // "This record does not contain a file proving the compliance. Enclose PDF file to prove the compliance.", // "Attached file proves the compliance.", icons.PDFSmall); labelInterval = new Label(); lifelengthViewerInterval = new LifelengthViewer(); labelNotify = new Label(); lifelengthViewerNotify = new LifelengthViewer(); labelNext = new Label(); lifelengthViewerNext = new LifelengthViewer(); labelRemains = new Label(); lifelengthViewerRemains = new LifelengthViewer(); linkLabelRemove = new LinkLabel(); delimiter1 = new Delimiter(); delimiter2 = new Delimiter(); // // imageLinkLabelStatus // imageLinkLabelStatus.BackColor = Color.White; imageLinkLabelStatus.Font = Css.ImageLink.Fonts.Font; imageLinkLabelStatus.LinkColor = Css.ImageLink.Colors.LinkColor; imageLinkLabelStatus.Size = new Size(DATE_TIME_PICKER_WIDTH, LABEL_HEIGHT); imageLinkLabelStatus.Location = new Point(MARGIN, MARGIN); imageLinkLabelStatus.Enabled = false; // // labelManHours // labelManHours.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelManHours.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelManHours.Location = new Point(MARGIN, imageLinkLabelStatus.Bottom + HEIGHT_INTERVAL); labelManHours.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelManHours.Text = "Man Hours:"; labelManHours.TextAlign = ContentAlignment.MiddleLeft; // // textBoxManHours // textBoxManHours.BackColor = Color.White; textBoxManHours.Font = Css.OrdinaryText.Fonts.SmallRegularFont; textBoxManHours.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxManHours.Location = new Point(labelManHours.Right, imageLinkLabelStatus.Bottom + HEIGHT_INTERVAL); textBoxManHours.Width = DATE_TIME_PICKER_WIDTH; // // labelCost // labelCost.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelCost.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelCost.Location = new Point(MARGIN, textBoxManHours.Bottom + HEIGHT_INTERVAL); labelCost.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelCost.Text = "Cost (USD):"; labelCost.TextAlign = ContentAlignment.MiddleLeft; // // textBoxCost // textBoxCost.BackColor = Color.White; textBoxCost.Font = Css.OrdinaryText.Fonts.SmallRegularFont; textBoxCost.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxCost.Location = new Point(labelCost.Right, textBoxManHours.Bottom + HEIGHT_INTERVAL); textBoxCost.Width = DATE_TIME_PICKER_WIDTH; // // labelKitRequired // labelKitRequired.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelKitRequired.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelKitRequired.Location = new Point(MARGIN, textBoxCost.Bottom + HEIGHT_INTERVAL); labelKitRequired.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelKitRequired.Text = "Kit Required:"; labelKitRequired.TextAlign = ContentAlignment.MiddleLeft; // // textBoxKitRequired // textBoxKitRequired.BackColor = Color.White; textBoxKitRequired.Font = Css.OrdinaryText.Fonts.SmallRegularFont; textBoxKitRequired.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxKitRequired.Location = new Point(labelKitRequired.Right, textBoxCost.Bottom + HEIGHT_INTERVAL); textBoxKitRequired.Width = DATE_TIME_PICKER_WIDTH; // // labelRemarks // labelRemarks.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelRemarks.Location = new Point(MARGIN, textBoxKitRequired.Bottom + HEIGHT_INTERVAL); labelRemarks.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelRemarks.Text = "Remarks:"; labelRemarks.TextAlign = ContentAlignment.MiddleLeft; // // textBoxRemarks // textBoxRemarks.BackColor = Color.White; textBoxRemarks.Font = Css.OrdinaryText.Fonts.SmallRegularFont; textBoxRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxRemarks.Location = new Point(labelRemarks.Right, textBoxKitRequired.Bottom + HEIGHT_INTERVAL); textBoxRemarks.Size = new Size(DATE_TIME_PICKER_WIDTH, BIG_TEXTBOX_HEIGHT); textBoxRemarks.Multiline = true; textBoxRemarks.ScrollBars = ScrollBars.Vertical; // // linkLabelJobCard // linkLabelJobCard.Font = Css.SimpleLink.Fonts.Font; linkLabelJobCard.LinkColor = Css.SimpleLink.Colors.LinkColor; linkLabelJobCard.Text = "Job Card"; linkLabelJobCard.Location = new Point(MARGIN, textBoxRemarks.Bottom); linkLabelJobCard.LinkClicked += linkLabelJobCard_LinkClicked; linkLabelJobCard.Size = new Size(DATE_TIME_PICKER_WIDTH, LABEL_HEIGHT); // // fileControl // //fileControl.Location = new Point(MARGIN, textBoxKitRequired.Bottom + HEIGHT_INTERVAL); //fileControl.Width = LIFELENGTH_VIEWER_WIDTH; // // delimiter1 // delimiter1.Orientation = DelimiterOrientation.Vertical; delimiter1.Location = new Point(WIDTH_INTERVAL - (WIDTH_INTERVAL - MARGIN - LABEL_WIDTH - DATE_TIME_PICKER_WIDTH) / 2, MARGIN); delimiter1.Height = 210; // // labelInterval // labelInterval.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelInterval.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelInterval.Location = new Point(WIDTH_INTERVAL, MARGIN); labelInterval.Size = new Size(LIFELENGTH_VIEWER_WIDTH, LABEL_HEIGHT); labelInterval.Text = "Repeat Interval:"; labelInterval.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerInterval // lifelengthViewerInterval.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerInterval.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerInterval.ShowLeftHeader = false; lifelengthViewerInterval.LeftHeaderWidth = 0; lifelengthViewerInterval.ShowMinutes = false; lifelengthViewerInterval.Location = new Point(WIDTH_INTERVAL, labelInterval.Bottom + HEIGHT_LIFELENGTH_INTERVAL); // // labelNotify // labelNotify.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelNotify.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelNotify.Location = new Point(WIDTH_INTERVAL, lifelengthViewerInterval.Bottom + HEIGHT_INTERVAL); labelNotify.Size = new Size(LIFELENGTH_VIEWER_WIDTH, LABEL_HEIGHT); labelNotify.Text = "Notify:"; labelNotify.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerNotify // lifelengthViewerNotify.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerNotify.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerNotify.ShowLeftHeader = false; lifelengthViewerNotify.LeftHeaderWidth = 0; lifelengthViewerNotify.ShowMinutes = false; lifelengthViewerNotify.Location = new Point(WIDTH_INTERVAL, labelNotify.Bottom + HEIGHT_LIFELENGTH_INTERVAL); // // delimiter2 // delimiter2.Orientation = DelimiterOrientation.Vertical; delimiter2.Location = new Point(WIDTH_INTERVAL_SECOND - (WIDTH_INTERVAL_SECOND - WIDTH_INTERVAL - LABEL_WIDTH - DATE_TIME_PICKER_WIDTH) / 2, MARGIN); delimiter2.Height = 210; // // labelNext // labelNext.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelNext.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelNext.Location = new Point(WIDTH_INTERVAL_SECOND, MARGIN); labelNext.Size = new Size(LIFELENGTH_VIEWER_WIDTH, LABEL_HEIGHT); labelNext.Text = "Next (Component TSN/CSN):"; labelNext.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerNext // lifelengthViewerNext.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerNext.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerNext.ShowLeftHeader = false; lifelengthViewerNext.LeftHeaderWidth = 0; lifelengthViewerNext.ShowMinutes = false; lifelengthViewerNext.Location = new Point(WIDTH_INTERVAL_SECOND, labelNext.Bottom + HEIGHT_LIFELENGTH_INTERVAL); lifelengthViewerNext.ReadOnly = true; // // labelRemains // labelRemains.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelRemains.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelRemains.Location = new Point(WIDTH_INTERVAL_SECOND, lifelengthViewerNext.Bottom + HEIGHT_INTERVAL); labelRemains.Size = new Size(LIFELENGTH_VIEWER_WIDTH, LABEL_HEIGHT); labelRemains.Text = "Remains:"; labelRemains.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerRemains // lifelengthViewerRemains.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerRemains.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerRemains.ShowLeftHeader = false; lifelengthViewerRemains.LeftHeaderWidth = 0; lifelengthViewerRemains.ShowMinutes = false; lifelengthViewerRemains.Location = new Point(WIDTH_INTERVAL_SECOND, labelRemains.Bottom + HEIGHT_LIFELENGTH_INTERVAL); lifelengthViewerRemains.ReadOnly = true; // // linkLabelRemove // linkLabelRemove.Font = Css.SimpleLink.Fonts.Font; linkLabelRemove.LinkColor = Css.SimpleLink.Colors.LinkColor; linkLabelRemove.Text = "Remove"; linkLabelRemove.Location = new Point(lifelengthViewerRemains.Right - linkLabelRemove.Width, lifelengthViewerRemains.Bottom); linkLabelRemove.TextAlign = ContentAlignment.BottomRight; linkLabelRemove.LinkClicked += linkLabelClear_LinkClicked; // // DetailGeneralInformationControl // BackColor = Css.CommonAppearance.Colors.BackColor; Controls.Add(imageLinkLabelStatus); Controls.Add(labelManHours); Controls.Add(textBoxManHours); Controls.Add(labelCost); Controls.Add(textBoxCost); Controls.Add(labelKitRequired); Controls.Add(textBoxKitRequired); Controls.Add(labelRemarks); Controls.Add(textBoxRemarks); Controls.Add(linkLabelJobCard); Controls.Add(delimiter1); Controls.Add(labelInterval); Controls.Add(lifelengthViewerInterval); Controls.Add(labelNotify); Controls.Add(lifelengthViewerNotify); Controls.Add(delimiter2); Controls.Add(labelNext); Controls.Add(lifelengthViewerNext); Controls.Add(labelRemains); Controls.Add(lifelengthViewerRemains); Controls.Add(linkLabelRemove); // fileControl.Width = LIFELENGTH_VIEWER_WIDTH; }
/// <summary> /// Инициализирует элементы управления /// </summary> private void InitializeComponent() { AutoSize = true; AutoSizeMode = AutoSizeMode.GrowAndShrink; BackColor = Css.CommonAppearance.Colors.BackColor; labelMPDItem = new Label(); labelAtaChapter = new Label(); labelDescription = new Label(); labelPartNo = new Label(); labelSerialNo = new Label(); labelRemarks = new Label(); labelInstallationData = new Label(); labelInstallationDate = new Label(); labelComponentTSNCSN = new Label(); labelAircraftTSNCSN = new Label(); labelHiddenRemarks = new Label(); labelActualState = new Label(); labelDateAsOf = new Label(); labelComponentCurrentTSNCSN = new Label(); labelTCSI = new Label(); textBoxMPDItem = new TextBox(); comboBoxAtaChapter = new ATAChapterComboBox(); textBoxDescription = new TextBox(); textBoxPartNo = new TextBox(); textBoxSerialNo = new TextBox(); checkBoxLifeLimit = new CheckBox(); lifelengthViewerLifeLimit = new LifelengthViewer(); textBoxRemarks = new TextBox(); dateTimePickerInstallationDate = new DateTimePicker(); lifelengthViewerComponentTSNCSN = new LifelengthViewer(); lifelengthViewerAircraftTSNCSN = new LifelengthViewer(); textBoxHiddenRemarks = new TextBox(); dateTimePickerDateAsOf = new DateTimePicker(); lifelengthViewerComponentCurrentTSNCSN = new LifelengthViewer(); lifelengthViewerComponentTCSI = new LifelengthViewer(); delimiter1 = new Delimiter(); delimiter2 = new Delimiter(); // // labelMPDItem // labelMPDItem.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelMPDItem.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelMPDItem.Location = new Point(MARGIN, MARGIN); labelMPDItem.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelMPDItem.Text = "MPD Item:"; labelMPDItem.TextAlign = ContentAlignment.MiddleLeft; // // textBoxMPDItem // textBoxMPDItem.BackColor = Color.White; textBoxMPDItem.Font = Css.OrdinaryText.Fonts.SmallRegularFont; textBoxMPDItem.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxMPDItem.Location = new Point(labelMPDItem.Right, MARGIN); textBoxMPDItem.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); textBoxMPDItem.MaxLength = 50; textBoxMPDItem.TabIndex = 0; // // labelAtaChapter // labelAtaChapter.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelAtaChapter.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelAtaChapter.Location = new Point(MARGIN, labelMPDItem.Bottom + HEIGHT_INTERVAL); labelAtaChapter.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelAtaChapter.Text = "ATA Chapter:"; labelAtaChapter.TextAlign = ContentAlignment.MiddleLeft; // // comboBoxAtaChapter // comboBoxAtaChapter.BackColor = Color.White; comboBoxAtaChapter.DropDownStyle = ComboBoxStyle.DropDown; comboBoxAtaChapter.Font = Css.OrdinaryText.Fonts.SmallRegularFont; comboBoxAtaChapter.ForeColor = Css.OrdinaryText.Colors.ForeColor; comboBoxAtaChapter.Location = new Point(labelAtaChapter.Right, labelMPDItem.Bottom + HEIGHT_INTERVAL); comboBoxAtaChapter.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); comboBoxAtaChapter.TabIndex = 1; // // labelDescription // labelDescription.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelDescription.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelDescription.Location = new Point(MARGIN, labelAtaChapter.Bottom + HEIGHT_INTERVAL); labelDescription.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelDescription.Text = "Description:"; labelDescription.TextAlign = ContentAlignment.MiddleLeft; // // textBoxDescription // textBoxDescription.BackColor = Color.White; textBoxDescription.Font = Css.OrdinaryText.Fonts.SmallRegularFont; textBoxDescription.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxDescription.Location = new Point(labelDescription.Right, labelAtaChapter.Bottom + HEIGHT_INTERVAL); textBoxDescription.ScrollBars = ScrollBars.Vertical; textBoxDescription.Multiline = true; textBoxDescription.Size = new Size(TEXTBOX_WIDTH, 3 * LABEL_HEIGHT + 2 * HEIGHT_INTERVAL); textBoxDescription.MaxLength = 250; textBoxDescription.TabIndex = 2; // // labelPartNo // labelPartNo.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelPartNo.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelPartNo.Location = new Point(MARGIN, textBoxDescription.Bottom + HEIGHT_INTERVAL); labelPartNo.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelPartNo.Text = "Part No:"; labelPartNo.TextAlign = ContentAlignment.MiddleLeft; // // textBoxPartNo // textBoxPartNo.BackColor = Color.White; textBoxPartNo.Font = Css.OrdinaryText.Fonts.SmallRegularFont; textBoxPartNo.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxPartNo.Location = new Point(labelPartNo.Right, textBoxDescription.Bottom + HEIGHT_INTERVAL); textBoxPartNo.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); textBoxPartNo.MaxLength = 100; textBoxPartNo.TabIndex = 3; // // labelSerialNo // labelSerialNo.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelSerialNo.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelSerialNo.Location = new Point(MARGIN, labelPartNo.Bottom + HEIGHT_INTERVAL); labelSerialNo.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelSerialNo.Text = "Serial No:"; labelSerialNo.TextAlign = ContentAlignment.MiddleLeft; // // textBoxSerialNo // textBoxSerialNo.BackColor = Color.White; textBoxSerialNo.Font = Css.OrdinaryText.Fonts.SmallRegularFont; textBoxSerialNo.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxSerialNo.Location = new Point(labelSerialNo.Right, textBoxPartNo.Bottom + HEIGHT_INTERVAL); textBoxSerialNo.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); textBoxSerialNo.MaxLength = 100; textBoxSerialNo.TabIndex = 4; // // checkBoxLifeLimit // checkBoxLifeLimit.Cursor = Cursors.Hand; checkBoxLifeLimit.FlatStyle = FlatStyle.Flat; checkBoxLifeLimit.Font = Css.SimpleLink.Fonts.SmallFont; checkBoxLifeLimit.ForeColor = Css.SimpleLink.Colors.LinkColor; checkBoxLifeLimit.Location = new Point(MARGIN, labelSerialNo.Bottom + HEIGHT_INTERVAL); checkBoxLifeLimit.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); checkBoxLifeLimit.Text = "Life Limit"; checkBoxLifeLimit.CheckedChanged += checkBoxLifeLimit_CheckedChanged; checkBoxLifeLimit.TabIndex = 5; // // lifelengthViewerLifeLimit // lifelengthViewerLifeLimit.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerLifeLimit.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerLifeLimit.ShowLeftHeader = false; lifelengthViewerLifeLimit.LeftHeaderWidth = 0; lifelengthViewerLifeLimit.ShowMinutes = false; lifelengthViewerLifeLimit.Location = new Point(MARGIN, checkBoxLifeLimit.Bottom + HEIGHT_LIFELENGTH_INTERVAL); lifelengthViewerLifeLimit.Enabled = false; lifelengthViewerLifeLimit.TabIndex = 6; // // labelRemarks // labelRemarks.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelRemarks.Location = new Point(MARGIN, lifelengthViewerLifeLimit.Bottom + HEIGHT_INTERVAL); labelRemarks.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelRemarks.TextAlign = ContentAlignment.MiddleLeft; labelRemarks.Text = "Remarks:"; // // textBoxRemarks // textBoxRemarks.BackColor = Color.White; textBoxRemarks.Font = Css.OrdinaryText.Fonts.SmallRegularFont; textBoxRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxRemarks.Location = new Point(labelRemarks.Right, lifelengthViewerLifeLimit.Bottom + HEIGHT_INTERVAL); textBoxRemarks.ScrollBars = ScrollBars.Vertical; textBoxRemarks.Multiline = true; textBoxRemarks.Size = new Size(TEXTBOX_WIDTH, 3 * LABEL_HEIGHT + 2 * HEIGHT_INTERVAL); textBoxRemarks.MaxLength = 340000; textBoxRemarks.TabIndex = 7; // // delimiter1 // delimiter1.Orientation = DelimiterOrientation.Vertical; delimiter1.Location = new Point(WIDTH_INTERVAL - (WIDTH_INTERVAL - MARGIN - LABEL_WIDTH - TEXTBOX_WIDTH) / 2, MARGIN); delimiter1.Height = 265; // // labelInstallationData // labelInstallationData.Font = Css.SmallHeader.Fonts.BoldFont; labelInstallationData.ForeColor = Css.SmallHeader.Colors.ForeColor; labelInstallationData.Size = new Size(CAPTION_WIDTH, LABEL_HEIGHT); labelInstallationData.TextAlign = ContentAlignment.MiddleLeft; labelInstallationData.Text = "Installation Data"; // // labelInstallationDate // labelInstallationDate.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelInstallationDate.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelInstallationDate.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelInstallationDate.Text = "Date:"; labelInstallationDate.TextAlign = ContentAlignment.MiddleLeft; labelInstallationDate.TabIndex = 8; // // dateTimePickerInstallationDate // dateTimePickerInstallationDate.ForeColor = Css.OrdinaryText.Colors.ForeColor; dateTimePickerInstallationDate.CalendarForeColor = Css.OrdinaryText.Colors.ForeColor; dateTimePickerInstallationDate.Font = Css.OrdinaryText.Fonts.SmallRegularFont; dateTimePickerInstallationDate.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); dateTimePickerInstallationDate.Format = DateTimePickerFormat.Custom; dateTimePickerInstallationDate.CustomFormat = new TermsProvider()["DateFormat"].ToString(); dateTimePickerInstallationDate.ValueChanged += dateTimePickerInstallationDate_ValueChanged; dateTimePickerInstallationDate.TabIndex = 9; // // labelComponentTSNCSN // labelComponentTSNCSN.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelComponentTSNCSN.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelComponentTSNCSN.Size = new Size(CAPTION_WIDTH, LABEL_HEIGHT); labelComponentTSNCSN.Text = "Component TSN/CSN:"; labelComponentTSNCSN.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerComponentTSNCSN // lifelengthViewerComponentTSNCSN.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerComponentTSNCSN.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerComponentTSNCSN.ShowLeftHeader = false; lifelengthViewerComponentTSNCSN.LeftHeaderWidth = 0; lifelengthViewerComponentTSNCSN.ShowMinutes = false; lifelengthViewerComponentTSNCSN.LifelengthChanged += lifelengthViewerComponentTSNCSN_LifelengthChanged; lifelengthViewerComponentTSNCSN.TabIndex = 10; // // labelAircraftTSNCSN // labelAircraftTSNCSN.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelAircraftTSNCSN.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelAircraftTSNCSN.Size = new Size(CAPTION_WIDTH, LABEL_HEIGHT); labelAircraftTSNCSN.Text = "Aircraft TSN/CSN:"; labelAircraftTSNCSN.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerAircraftTSNCSN // lifelengthViewerAircraftTSNCSN.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerAircraftTSNCSN.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerAircraftTSNCSN.ShowLeftHeader = false; lifelengthViewerAircraftTSNCSN.LeftHeaderWidth = 0; lifelengthViewerAircraftTSNCSN.ShowMinutes = false; lifelengthViewerAircraftTSNCSN.TabIndex = 11; // // labelHiddenRemarks // labelHiddenRemarks.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelHiddenRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelHiddenRemarks.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT * 2); labelHiddenRemarks.TextAlign = ContentAlignment.TopLeft; labelHiddenRemarks.Text = "Hidden Remarks:"; // // textBoxHiddenRemarks // textBoxHiddenRemarks.BackColor = Color.White; textBoxHiddenRemarks.Font = Css.OrdinaryText.Fonts.SmallRegularFont; textBoxHiddenRemarks.ForeColor = Css.OrdinaryText.Colors.ForeColor; textBoxHiddenRemarks.ScrollBars = ScrollBars.Vertical; textBoxHiddenRemarks.Multiline = true; textBoxHiddenRemarks.Size = new Size(TEXTBOX_WIDTH, 3 * LABEL_HEIGHT + 2 * HEIGHT_INTERVAL); textBoxHiddenRemarks.MaxLength = 340000; textBoxHiddenRemarks.TabIndex = 12; // // delimiter2 // delimiter2.Orientation = DelimiterOrientation.Vertical; delimiter2.Location = new Point(WIDTH_INTERVAL_SECOND - (WIDTH_INTERVAL_SECOND - WIDTH_INTERVAL - LABEL_WIDTH - TEXTBOX_WIDTH) / 2, MARGIN); delimiter2.Height = 265; // // labelActualState // labelActualState.Font = Css.SmallHeader.Fonts.BoldFont; labelActualState.ForeColor = Css.SmallHeader.Colors.ForeColor; labelActualState.Size = new Size(CAPTION_WIDTH, LABEL_HEIGHT); labelActualState.TextAlign = ContentAlignment.MiddleLeft; labelActualState.Text = "Actual State"; // // labelDateAsOf // labelDateAsOf.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelDateAsOf.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelDateAsOf.Size = new Size(LABEL_WIDTH, LABEL_HEIGHT); labelDateAsOf.Text = "Date As Of:"; labelDateAsOf.TextAlign = ContentAlignment.MiddleLeft; // // dateTimePickerDateAsOf // dateTimePickerDateAsOf.ForeColor = Css.OrdinaryText.Colors.ForeColor; dateTimePickerDateAsOf.CalendarForeColor = Css.OrdinaryText.Colors.ForeColor; dateTimePickerDateAsOf.Font = Css.OrdinaryText.Fonts.SmallRegularFont; dateTimePickerDateAsOf.Size = new Size(TEXTBOX_WIDTH, LABEL_HEIGHT); dateTimePickerDateAsOf.Format = DateTimePickerFormat.Custom; dateTimePickerDateAsOf.CustomFormat = new TermsProvider()["DateFormat"].ToString(); dateTimePickerDateAsOf.ValueChanged += dateTimePickerDateAsOf_ValueChanged; dateTimePickerDateAsOf.TabIndex = 13; // // labelComponentCurrentTSNCSN // labelComponentCurrentTSNCSN.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelComponentCurrentTSNCSN.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelComponentCurrentTSNCSN.Size = new Size(CAPTION_WIDTH, LABEL_HEIGHT); labelComponentCurrentTSNCSN.Text = "Component current TSN/CSN:"; labelComponentCurrentTSNCSN.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerComponentCurrentTSNCSN // lifelengthViewerComponentCurrentTSNCSN.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerComponentCurrentTSNCSN.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerComponentCurrentTSNCSN.ShowLeftHeader = false; lifelengthViewerComponentCurrentTSNCSN.LeftHeaderWidth = 0; lifelengthViewerComponentCurrentTSNCSN.ShowMinutes = false; lifelengthViewerComponentCurrentTSNCSN.LifelengthChanged += lifelengthViewerComponentCurrentTSNCSN_LifelengthChanged; lifelengthViewerComponentCurrentTSNCSN.TabIndex = 14; // // labelTCSI // labelTCSI.Font = Css.OrdinaryText.Fonts.SmallRegularFont; labelTCSI.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelTCSI.Size = new Size(CAPTION_WIDTH, LABEL_HEIGHT); labelTCSI.Text = "Component TCSI:"; labelTCSI.TextAlign = ContentAlignment.MiddleLeft; // // lifelengthViewerComponentTCSI // lifelengthViewerComponentTCSI.Font = Css.OrdinaryText.Fonts.SmallRegularFont; lifelengthViewerComponentTCSI.ForeColor = Css.OrdinaryText.Colors.ForeColor; lifelengthViewerComponentTCSI.ShowLeftHeader = false; lifelengthViewerComponentTCSI.LeftHeaderWidth = 0; lifelengthViewerComponentTCSI.ShowMinutes = false; lifelengthViewerComponentTCSI.LifelengthChanged += lifelengthViewerComponentTCSI_LifelengthChanged; lifelengthViewerComponentTCSI.TabIndex = 15; // // DetailGeneralInformationControl // Controls.Add(labelMPDItem); Controls.Add(textBoxMPDItem); Controls.Add(labelAtaChapter); Controls.Add(comboBoxAtaChapter); Controls.Add(labelDescription); Controls.Add(textBoxDescription); Controls.Add(labelPartNo); Controls.Add(textBoxPartNo); Controls.Add(labelSerialNo); Controls.Add(textBoxSerialNo); Controls.Add(checkBoxLifeLimit); Controls.Add(lifelengthViewerLifeLimit); Controls.Add(labelRemarks); Controls.Add(textBoxRemarks); Controls.Add(labelDateAsOf); Controls.Add(dateTimePickerDateAsOf); Controls.Add(labelComponentTSNCSN); Controls.Add(lifelengthViewerComponentTSNCSN); Controls.Add(labelHiddenRemarks); Controls.Add(textBoxHiddenRemarks); if (!isStore) { labelInstallationData.Location = new Point(WIDTH_INTERVAL, MARGIN); labelInstallationDate.Location = new Point(WIDTH_INTERVAL, labelInstallationData.Bottom + HEIGHT_INTERVAL); dateTimePickerInstallationDate.Location = new Point(labelInstallationDate.Right, labelInstallationData.Bottom + HEIGHT_INTERVAL); labelComponentTSNCSN.Location = new Point(WIDTH_INTERVAL, labelInstallationDate.Bottom + HEIGHT_INTERVAL); lifelengthViewerComponentTSNCSN.Location = new Point(WIDTH_INTERVAL, labelComponentTSNCSN.Bottom + HEIGHT_LIFELENGTH_INTERVAL); labelAircraftTSNCSN.Location = new Point(WIDTH_INTERVAL, lifelengthViewerComponentTSNCSN.Bottom + HEIGHT_INTERVAL); lifelengthViewerAircraftTSNCSN.Location = new Point(WIDTH_INTERVAL, labelAircraftTSNCSN.Bottom + HEIGHT_LIFELENGTH_INTERVAL); labelHiddenRemarks.Location = new Point(WIDTH_INTERVAL, lifelengthViewerLifeLimit.Bottom + HEIGHT_INTERVAL); textBoxHiddenRemarks.Location = new Point(labelHiddenRemarks.Right, lifelengthViewerLifeLimit.Bottom + HEIGHT_INTERVAL); labelActualState.Location = new Point(WIDTH_INTERVAL_SECOND, MARGIN); labelDateAsOf.Location = new Point(WIDTH_INTERVAL_SECOND, labelActualState.Bottom + HEIGHT_INTERVAL); dateTimePickerDateAsOf.Location = new Point(labelDateAsOf.Right, labelActualState.Bottom + HEIGHT_INTERVAL); labelComponentCurrentTSNCSN.Location = new Point(WIDTH_INTERVAL_SECOND, labelDateAsOf.Bottom + HEIGHT_INTERVAL); lifelengthViewerComponentCurrentTSNCSN.Location = new Point(WIDTH_INTERVAL_SECOND, labelComponentCurrentTSNCSN.Bottom + HEIGHT_LIFELENGTH_INTERVAL); labelTCSI.Location = new Point(WIDTH_INTERVAL_SECOND, lifelengthViewerComponentCurrentTSNCSN.Bottom + HEIGHT_INTERVAL); lifelengthViewerComponentTCSI.Location = new Point(WIDTH_INTERVAL_SECOND, labelTCSI.Bottom + HEIGHT_LIFELENGTH_INTERVAL); Controls.Add(delimiter1); Controls.Add(labelInstallationData); Controls.Add(labelInstallationDate); Controls.Add(dateTimePickerInstallationDate); Controls.Add(labelAircraftTSNCSN); Controls.Add(lifelengthViewerAircraftTSNCSN); Controls.Add(delimiter2); Controls.Add(labelActualState); Controls.Add(labelComponentCurrentTSNCSN); Controls.Add(lifelengthViewerComponentCurrentTSNCSN); Controls.Add(labelTCSI); Controls.Add(lifelengthViewerComponentTCSI); } else { dateTimePickerDateAsOf.TabIndex = 9; labelDateAsOf.Location = new Point(WIDTH_INTERVAL, MARGIN); dateTimePickerDateAsOf.Location = new Point(labelDateAsOf.Right, MARGIN); labelComponentTSNCSN.Location = new Point(WIDTH_INTERVAL, labelDateAsOf.Bottom + HEIGHT_INTERVAL); lifelengthViewerComponentTSNCSN.Location = new Point(WIDTH_INTERVAL, labelComponentTSNCSN.Bottom + HEIGHT_LIFELENGTH_INTERVAL); labelHiddenRemarks.Location = new Point(WIDTH_INTERVAL, lifelengthViewerComponentTSNCSN.Bottom + HEIGHT_INTERVAL); textBoxHiddenRemarks.Location = new Point(labelHiddenRemarks.Right, lifelengthViewerComponentTSNCSN.Bottom + HEIGHT_INTERVAL); } }
/// <summary> /// /// </summary> protected void UpdateControl() { Text = $"{_typeToImport.Name} Import Form"; panelControls.Controls.Clear(); if (_typeToImport == null) { return; } List <PropertyInfo> properties = GetTypeProperties(_typeToImport); if (properties.Count == 0) { return; } int columnCount = 1;//количество колонок ЭУ List <Label> labels = new List <Label>(); List <Control> controls = new List <Control>(); Dictionary <PropertyInfo, Control> pairControls = new Dictionary <PropertyInfo, Control>(); string errorMessage = ""; foreach (PropertyInfo t in properties) { PropertyInfo pairProperty = null; ExcelImportAttribute attr = (ExcelImportAttribute)t.GetCustomAttributes(typeof(ExcelImportAttribute), false).First(); labels.Add(new Label { Text = attr.Title, AutoSize = true }); //Если значение должно быть не пустым или не NULL //то шрифт леибла утснанавливается в ЖИРНЫЙ(BOLD) NotNullAttribute notNullAttribute = (NotNullAttribute)t.GetCustomAttributes(typeof(NotNullAttribute), false).FirstOrDefault(); if (notNullAttribute != null) { labels.Last().Font = new Font(labels.Last().Font, FontStyle.Bold); } Control c = null; if (!string.IsNullOrEmpty(attr.PairControlPropertyName)) { pairProperty = _typeToImport.GetProperty(attr.PairControlPropertyName); } if (pairProperty != null) { try { c = GetControl(pairProperty, attr.PairControlWidht, attr.PairControlEnabled); } catch (Exception ex) { if (errorMessage != "") { errorMessage += "\n "; } errorMessage += $"Pair property '{attr.PairControlPropertyName}' raise error {ex.Message}"; } if (c is ThresholdControl) { columnCount = 2; } pairControls.Add(t, c); } c = null; try { int cw = pairProperty != null ? attr.Width - attr.PairControlWidht - 5 : attr.Width; c = GetControl(t, cw, true); } catch (Exception ex) { if (errorMessage != "") { errorMessage += "\n "; } errorMessage += $"'{attr.Title}' raise error {ex.Message}"; } if (c is LifelengthViewer) { ((LifelengthViewer)c).LeftHeader = attr.Title; } if (c is ThresholdControl) { columnCount = 2; } controls.Add(c); } #region Компоновка контролов в одну колонку if (columnCount == 1) { #region расчет длины лейблов и контролов int maxLabelXSize = 0; int maxControlXSize = 0;//максимальная длиня ЭУ for (int i = 0; i < labels.Count; i++) { //на каждый лейбл приходится по одному контролу, //поэтому обе коллекции просматриваются одновременно if (controls[i] != null && controls[i] is LifelengthViewer) { LifelengthViewer llv = (LifelengthViewer)controls[i]; if (llv.LeftHeaderWidth > maxLabelXSize) { maxLabelXSize = llv.LeftHeaderWidth; } if (llv.WidthWithoutLeftHeader > maxControlXSize) { maxControlXSize = llv.WidthWithoutLeftHeader; } if (i > 0 && controls[i - 1] != null && controls[i - 1] is LifelengthViewer) { llv.ShowHeaders = false; } continue; } //выше рассматривались контролы, имеющие собственные лейблы //теперь идет просмотр самих леблов if (labels[i].PreferredWidth > maxLabelXSize) { maxLabelXSize = labels[i].PreferredWidth; } //размеры контролов if (controls[i] != null && controls[i].Size.Width > maxControlXSize) { maxControlXSize = controls[i].Size.Width; } } #endregion for (int i = 0; i < properties.Count; i++) { Control pairControl = null; if (pairControls.ContainsKey(properties[i])) { pairControl = pairControls[properties[i]]; } if (i == 0) { labels[i].Location = new Point(3, 3); if (controls[i] != null) { if (controls[i] is LifelengthViewer) { controls[i].Location = new Point((maxLabelXSize + labels[i].Location.X) - ((LifelengthViewer)controls[i]).LeftHeaderWidth, 3); } else { if (pairControl != null) { pairControl.Location = new Point(maxLabelXSize + labels[i].Location.X + 5, 3); controls[i].Location = new Point(pairControl.Location.X + pairControl.Size.Width + 5, 3); controls[i].Width = maxControlXSize - (pairControl.Size.Width + 5); } else { controls[i].Location = new Point(maxLabelXSize + labels[i].Location.X + 5, 3); controls[i].Width = maxControlXSize; } } } } else { Point labelLocation = new Point(3, 0); if (controls[i - 1] != null) { labelLocation.Y = controls[i - 1].Location.Y + controls[i - 1].Size.Height + 5; } else { labelLocation.Y = labels[i - 1].Location.Y + labels[i - 1].Size.Height + 5; } labels[i].Location = labelLocation; if (controls[i] != null) { if (controls[i] is LifelengthViewer) { controls[i].Location = new Point((maxLabelXSize + labelLocation.X) - ((LifelengthViewer)controls[i]).LeftHeaderWidth, labelLocation.Y); } else { if (pairControl != null) { pairControl.Location = new Point(maxLabelXSize + labelLocation.X + 5, labelLocation.Y); controls[i].Location = new Point(pairControl.Location.X + pairControl.Size.Width + 5, labelLocation.Y); controls[i].Width = maxControlXSize - (pairControl.Size.Width + 5); } else { controls[i].Location = new Point(maxLabelXSize + labelLocation.X + 5, labelLocation.Y); controls[i].Width = maxControlXSize; } } } } if (controls[i] == null || (controls[i] != null && !(controls[i] is LifelengthViewer))) { //Если контрол не является LifelengthViewer-ом то нужно добавить лейбл panelControls.Controls.Add(labels[i]); } if (pairControl != null) { panelControls.Controls.Add(pairControl); } panelControls.Controls.Add(controls[i]); } } #endregion #region Компоновка контролов в две колонки if (columnCount == 2) { #region расчет длины лейблов и контролов int fMaxLabelXSize = 0, sMaxLabelXSize = 0; int fMaxControlXSize = 0, sMaxControlXSize = 0; bool checkFirst = true;//флаг проверяемой колонки for (int i = 0; i < labels.Count; i++) { //на каждый лейбл приходится по одному контролу, //поэтому обе коллекции просматриваются одновременно if (controls[i] != null && controls[i] is ThresholdControl) { //контрол порога выполнения директивы //влияет на длину лейблов обоих колонок ThresholdControl ddtc = (ThresholdControl)controls[i]; //размеры заголовков if (ddtc.MaxFirstColLabelWidth > fMaxLabelXSize) { fMaxLabelXSize = ddtc.MaxFirstColLabelWidth; } if (ddtc.MaxSecondColLabelWidth > sMaxLabelXSize) { sMaxLabelXSize = ddtc.MaxSecondColLabelWidth; } //размеры контролов if (ddtc.MaxFirstColControlWidth > fMaxControlXSize) { fMaxControlXSize = ddtc.MaxFirstColControlWidth; } if (ddtc.MaxSecondColControlWidth > sMaxControlXSize) { sMaxControlXSize = ddtc.MaxSecondColControlWidth; } //т.к. DetailDirectiveThresholdControl занимает 2 колонки, //то следующий контрол всегда будет располагаться в первой колонке checkFirst = true; continue; } if (controls[i] != null && controls[i] is LifelengthViewer) { LifelengthViewer llv = (LifelengthViewer)controls[i]; if (checkFirst && llv.LeftHeaderWidth > fMaxLabelXSize) { fMaxLabelXSize = llv.LeftHeaderWidth; } if (!checkFirst && llv.LeftHeaderWidth > sMaxLabelXSize) { sMaxLabelXSize = llv.LeftHeaderWidth; } //размеры контролов if (checkFirst && llv.WidthWithoutLeftHeader > fMaxControlXSize) { fMaxControlXSize = llv.WidthWithoutLeftHeader; } if (!checkFirst && llv.WidthWithoutLeftHeader > sMaxControlXSize) { sMaxControlXSize = llv.WidthWithoutLeftHeader; } checkFirst = !checkFirst; continue; } //выше рассматривались контролы, имеющие собственные лейблы //теперь идет просмотр самих леблов if (checkFirst && labels[i].PreferredWidth > fMaxLabelXSize) { fMaxLabelXSize = labels[i].PreferredWidth; } if (!checkFirst && labels[i].PreferredWidth > sMaxLabelXSize) { sMaxLabelXSize = labels[i].PreferredWidth; } //размеры контролов if (controls[i] != null) { if (checkFirst && controls[i].Size.Width > fMaxControlXSize) { fMaxControlXSize = controls[i].Size.Width; } if (!checkFirst && controls[i].Size.Width > sMaxControlXSize) { sMaxControlXSize = controls[i].Size.Width; } } checkFirst = !checkFirst; } #endregion checkFirst = true; const int firstCol = 3; int secondCol = (3 + fMaxLabelXSize + 5 + fMaxControlXSize + 50); for (int i = 0; i < labels.Count; i++) { int top, left, labelSize, controlsize; if (i == 0) { top = 3; left = firstCol; labelSize = fMaxLabelXSize; controlsize = fMaxControlXSize; } else { if (checkFirst || (controls[i] != null && controls[i] is ThresholdControl)) { left = firstCol; labelSize = fMaxLabelXSize; controlsize = fMaxControlXSize; //определение самого нижнего Bottoma 2-х предыдущих контролов int bottom1, bottom2; //определение нижней точки предыдущего контрола //(он будет либо во второй колонке предыдущего ряда, либо занимать весь ряд) if (controls[i - 1] != null) { bottom2 = controls[i - 1].Bottom + 5; } else { bottom2 = labels[i - 1].Bottom + 5; } //определение нижней точки пред-предыдущего контрола //он может и отсутствовать if ((i - 2) >= 0) { if (controls[i - 2] != null) { bottom1 = controls[i - 2].Bottom + 5; } else { bottom1 = labels[i - 2].Bottom + 5; } } else { bottom1 = 0; } top = bottom1 > bottom2 ? bottom1 : bottom2; } else { left = secondCol; labelSize = sMaxLabelXSize; controlsize = sMaxControlXSize; top = controls[i - 1] != null ? controls[i - 1].Location.Y : labels[i - 1].Location.Y; } } if (controls[i] != null && controls[i] is ThresholdControl) { ThresholdControl ddtc = (ThresholdControl)controls[i]; controls[i].Location = new Point(3, top); //выравнивание первой колонки ddtc.SetFirstColumnPos(firstCol + fMaxLabelXSize); //выравнивание второй колонки ddtc.SetSecondColumnPos(secondCol + sMaxLabelXSize); panelControls.Controls.Add(controls[i]); checkFirst = true; continue; } if (controls[i] != null && controls[i] is LifelengthViewer) { controls[i].Location = new Point((labelSize + left) - ((LifelengthViewer)controls[i]).LeftHeaderWidth, top); panelControls.Controls.Add(controls[i]); checkFirst = !checkFirst; continue; } labels[i].Location = new Point(left, top); if (controls[i] != null) { controls[i].Location = new Point(labelSize + left + 5, top); controls[i].Width = controlsize; } panelControls.Controls.Add(labels[i]); panelControls.Controls.Add(controls[i]); checkFirst = !checkFirst; } } #endregion if (errorMessage != "") { MessageBox.Show(errorMessage, (string)new GlobalTermsProvider()["SystemName"], MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }