Пример #1
0
        /// <summary>
        /// —оздает элемент управлени¤ дл¤ отображени¤ отдельного агрегата
        /// </summary>
        /// <param name="detail"></param>
        public TemplateDetailScreen(TemplateAbstractDetail detail)
        {
            if (detail == null)
            {
                throw new ArgumentNullException("detail", "Argument cannot be null");
            }

            currentDetail = detail;

            BackColor     = Css.CommonAppearance.Colors.BackColor;
            Dock          = DockStyle.Fill;
            footerControl = new FooterControl();
            headerControl = new HeaderControl();
            if (currentDetail is TemplateDetail)
            {
                aircraftHeader = new TemplateAircraftHeaderControl(currentDetail.Parent.Parent as TemplateAircraft, true);
            }
            else
            {
                aircraftHeader = new TemplateAircraftHeaderControl(((TemplateBaseDetail)currentDetail).ParentAircraft, true);
            }
            generalInformationControl   = new TemplateDetailGeneralInformationControl(currentDetail);
            limitationControl           = new TemplateDatailLimitationsMaxResourcesControl(currentDetail);
            parametersControl           = new TemplateDetailParametersControl(currentDetail);
            generalInformationContainer = new ExtendableRichContainer();
            limitationsContainer        = new ExtendableRichContainer();
            parametersContainer         = new ExtendableRichContainer();
            buttonDeleteDetail          = new RichReferenceButton();
            buttonAddTemplate           = new AvButtonT();
            //
            // aircraftHeader
            //
            aircraftHeader.AircraftClickable = true;
            //
            // headerControl
            //
            headerControl.Controls.Add(aircraftHeader);
            headerControl.ButtonEdit.TextMain       = "Save";
            headerControl.ButtonEdit.Icon           = icons.Save;
            headerControl.ButtonEdit.IconNotEnabled = icons.SaveGray;
            headerControl.TabIndex = 0;
            headerControl.ButtonEdit.DisplayerRequested += ButtonSave_DisplayerRequested;
            headerControl.ReloadRised += headerControl_ReloadRised;
            //
            // generalInformationContainer
            //
            generalInformationContainer.Dock          = DockStyle.Top;
            generalInformationContainer.UpperLeftIcon = icons.GrayArrow;
            generalInformationContainer.Caption       = "Component General Information";
            generalInformationContainer.MainControl   = generalInformationControl;
            generalInformationContainer.TabIndex      = 1;
            //
            // limitationsContainer
            //
            limitationsContainer.Dock          = DockStyle.Top;
            limitationsContainer.UpperLeftIcon = icons.GrayArrow;
            limitationsContainer.Caption       = "Limitations. Max resources";
            limitationsContainer.MainControl   = limitationControl;
            limitationsContainer.TabIndex      = 2;
            //
            // parametersContainer
            //
            parametersContainer.Dock          = DockStyle.Top;
            parametersContainer.UpperLeftIcon = icons.GrayArrow;
            parametersContainer.Caption       = "Parameters";
            parametersContainer.MainControl   = parametersControl;
            parametersContainer.TabIndex      = 3;
            //
            // panelHeader
            //
            panelHeader.AutoSize     = true;
            panelHeader.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            panelHeader.Dock         = DockStyle.Top;
            panelHeader.TabIndex     = 0;
            panelHeader.Controls.Add(buttonDeleteDetail);
            //
            // buttonDeleteDetail
            //
            buttonDeleteDetail.Anchor             = AnchorStyles.Right | AnchorStyles.Top;
            buttonDeleteDetail.BackColor          = Color.Transparent;
            buttonDeleteDetail.FontMain           = Css.HeaderControl.Fonts.PrimaryFont;
            buttonDeleteDetail.FontSecondary      = Css.HeaderControl.Fonts.PrimaryFont;
            buttonDeleteDetail.ForeColorMain      = Css.HeaderControl.Colors.PrimaryColor;
            buttonDeleteDetail.ForeColorSecondary = Css.HeaderControl.Colors.PrimaryColor;
            buttonDeleteDetail.Location           = new Point(panelHeader.Right - 160, 0);
            buttonDeleteDetail.Icon                  = icons.Delete;
            buttonDeleteDetail.IconNotEnabled        = icons.DeleteGray;
            buttonDeleteDetail.IconLayout            = ImageLayout.Center;
            buttonDeleteDetail.Name                  = "buttonDeleteDetail";
            buttonDeleteDetail.NormalBackgroundImage = null;
            buttonDeleteDetail.PaddingMain           = new Padding(3, 0, 0, 0);
            buttonDeleteDetail.ReflectionType        = ReflectionTypes.CloseSelected;
            buttonDeleteDetail.Size                  = new Size(160, 50);
            buttonDeleteDetail.TabIndex              = 16;
            buttonDeleteDetail.TextAlignMain         = ContentAlignment.MiddleLeft;
            buttonDeleteDetail.TextAlignSecondary    = ContentAlignment.TopLeft;
            buttonDeleteDetail.TextMain              = "Delete";
            buttonDeleteDetail.TextSecondary         = "component";
            buttonDeleteDetail.DisplayerRequested   += avButtonDeleteDetail_DisplayerRequested;
            //
            // buttonAddTemplate
            //
            buttonAddTemplate.Anchor         = AnchorStyles.Bottom | AnchorStyles.Right;
            buttonAddTemplate.FontMain       = Css.HeaderControl.Fonts.PrimaryFont;
            buttonAddTemplate.ForeColorMain  = Css.HeaderControl.Colors.PrimaryColor;
            buttonAddTemplate.Icon           = icons.Add;
            buttonAddTemplate.IconNotEnabled = icons.AddGray;
            buttonAddTemplate.Width          = 160;
            buttonAddTemplate.Location       = new Point(mainPanel.Right - buttonAddTemplate.Width - 10, mainPanel.Bottom - buttonAddTemplate.Height - 10);
            buttonAddTemplate.TextMain       = "Add To Database";
            buttonAddTemplate.Click         += buttonAddTemplate_Click;
            buttonAddTemplate.TabIndex       = 4;
            buttonAddTemplate.Visible        = false;
            //
            // mainPanel
            //
            mainPanel.Dock       = DockStyle.Fill;
            mainPanel.AutoScroll = true;
            mainPanel.TabIndex   = 1;
            mainPanel.Controls.Add(buttonAddTemplate);
            if ((currentDetail is TemplateDetail) || (currentDetail is TemplateEngine))
            {
                mainPanel.Controls.Add(parametersContainer);
            }
            mainPanel.Controls.Add(limitationsContainer);
            mainPanel.Controls.Add(generalInformationContainer);
            mainPanel.Controls.Add(panelHeader);


            Controls.Add(mainPanel);
            Controls.Add(footerControl);
            Controls.Add(headerControl);
            UpdateDetail(false);
        }
