///<summary> /// —оздаетс¤ элемент отображени¤ добавлени¤ агрегата ///</summary> /// <param name="parentDetail">Ѕазовый агрегат дл¤ которго добавл¤етс¤ агрегат</param> public DetailAddingScreen(IDetailContainer parentDetail) { if (parentDetail == null) { throw new ArgumentNullException("parentDetail"); } if (parentDetail is BaseDetail) { parentBaseDetail = (BaseDetail)parentDetail; } else if (parentDetail is Aircraft) { parentBaseDetail = ((Aircraft)parentDetail).AircraftFrame; } else { parentBaseDetail = ((Store)parentDetail).AircraftFrame; } if (parentDetail is Aircraft) { isStore = ((Aircraft)parentDetail).Type == AircraftType.Store; } headerControl = new HeaderControl(); aircraftHeader = new AircraftHeaderControl(); if (parentDetail is Aircraft) { aircraftHeader.Aircraft = parentDetail as Aircraft; } if (parentDetail is BaseDetail) { aircraftHeader.Aircraft = (parentDetail as BaseDetail).ParentAircraft; } aircraftHeader.AircraftClickable = true; aircraftHeader.OperatorClickable = true; footerControl = new FooterControl(); mainPanel = new Panel(); // panelFooterMenu = new Panel(); addnewcomponentControl = new AddNewComponentControl(parentBaseDetail); generalInformationControl = new DetailAddingGeneralInformationControl(parentBaseDetail.ParentAircraft); compliancePerformanceListControl = new DetailCompliancePerformanceListControl(parentBaseDetail.ParentAircraft); warrantyControl = new DetailWarrantyControl(); if (isStore) { storeControl = new DetailStoreControl((Aircraft)parentDetail); } addNewComponentContainer = new ExtendableRichContainer(); generalInformationContainer = new ExtendableRichContainer(); compliancePerformanceContainer = new ExtendableRichContainer(); warrantyContainer = new ExtendableRichContainer(); storeContainer = new ExtendableRichContainer(); // // 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; aircraftHeader.AircraftClickable = true; footerControl.TabIndex = 2; // // mainPanel // mainPanel.Dock = DockStyle.Fill; mainPanel.AutoScroll = true; mainPanel.TabIndex = 1; // // addNewComponentContainer // addNewComponentContainer.labelCaption.Margin = new Padding(3, 20, 3, 3); addNewComponentContainer.PictureBoxIcon.Margin = new Padding(3, 20, 3, 3); addNewComponentContainer.Dock = DockStyle.Top; addNewComponentContainer.UpperLeftIcon = icons.GrayArrow; addNewComponentContainer.Caption = "Base component"; addNewComponentContainer.MainControl = addnewcomponentControl; addNewComponentContainer.TabIndex = 0; addnewcomponentControl.BaseDetailAddTo = parentBaseDetail; // // generalInformationContainer // generalInformationContainer.Dock = DockStyle.Top; generalInformationContainer.UpperLeftIcon = icons.GrayArrow; generalInformationContainer.Caption = "Component general information"; generalInformationContainer.MainControl = generalInformationControl; generalInformationContainer.TabIndex = 1; // // compliancePerformanceContainer // compliancePerformanceContainer.Dock = DockStyle.Top; compliancePerformanceContainer.UpperLeftIcon = icons.GrayArrow; compliancePerformanceContainer.Caption = "Compliance/Performance"; compliancePerformanceContainer.MainControl = compliancePerformanceListControl; //compliancePerformanceContainer.Extended = false; compliancePerformanceContainer.TabIndex = 2; // // warrantyContainer // warrantyContainer.Dock = DockStyle.Top; warrantyContainer.UpperLeftIcon = icons.GrayArrow; warrantyContainer.Caption = "Warranty"; warrantyContainer.MainControl = warrantyControl; warrantyContainer.TabIndex = 3; // // storeContainer // storeContainer.Dock = DockStyle.Top; storeContainer.UpperLeftIcon = icons.GrayArrow; storeContainer.Caption = "Store"; storeContainer.MainControl = storeControl; //storeContainer.Extended = false; storeContainer.TabIndex = 5; /* // * // panelFooterMenu * // * panelFooterMenu.AutoSize = true; * panelFooterMenu.AutoSizeMode = AutoSizeMode.GrowAndShrink; * panelFooterMenu.Dock = DockStyle.Bottom;*/ BackColor = Css.CommonAppearance.Colors.BackColor; //mainPanel.Controls.Add(panelFooterMenu); if (isStore) { mainPanel.Controls.Add(storeContainer); } mainPanel.Controls.Add(warrantyContainer); if (!isStore) { mainPanel.Controls.Add(compliancePerformanceContainer); } mainPanel.Controls.Add(generalInformationContainer); if (!isStore) { mainPanel.Controls.Add(addNewComponentContainer); } Controls.Add(mainPanel); Controls.Add(footerControl); Controls.Add(headerControl); ClearFields(); addNewComponentContainer.Focus(); }
///<summary> /// Создается элемент отображения добавления шаблонного агрегата ///</summary> /// <param name="parentDetail">Базовый агрегат для которго добавляется шаблонный агрегат</param> public TemplateDetailAdding(ITemplateDetailContainer parentDetail) : this() { if (parentDetail == null) { throw new ArgumentNullException("parentDetail"); } this.parentDetail = parentDetail; if (parentDetail is TemplateAircraft) { aircraftHeader.Aircraft = parentDetail as TemplateAircraft; } if (parentDetail is TemplateBaseDetail) { aircraftHeader.Aircraft = (parentDetail as TemplateBaseDetail).ParentAircraft; } aircraftHeader.AircraftClickable = true; aircraftHeader.OperatorClickable = true; addNewComponentContainer = new ExtendableRichContainer(); addnewcomponentControl = new TemplateAddNewComponentControl(parentDetail); // // addNewComponentContainer // addNewComponentContainer.labelCaption.Margin = new Padding(3, 20, 3, 3); addNewComponentContainer.PictureBoxIcon.Margin = new Padding(3, 20, 3, 3); addNewComponentContainer.Dock = DockStyle.Top; addNewComponentContainer.UpperLeftIcon = icons.GrayArrow; addNewComponentContainer.Caption = "Base component"; addNewComponentContainer.MainControl = addnewcomponentControl; addNewComponentContainer.TabIndex = 0; addnewcomponentControl.BaseDetailAddTo = parentDetail; // // generalInformationContainer // generalInformationContainer.TabIndex = 1; // // limitationsContainer // limitationsContainer.TabIndex = 2; // // parametersContainer // parametersContainer = new ExtendableRichContainer(); parametersContainer.Dock = DockStyle.Top; parametersContainer.UpperLeftIcon = icons.GrayArrow; parametersContainer.Caption = "Parameters"; parametersContainer.MainControl = parametersControl; parametersContainer.Extended = false; parametersContainer.TabIndex = 3; mainPanel.Controls.Add(panelFooterMenu); mainPanel.Controls.Add(parametersContainer); mainPanel.Controls.Add(limitationsContainer); mainPanel.Controls.Add(generalInformationContainer); mainPanel.Controls.Add(addNewComponentContainer); ClearFields(); addNewComponentContainer.Focus(); }