/// <summary>
        /// Создает элемент управления для отображения статуса агрегата и ссылок на отчеты
        /// </summary>
        public BaseComponentHeaderControl(Component component)
        {
            _currentComponent   = component;
            statusLinkLabel     = new StatusImageLinkLabel();
            checkBoxServiceable = new CheckBox();
            if (component is BaseComponent)
            {
                _contentPanel = new BaseComponentLinksFlowLayoutPanel((BaseComponent)component);
            }
            else
            {
                _contentPanel = new BaseComponentLinksFlowLayoutPanel(null);
            }
            //
            // 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.Size      = new Size(350, 27);
            statusLinkLabel.TextAlign = ContentAlignment.MiddleLeft;
            statusLinkLabel.TextFont  = Css.OrdinaryText.Fonts.RegularFont;
            //
            // checkBoxServiceable
            //
            checkBoxServiceable.Cursor    = Cursors.Hand;
            checkBoxServiceable.FlatStyle = FlatStyle.Flat;
            checkBoxServiceable.Font      = Css.SimpleLink.Fonts.Font;
            checkBoxServiceable.ForeColor = Css.SimpleLink.Colors.LinkColor;
            checkBoxServiceable.Location  = new Point(MARGIN, statusLinkLabel.Bottom + HeightInterval);
            checkBoxServiceable.Size      = new Size(LabelWidth, LabelHeight);
            checkBoxServiceable.Text      = "Serviceable";
            //
            // flowLayoutPanelLinks
            //
            _contentPanel.Location = new Point(statusLinkLabel.Right, 0);
            _contentPanel.Size     = new Size(500, 100);

            BackColor = Css.CommonAppearance.Colors.BackColor;
            //Controls.Add(statusLinkLabel);
            //Controls.Add(checkBoxServiceable);
            if (component is BaseComponent)
            {
                Size = new Size(1250, 100);
                Controls.Add(_contentPanel);
            }
            else
            {
                Size = new Size(1250, 50);
            }
        }