Пример #2
0
        ///<summary>
        /// Создается элемент отображения добавления шаблонного агрегата
        ///</summary>
        public TemplateDetailAdding()
        {
            Dock                   = DockStyle.Fill;
            BackColor              = Css.CommonAppearance.Colors.BackColor;
            footerControl          = new FooterControl();
            footerControl.TabIndex = 2;

            headerControl  = new HeaderControl();
            aircraftHeader = new TemplateAircraftHeaderControl();
            mainPanel      = new Panel();

            generalInformationControl     = new TemplateDetailGeneralInformationControl();
            limitationControl             = new TemplateDatailLimitationsMaxResourcesControl();
            parametersControl             = new TemplateDetailParametersControl();
            parametersControl.ShowHushKit = false;

            generalInformationContainer = new ExtendableRichContainer();
            limitationsContainer        = new ExtendableRichContainer();

            panelFooterMenu = new Panel();

            aircraftHeader.AircraftClickable = true;
            //
            // headerControl
            //
            headerControl.Controls.Add(aircraftHeader);
            headerControl.TabIndex = 0;


            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;

            //
            // mainPanel
            //
            mainPanel.Dock       = DockStyle.Fill;
            mainPanel.AutoScroll = true;
            mainPanel.TabIndex   = 1;
            //
            // generalInformationContainer
            //
            generalInformationContainer.Dock          = DockStyle.Top;
            generalInformationContainer.UpperLeftIcon = icons.GrayArrow;
            generalInformationContainer.Caption       = "Component general information";
            generalInformationContainer.MainControl   = generalInformationControl;
            //
            // limitationsContainer
            //
            limitationsContainer.Dock          = DockStyle.Top;
            limitationsContainer.UpperLeftIcon = icons.GrayArrow;
            limitationsContainer.Caption       = "Limitations. Max resources";
            limitationsContainer.MainControl   = limitationControl;
            limitationsContainer.Extended      = false;

            panelFooterMenu.AutoSize     = true;
            panelFooterMenu.AutoSizeMode = AutoSizeMode.GrowAndShrink;
            panelFooterMenu.Dock         = DockStyle.Bottom;

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