///<summary>
        /// Создается объект, описывающий отображение добавления директивы
        ///</summary>
        private DamageDirectiveAddingScreen()
        {
            Dock           = DockStyle.Fill;
            BackColor      = Css.CommonAppearance.Colors.BackColor;
            footerControl  = new FooterControl();
            headerControl  = new HeaderControl();
            aircraftHeader = new AircraftHeaderControl();
            mainPanel      = new Panel();

            generalDataAndPerformanceControl = new DamageDirectiveGeneralInformationControl();

            generalDataAndPerformanceContainer = new ExtendableRichContainer();

            aircraftHeader.OperatorClickable = true;
            aircraftHeader.AircraftClickable = true;
            //
            // headerControl
            //
            headerControl.Controls.Add(aircraftHeader);
            headerControl.ButtonReload.Icon           = icons.SaveAndAdd;
            headerControl.ButtonReload.IconNotEnabled = icons.SaveAndAddGray;
            headerControl.ButtonReload.IconLayout     = ImageLayout.Center;
            headerControl.ButtonReload.TextMain       = "Save and";
            headerControl.ButtonReload.TextSecondary  = "add another";
            headerControl.ButtonReload.Click         += buttonSaveAndAdd_Click;

            headerControl.ButtonEdit.Icon                = icons.Save;
            headerControl.ButtonEdit.IconNotEnabled      = icons.SaveGray;
            headerControl.ButtonEdit.IconLayout          = ImageLayout.Center;
            headerControl.ButtonEdit.ReflectionType      = ReflectionTypes.DisplayInCurrent;
            headerControl.ButtonEdit.TextMain            = "Save";
            headerControl.ButtonEdit.TextSecondary       = "and Edit";
            headerControl.ButtonEdit.DisplayerRequested += buttonSaveAndEdit_DisplayerRequested;
            headerControl.TabIndex = 0;
            //
            // mainPanel
            //
            mainPanel.Dock       = DockStyle.Fill;
            mainPanel.AutoScroll = true;
            mainPanel.TabIndex   = 1;
            //
            // footerControl
            //
            footerControl.TabIndex = 2;
            //
            // generalDataAndPerformanceContainer
            //
            generalDataAndPerformanceContainer.Dock          = DockStyle.Top;
            generalDataAndPerformanceContainer.UpperLeftIcon = icons.GrayArrow;
            generalDataAndPerformanceContainer.Caption       = "General data and Performance";
            generalDataAndPerformanceContainer.MainControl   = generalDataAndPerformanceControl;
            generalDataAndPerformanceContainer.TabIndex      = 0;

            mainPanel.Controls.Add(generalDataAndPerformanceContainer);

            Controls.Add(mainPanel);
            Controls.Add(footerControl);
            Controls.Add(headerControl);
        }