Пример #2
0
 private void InitializeComponent()
 {
     splitContainer                        = new SplitContainer();
     contentPanel                          = new BaseComponentLinksFlowLayoutPanel(_currentBaseComponent);
     contextMenuStrip1                     = new ContextMenuStrip();
     titleToolStripMenuItem                = new ToolStripMenuItem();
     registerToolStripMenuItem             = new ToolStripMenuItem();
     overhaulToolStripMenuItem             = new ToolStripMenuItem();
     inspectionToolStripMenuItem           = new ToolStripMenuItem();
     shopVisitToolStripMenuItem            = new ToolStripMenuItem();
     hotSectionInspectionToolStripMenuItem = new ToolStripMenuItem();
     logBookToolStripMenuItem              = new ToolStripMenuItem();
     addComponentToolStripMenuItem1        = new ToolStripMenuItem();
     aDStatusToolStripMenuItem             = new ToolStripMenuItem();
     ToolStripMenuItemLLPDiskSheet         = new ToolStripMenuItem();
     deleteToolStripMenuItem               = new ToolStripMenuItem();
     discrepanciesToolStripMenuItem        = new ToolStripMenuItem();
     sBStatusToolStripMenuItem             = new ToolStripMenuItem();
     engeneeringOrdersToolStripMenuItem    = new ToolStripMenuItem();
     toolStripMenuItemMoveToStore          = new ToolStripMenuItem();
     toolStripSeparator1                   = new ToolStripSeparator();
     toolStripSeparator2                   = new ToolStripSeparator();
     toolStripSeparator3                   = new ToolStripSeparator();
     toolStripSeparator4                   = new ToolStripSeparator();
     //
     // titleToolStripMenuItem
     //
     titleToolStripMenuItem.Text   = "[Title]";
     titleToolStripMenuItem.Click += TitleToolStripMenuItemClick;
     //
     // registerToolStripMenuItem
     //
     registerToolStripMenuItem.Text = "Register";
     //
     // overhaulToolStripMenuItem
     //
     overhaulToolStripMenuItem.Text   = "Overhaul";
     overhaulToolStripMenuItem.Click += overhaulToolStripMenuItem_Click;
     //
     // inspectionToolStripMenuItem
     //
     inspectionToolStripMenuItem.Text   = "Inspection";
     inspectionToolStripMenuItem.Click += inspectionToolStripMenuItem_Click;
     //
     // shopVisitToolStripMenuItem
     //
     shopVisitToolStripMenuItem.Text   = "Shop visit";
     shopVisitToolStripMenuItem.Click += shopVisitToolStripMenuItem_Click;
     //
     // hotSectionInspectionToolStripMenuItem
     //
     hotSectionInspectionToolStripMenuItem.Text   = "Hot section inspection";
     hotSectionInspectionToolStripMenuItem.Click += hotSectionInspectionToolStripMenuItem_Click;
     //
     // logBookToolStripMenuItem
     //
     logBookToolStripMenuItem.Text   = "Log book";
     logBookToolStripMenuItem.Click += logBookToolStripMenuItem_Click;
     //
     // addComponentToolStripMenuItem1
     //
     addComponentToolStripMenuItem1.Text   = "Add component";
     addComponentToolStripMenuItem1.Click += addComponentToolStripMenuItem1_Click;
     //
     // aDStatusToolStripMenuItem
     //
     aDStatusToolStripMenuItem.Text   = "AD Status";
     aDStatusToolStripMenuItem.Click += aDStatusToolStripMenuItem_Click;
     //
     // ToolStripMenuItemLLPDiskSheet
     //
     ToolStripMenuItemLLPDiskSheet.Text   = "LLP Disk Sheet Status";
     ToolStripMenuItemLLPDiskSheet.Click += toolStripMenuItemLLPDiskSheet_Click;
     //
     // deleteToolStripMenuItem
     //
     deleteToolStripMenuItem.Text   = "Delete";
     deleteToolStripMenuItem.Click += deleteToolStripMenuItem_Click;
     //
     // discrepanciesToolStripMenuItem
     //
     discrepanciesToolStripMenuItem.Text   = "Discrepancies";
     discrepanciesToolStripMenuItem.Click += discrepanciesToolStripMenuItem_Click;
     //
     // sBStatusToolStripMenuItem
     //
     sBStatusToolStripMenuItem.Text   = "SB Status";
     sBStatusToolStripMenuItem.Click += sBStatusToolStripMenuItem_Click;
     //
     // engeneeringOrdersToolStripMenuItem
     //
     engeneeringOrdersToolStripMenuItem.Text   = "Engineering Orders Status";
     engeneeringOrdersToolStripMenuItem.Click += engeneeringOrdersToolStripMenuItem_Click;
     //
     // engeneeringOrdersToolStripMenuItem
     //
     toolStripMenuItemMoveToStore.Text   = "Move to Store";
     toolStripMenuItemMoveToStore.Click += toolStripMenuItemMoveToStore_Click;
     //
     // baseDetailButton
     //
     baseDetailButton.ActiveColor    = Css.BaseDetailInfoControl.Colors.InactiveTopColorHovered;
     baseDetailButton.ExtendedColor  = Css.BaseDetailInfoControl.Colors.InactiveBottomColor;
     baseDetailButton.Font           = Css.BaseDetailInfoControl.Fonts.PrimaryFont;
     baseDetailButton.ForeColor      = Css.BaseDetailInfoControl.Colors.PrimaryForeColor;
     baseDetailButton.Icon           = new Icons().GrayArrow;
     baseDetailButton.MouseDownColor = Css.BaseDetailInfoControl.Colors.InactiveTopColorPressed;
     baseDetailButton.NormalColor    = Css.BaseDetailInfoControl.Colors.InactiveTopColor;
     // baseDetailButton.ReflectionType = ReflectionTypes.DisplayInNew;
     baseDetailButton.SecondFont        = Css.BaseDetailInfoControl.Fonts.SecondaryFont;
     baseDetailButton.SecondForeColor   = Css.BaseDetailInfoControl.Colors.SecondaryForeColor;
     baseDetailButton.SecondTextAlign   = ContentAlignment.TopLeft;
     baseDetailButton.SecondTextPadding = new Padding(10, 0, 0, 0);
     baseDetailButton.Size                  = new Size(235, 90);
     baseDetailButton.TextAlign             = ContentAlignment.TopLeft;
     baseDetailButton.TextPadding           = new Padding(0, 6, 0, 0);
     baseDetailButton.SecondaryTextPosition = 44;
     baseDetailButton.DisplayerRequested   += AircraftButtonDisplayerRequested;
     baseDetailButton.ContextMenuStrip      = contextMenuStrip1;
     //
     // splitter
     //
     splitContainer.Dock             = DockStyle.Fill;
     splitContainer.Location         = new Point(0, 0);
     splitContainer.Name             = "splitter";
     splitContainer.IsSplitterFixed  = true;
     splitContainer.SplitterDistance = 230;
     //
     // paddingPanel
     //
     paddingPanel      = new Panel();
     paddingPanel.Size = new Size(0, 0);
     paddingPanel.Dock = DockStyle.Top;
     paddingPanel.BringToFront();
     //
     // splitter.Panel1
     //
     splitContainer.Panel1.Controls.Add(baseDetailButton);
     splitContainer.Panel2.BackColor = Color.Transparent;
     //
     // splitter.Panel2
     //
     splitContainer.Panel2.Controls.Add(contentPanel);
     splitContainer.Panel2.Controls.Add(paddingPanel);
     splitContainer.Panel2.BackColor = Color.Transparent;
     //this.splitContainer.Size = new System.Drawing.Size(641, 100);
     splitContainer.TabIndex = 0;
     //
     // contentPanel
     //
     contentPanel.AutoSize     = true;
     contentPanel.Dock         = DockStyle.Top;
     contentPanel.Location     = new Point(0, 0);
     contentPanel.Name         = "contentPanel";
     contentPanel.TabIndex     = 0;
     contentPanel.SizeChanged += contentPanel_SizeChanged;
     //
     // BaseDetailControl
     //
     Controls.Add(splitContainer);
     Size = defaultSize;
     registerToolStripMenuItem.Enabled      = true; //DirectiveCollection.HasAccess(Users.IdentityUser.Role, DataEvent.Create);
     addComponentToolStripMenuItem1.Enabled = true; //DetailCollection.HasAccess(Users.IdentityUser.Role, DataEvent.Create);
     deleteToolStripMenuItem.Enabled        = true; //BaseDetailCollection.HasAccess(Users.IdentityUser.Role, DataEvent.Remove);
     //
     // BaseDetailControl
     //
     registerToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[]
     {
         overhaulToolStripMenuItem,
         inspectionToolStripMenuItem,
         shopVisitToolStripMenuItem,
         hotSectionInspectionToolStripMenuItem
     });
     contextMenuStrip1.Items.AddRange(new ToolStripItem[]
     {
         titleToolStripMenuItem,
         toolStripSeparator1,
         logBookToolStripMenuItem,
         registerToolStripMenuItem,
         toolStripSeparator3,
         aDStatusToolStripMenuItem,
         discrepanciesToolStripMenuItem,
         engeneeringOrdersToolStripMenuItem,
         ToolStripMenuItemLLPDiskSheet,
         sBStatusToolStripMenuItem,
         toolStripSeparator2,
         toolStripMenuItemMoveToStore,
         toolStripSeparator4,
         addComponentToolStripMenuItem1,
         deleteToolStripMenuItem
     });
     baseDetailButton.ContextMenuStrip = contextMenuStrip1;
 }