예제 #2
0
        ///<summary>
        /// Создает страницу для отображения информации об одной директиве
        ///</summary>
        /// <param name="directive">Директива</param>
        public DamageDirectiveScreen(BaseDetailDirective directive)
        {
            if (directive == null)
            {
                throw new ArgumentNullException("directive", "Argument cannot be null");
            }
            currentDirective = directive;
            BackColor        = Css.CommonAppearance.Colors.BackColor;
            Dock             = DockStyle.Fill;

            footerControl  = new FooterControl();
            headerControl  = new HeaderControl();
            aircraftHeader = new AircraftHeaderControl(directive.Parent.Parent as Aircraft, true);

            summaryDirectiveContainer          = new ExtendableRichContainer();
            generalDataAndPerformanceContainer = new ExtendableRichContainer();
            complianceDirectiveContainer       = new ExtendableRichContainer();

            summaryDirectiveControl          = new DamageDirectiveSummaryInformationControl(directive);
            generalDataAndPerformanceControl = new DamageDirectiveGeneralInformationControl(directive);
            complianceDirectiveControl       = new DirectiveComplianceListView(directive);

            panelCompliance = new Panel();
            mainPanel       = new Panel();
            panelHeader     = new Panel();

            buttonAddPerformance   = new AvButtonT();
            buttonDirectiveClosing = new AvButtonT();
            buttonDeleteRecord     = new AvButtonT();
            buttonEditRecord       = new AvButtonT();
            buttonDeleteDirective  = new RichReferenceButton();

            //
            // aircraftHeader
            //
            aircraftHeader.AircraftClickable = true;
            //
            // headerControl
            //
            headerControl.Controls.Add(aircraftHeader);
            headerControl.ButtonEdit.TextMain                  = "Save";
            headerControl.ButtonEdit.Icon                      = icons.Save;
            headerControl.ButtonEdit.IconNotEnabled            = icons.SaveGray;
            headerControl.ContextActionControl.ShowPrintButton = true;
            headerControl.TabIndex = 0;
            headerControl.ContextActionControl.ButtonPrint.DisplayerRequested += ButtonPrint_DisplayerRequested;
            headerControl.ButtonEdit.DisplayerRequested += ButtonSave_DisplayerRequested;
            headerControl.ReloadRised += headerControl_ReloadRised;
            headerControl.ContextActionControl.ButtonHelp.TopicID = "work_with_the_directive";
            //
            // footerControl
            //
            footerControl.TabIndex = 2;
            //
            // mainPanel
            //
            mainPanel.AutoScroll = true;
            mainPanel.Dock       = DockStyle.Fill;
            mainPanel.TabIndex   = 1;
            mainPanel.Controls.Add(containedPanel);
            //
            // containedPanel
            //
            containedPanel.AutoSize      = true;
            containedPanel.AutoSizeMode  = AutoSizeMode.GrowAndShrink;
            containedPanel.FlowDirection = FlowDirection.TopDown;
            containedPanel.TabIndex      = 1;
            //
            // statusLinkLabel
            //
            statusLinkLabel.ActiveLinkColor        = Color.Black;
            statusLinkLabel.Enabled                = false;
            statusLinkLabel.HoveredLinkColor       = Color.Black;
            statusLinkLabel.ImageBackColor         = Color.Transparent;
            statusLinkLabel.ImageLayout            = ImageLayout.Center;
            statusLinkLabel.LinkColor              = Color.DimGray;
            statusLinkLabel.LinkMouseCapturedColor = Color.Empty;
            statusLinkLabel.Location               = new Point(5, 10);
            statusLinkLabel.Size      = new Size(500, 27);
            statusLinkLabel.TextAlign = ContentAlignment.MiddleLeft;
            statusLinkLabel.TextFont  = Css.OrdinaryText.Fonts.RegularFont;
            //
            // summaryDirectiveContainer
            //
            summaryDirectiveContainer.BackColor         = Css.CommonAppearance.Colors.BackColor;
            summaryDirectiveContainer.LabelCaption.Text = "Directive " + directive.Title + " Summary";
            summaryDirectiveContainer.MainControl       = summaryDirectiveControl;
            summaryDirectiveContainer.UpperLeftIcon     = icons.GrayArrow;
            summaryDirectiveContainer.TabIndex          = 1;
            //
            // generalDataAndPerformanceContainer
            //
            generalDataAndPerformanceContainer.BackColor         = Css.CommonAppearance.Colors.BackColor;
            generalDataAndPerformanceContainer.Extended          = false;
            generalDataAndPerformanceContainer.LabelCaption.Text = "General Data And Performance";
            generalDataAndPerformanceContainer.Location          = new Point(0, summaryDirectiveContainer.Bottom);
            generalDataAndPerformanceContainer.MainControl       = generalDataAndPerformanceControl;
            generalDataAndPerformanceContainer.UpperLeftIcon     = icons.GrayArrow;
            generalDataAndPerformanceContainer.TabIndex          = 2;
            //
            // panelHeader
            //
            panelHeader.Size     = new Size(1250, 50);
            panelHeader.TabIndex = 0;
            panelHeader.Controls.Add(buttonDeleteDirective);
            panelHeader.Controls.Add(statusLinkLabel);
            //
            // buttonAddPerformance
            //
            buttonAddPerformance.BackColor          = Color.Transparent;
            buttonAddPerformance.FontMain           = Css.HeaderControl.Fonts.PrimaryFont;
            buttonAddPerformance.FontSecondary      = Css.HeaderControl.Fonts.PrimaryFont;
            buttonAddPerformance.ForeColorMain      = Css.HeaderControl.Colors.PrimaryColor;
            buttonAddPerformance.ForeColorSecondary = Css.HeaderControl.Colors.PrimaryColor;
            buttonAddPerformance.Icon               = icons.Add;
            buttonAddPerformance.IconNotEnabled     = icons.AddGray;
            buttonAddPerformance.IconLayout         = ImageLayout.Center;
            buttonAddPerformance.PaddingSecondary   = new Padding(0);
            buttonAddPerformance.Size               = new Size(160, 50);
            buttonAddPerformance.TabIndex           = 16;
            buttonAddPerformance.TextAlignMain      = ContentAlignment.MiddleLeft;
            buttonAddPerformance.TextAlignSecondary = ContentAlignment.TopCenter;
            buttonAddPerformance.TextMain           = "Register Performance";
            buttonAddPerformance.Click             += buttonAddNewRecord_Click;
            //
            // buttonDirectiveClosing
            //
            buttonDirectiveClosing.BackColor          = Color.Transparent;
            buttonDirectiveClosing.FontMain           = Css.HeaderControl.Fonts.PrimaryFont;
            buttonDirectiveClosing.FontSecondary      = Css.HeaderControl.Fonts.PrimaryFont;
            buttonDirectiveClosing.ForeColorMain      = Css.HeaderControl.Colors.PrimaryColor;
            buttonDirectiveClosing.ForeColorSecondary = Css.HeaderControl.Colors.PrimaryColor;
            buttonDirectiveClosing.Icon               = icons.Add;
            buttonDirectiveClosing.IconNotEnabled     = icons.AddGray;
            buttonDirectiveClosing.IconLayout         = ImageLayout.Center;
            buttonDirectiveClosing.PaddingSecondary   = new Padding(0);
            buttonDirectiveClosing.Size               = new Size(150, 50);
            buttonDirectiveClosing.TabIndex           = 16;
            buttonDirectiveClosing.TextAlignMain      = ContentAlignment.MiddleLeft;
            buttonDirectiveClosing.TextAlignSecondary = ContentAlignment.TopCenter;
            buttonDirectiveClosing.TextMain           = "Close Directive";
            buttonDirectiveClosing.Click             += buttonDirectiveClosing_Click;
            //
            // buttonEditRecord
            //
            buttonEditRecord.BackColor          = Color.Transparent;
            buttonEditRecord.FontMain           = Css.HeaderControl.Fonts.PrimaryFont;
            buttonEditRecord.FontSecondary      = Css.HeaderControl.Fonts.PrimaryFont;
            buttonEditRecord.ForeColorMain      = Css.HeaderControl.Colors.PrimaryColor;
            buttonEditRecord.ForeColorSecondary = Css.HeaderControl.Colors.PrimaryColor;
            buttonEditRecord.Icon               = icons.Edit;
            buttonEditRecord.IconNotEnabled     = icons.EditGray;
            buttonEditRecord.IconLayout         = ImageLayout.Center;
            buttonEditRecord.PaddingSecondary   = new Padding(0);
            buttonEditRecord.Size               = new Size(130, 50);
            buttonEditRecord.TabIndex           = 16;
            buttonEditRecord.TextAlignMain      = ContentAlignment.MiddleLeft;
            buttonEditRecord.TextAlignSecondary = ContentAlignment.TopCenter;
            buttonEditRecord.TextMain           = "Edit";
            buttonEditRecord.Click             += buttonEditRecord_Click;
            //
            // buttonDeleteRecord
            //
            buttonDeleteRecord.BackColor          = Color.Transparent;
            buttonDeleteRecord.Cursor             = Cursors.Hand;
            buttonDeleteRecord.FontMain           = Css.HeaderControl.Fonts.PrimaryFont;
            buttonDeleteRecord.FontSecondary      = Css.HeaderControl.Fonts.PrimaryFont;
            buttonDeleteRecord.ForeColorMain      = Css.HeaderControl.Colors.PrimaryColor;
            buttonDeleteRecord.ForeColorSecondary = Css.HeaderControl.Colors.PrimaryColor;
            buttonDeleteRecord.Icon               = icons.Delete;
            buttonDeleteRecord.IconNotEnabled     = icons.DeleteGray;
            buttonDeleteRecord.IconLayout         = ImageLayout.Center;
            buttonDeleteRecord.PaddingSecondary   = new Padding(0);
            buttonDeleteRecord.Size               = new Size(150, 50);
            buttonDeleteRecord.TabIndex           = 16;
            buttonDeleteRecord.TextAlignMain      = ContentAlignment.MiddleLeft;
            buttonDeleteRecord.TextAlignSecondary = ContentAlignment.TopCenter;
            buttonDeleteRecord.TextMain           = "Remove";
            buttonDeleteRecord.Click             += referenceAvButtonDeleteRecord_Click;
            //
            // buttonDeleteDirective
            //
            buttonDeleteDirective.Anchor             = AnchorStyles.Right | AnchorStyles.Top;
            buttonDeleteDirective.BackColor          = Color.Transparent;
            buttonDeleteDirective.FontMain           = Css.HeaderControl.Fonts.PrimaryFont;
            buttonDeleteDirective.FontSecondary      = Css.HeaderControl.Fonts.PrimaryFont;
            buttonDeleteDirective.ForeColorMain      = Css.HeaderControl.Colors.PrimaryColor;
            buttonDeleteDirective.ForeColorSecondary = Css.HeaderControl.Colors.PrimaryColor;
            buttonDeleteDirective.Location           = new Point(panelHeader.Right - 160, 0);
            buttonDeleteDirective.Icon                = icons.Delete;
            buttonDeleteDirective.IconNotEnabled      = icons.DeleteGray;
            buttonDeleteDirective.IconLayout          = ImageLayout.Center;
            buttonDeleteDirective.PaddingMain         = new Padding(3, 0, 0, 0);
            buttonDeleteDirective.ReflectionType      = ReflectionTypes.CloseSelected;
            buttonDeleteDirective.Size                = new Size(160, 50);
            buttonDeleteDirective.TabIndex            = 16;
            buttonDeleteDirective.TextAlignMain       = ContentAlignment.MiddleLeft;
            buttonDeleteDirective.TextAlignSecondary  = ContentAlignment.TopLeft;
            buttonDeleteDirective.TextMain            = "Delete";
            buttonDeleteDirective.TextSecondary       = "directive";
            buttonDeleteDirective.DisplayerRequested += buttonDeleteDirective_DisplayerRequested;
            //
            // complianceDirectiveControl
            //
            complianceDirectiveControl.Dock = DockStyle.Top;
            complianceDirectiveControl.SelectedItemsChanged += complianceDirectiveControl_SelectedItemsChanged;
            complianceDirectiveControl.ItemEdited           += complianceDirectiveControl_ItemEdited;
            complianceDirectiveControl.SizeChanged          += complianceDirectiveControl_SizeChanged;
            //
            // panelCompliance
            //
            panelCompliance.AutoSize     = true;
            panelCompliance.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            panelCompliance.BackColor    = Css.CommonAppearance.Colors.BackColor;
            panelCompliance.Dock         = DockStyle.Top;
            panelCompliance.Visible      = false;
            panelCompliance.TabIndex     = 5;
            panelCompliance.Controls.Add(complianceDirectiveControl);
            panelCompliance.Controls.Add(buttonAddPerformance);
            panelCompliance.Controls.Add(buttonDirectiveClosing);
            panelCompliance.Controls.Add(buttonEditRecord);
            panelCompliance.Controls.Add(buttonDeleteRecord);
            //
            // complianceDirectiveContainer
            //
            complianceDirectiveContainer.Dock              = DockStyle.Top;
            complianceDirectiveContainer.Extended          = false;
            complianceDirectiveContainer.LabelCaption.Text = "Compliance";
            complianceDirectiveContainer.UpperLeftIcon     = icons.GrayArrow;
            complianceDirectiveContainer.Extending        += complianceDirectiveContainer_Extending;
            complianceDirectiveContainer.TabIndex          = 4;


            containedPanel.Controls.Add(panelHeader);
            containedPanel.Controls.Add(summaryDirectiveContainer);
            containedPanel.Controls.Add(generalDataAndPerformanceContainer);
            containedPanel.Controls.Add(complianceDirectiveContainer);
            containedPanel.Controls.Add(panelCompliance);

            Controls.Add(mainPanel);
            Controls.Add(footerControl);
            Controls.Add(headerControl);

            UpdateDirective();


            complianceDirectiveControl_SelectedItemsChanged(complianceDirectiveControl, new SelectedItemsChangeEventArgs(0));
        }