/// <summary> /// Tells whether a specific dynamically loadable Tab has been set up. /// </summary> /// <param name="ADynamicLoadableUserControl">The Tab.</param> /// <returns>True if it has been set up, otherwise false.</returns> public bool IsDynamicallyLoadableTabSetUp(TDynamicLoadableUserControls ADynamicLoadableUserControl) { if (FTabSetup.ContainsKey(ADynamicLoadableUserControl)) { return true; } else { return false; } }
/// <summary> /// Creates UserControls on request. /// </summary> /// <param name="AUserControl">UserControl to load.</param> private UserControl DynamicLoadUserControl(TDynamicLoadableUserControls AUserControl) { UserControl ReturnValue = null; switch (AUserControl) { case TDynamicLoadableUserControls.dlucSpecialNeeds: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCSpecialNeeds = new Panel(); pnlHostForUCSpecialNeeds.AutoSize = true; pnlHostForUCSpecialNeeds.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCSpecialNeeds.Location = new System.Drawing.Point(0, 0); pnlHostForUCSpecialNeeds.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCSpecialNeeds); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_SpecialNeeds ucoSpecialNeeds = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_SpecialNeeds(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucSpecialNeeds, ucoSpecialNeeds); ucoSpecialNeeds.Location = new Point(0, 2); ucoSpecialNeeds.Dock = DockStyle.Fill; pnlHostForUCSpecialNeeds.Controls.Add(ucoSpecialNeeds); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCSpecialNeeds.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCSpecialNeeds.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoSpecialNeeds; break; case TDynamicLoadableUserControls.dlucPersonalLanguages: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCPersonalLanguages = new Panel(); pnlHostForUCPersonalLanguages.AutoSize = true; pnlHostForUCPersonalLanguages.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCPersonalLanguages.Location = new System.Drawing.Point(0, 0); pnlHostForUCPersonalLanguages.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCPersonalLanguages); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_PersonalLanguages ucoPersonalLanguages = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_PersonalLanguages(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucPersonalLanguages, ucoPersonalLanguages); ucoPersonalLanguages.Location = new Point(0, 2); ucoPersonalLanguages.Dock = DockStyle.Fill; pnlHostForUCPersonalLanguages.Controls.Add(ucoPersonalLanguages); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCPersonalLanguages.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCPersonalLanguages.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoPersonalLanguages; break; case TDynamicLoadableUserControls.dlucProgressReports: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCProgressReports = new Panel(); pnlHostForUCProgressReports.AutoSize = true; pnlHostForUCProgressReports.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCProgressReports.Location = new System.Drawing.Point(0, 0); pnlHostForUCProgressReports.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCProgressReports); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_ProgressReports ucoProgressReports = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_ProgressReports(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucProgressReports, ucoProgressReports); ucoProgressReports.Location = new Point(0, 2); ucoProgressReports.Dock = DockStyle.Fill; pnlHostForUCProgressReports.Controls.Add(ucoProgressReports); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCProgressReports.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCProgressReports.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoProgressReports; break; case TDynamicLoadableUserControls.dlucCommitmentPeriods: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCCommitmentPeriods = new Panel(); pnlHostForUCCommitmentPeriods.AutoSize = true; pnlHostForUCCommitmentPeriods.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCCommitmentPeriods.Location = new System.Drawing.Point(0, 0); pnlHostForUCCommitmentPeriods.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCCommitmentPeriods); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_CommitmentPeriods ucoCommitmentPeriods = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_CommitmentPeriods(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucCommitmentPeriods, ucoCommitmentPeriods); ucoCommitmentPeriods.Location = new Point(0, 2); ucoCommitmentPeriods.Dock = DockStyle.Fill; pnlHostForUCCommitmentPeriods.Controls.Add(ucoCommitmentPeriods); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCCommitmentPeriods.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCCommitmentPeriods.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoCommitmentPeriods; break; case TDynamicLoadableUserControls.dlucPersonSkills: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCPersonSkills = new Panel(); pnlHostForUCPersonSkills.AutoSize = true; pnlHostForUCPersonSkills.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCPersonSkills.Location = new System.Drawing.Point(0, 0); pnlHostForUCPersonSkills.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCPersonSkills); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_PersonSkills ucoPersonSkills = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_PersonSkills(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucPersonSkills, ucoPersonSkills); ucoPersonSkills.Location = new Point(0, 2); ucoPersonSkills.Dock = DockStyle.Fill; pnlHostForUCPersonSkills.Controls.Add(ucoPersonSkills); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCPersonSkills.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCPersonSkills.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoPersonSkills; break; //Personal Abilities case TDynamicLoadableUserControls.dlucPersonalAbilities: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCPersonalAblities = new Panel(); pnlHostForUCPersonalAblities.AutoSize = true; pnlHostForUCPersonalAblities.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCPersonalAblities.Location = new System.Drawing.Point(0, 0); pnlHostForUCPersonalAblities.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCPersonalAblities); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_Abilities ucoPersonalAbilities = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_Abilities(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucPersonalAbilities, ucoPersonalAbilities); ucoPersonalAbilities.Location = new Point(0, 2); ucoPersonalAbilities.Dock = DockStyle.Fill; pnlHostForUCPersonalAblities.Controls.Add(ucoPersonalAbilities); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCPersonalAblities.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCPersonalAblities.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoPersonalAbilities; break; //Passport Details case TDynamicLoadableUserControls.dlucPassportDetails: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCPassport = new Panel(); pnlHostForUCPassport.AutoSize = true; pnlHostForUCPassport.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCPassport.Location = new System.Drawing.Point(0, 0); pnlHostForUCPassport.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCPassport); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_Passport ucoPassportDetails = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_Passport(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucPassportDetails, ucoPassportDetails); ucoPassportDetails.Location = new Point(0, 2); ucoPassportDetails.Dock = DockStyle.Fill; pnlHostForUCPassport.Controls.Add(ucoPassportDetails); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCPassport.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCPassport.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoPassportDetails; break; case TDynamicLoadableUserControls.dlucPersonalData: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCPersonalData = new Panel(); pnlHostForUCPersonalData.AutoSize = true; pnlHostForUCPersonalData.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCPersonalData.Location = new System.Drawing.Point(0, 0); pnlHostForUCPersonalData.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCPersonalData); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_PersonalData ucoPersonalData = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_PersonalData(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucPersonalData, ucoPersonalData); ucoPersonalData.Location = new Point(0, 2); ucoPersonalData.Dock = DockStyle.Fill; pnlHostForUCPersonalData.Controls.Add(ucoPersonalData); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCPersonalData.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCPersonalData.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoPersonalData; break; case TDynamicLoadableUserControls.dlucEmergencyData: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCEmergencyData = new Panel(); pnlHostForUCEmergencyData.AutoSize = true; pnlHostForUCEmergencyData.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCEmergencyData.Location = new System.Drawing.Point(0, 0); pnlHostForUCEmergencyData.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCEmergencyData); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_EmergencyData ucoEmergencyData = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_EmergencyData(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucEmergencyData, ucoEmergencyData); ucoEmergencyData.Location = new Point(0, 2); ucoEmergencyData.Dock = DockStyle.Fill; pnlHostForUCEmergencyData.Controls.Add(ucoEmergencyData); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCEmergencyData.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCEmergencyData.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoEmergencyData; break; case TDynamicLoadableUserControls.dlucPreviousExperience: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCPreviousExperience = new Panel(); pnlHostForUCPreviousExperience.AutoSize = true; pnlHostForUCPreviousExperience.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCPreviousExperience.Location = new System.Drawing.Point(0, 0); pnlHostForUCPreviousExperience.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCPreviousExperience); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_PreviousExperience ucoPreviousExperience = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_PreviousExperience(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucPreviousExperience, ucoPreviousExperience); ucoPreviousExperience.Location = new Point(0, 2); ucoPreviousExperience.Dock = DockStyle.Fill; pnlHostForUCPreviousExperience.Controls.Add(ucoPreviousExperience); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCPreviousExperience.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCPreviousExperience.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoPreviousExperience; break; case TDynamicLoadableUserControls.dlucPersonalDocuments: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCPersonalDocuments = new Panel(); pnlHostForUCPersonalDocuments.AutoSize = true; pnlHostForUCPersonalDocuments.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCPersonalDocuments.Location = new System.Drawing.Point(0, 0); pnlHostForUCPersonalDocuments.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCPersonalDocuments); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_PersonalDocuments ucoPersonalDocuments = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_PersonalDocuments(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucPersonalDocuments, ucoPersonalDocuments); ucoPersonalDocuments.Location = new Point(0, 2); ucoPersonalDocuments.Dock = DockStyle.Fill; pnlHostForUCPersonalDocuments.Controls.Add(ucoPersonalDocuments); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCPersonalDocuments.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCPersonalDocuments.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoPersonalDocuments; break; case TDynamicLoadableUserControls.dlucJobAssignments: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCJobAssignments = new Panel(); pnlHostForUCJobAssignments.AutoSize = true; pnlHostForUCJobAssignments.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCJobAssignments.Location = new System.Drawing.Point(0, 0); pnlHostForUCJobAssignments.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCJobAssignments); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_JobAssignments ucoJobAssignments = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_JobAssignments(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucJobAssignments, ucoJobAssignments); ucoJobAssignments.Location = new Point(0, 2); ucoJobAssignments.Dock = DockStyle.Fill; pnlHostForUCJobAssignments.Controls.Add(ucoJobAssignments); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCJobAssignments.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCJobAssignments.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoJobAssignments; break; case TDynamicLoadableUserControls.dlucLocalPersonnelData: // Create a Panel that hosts the UserControl. This is needed to allow scrolling of content in case the screen is too small to shown the whole UserControl Panel pnlHostForUCLocalPersonnelData = new Panel(); pnlHostForUCLocalPersonnelData.AutoSize = true; pnlHostForUCLocalPersonnelData.Dock = System.Windows.Forms.DockStyle.Fill; pnlHostForUCLocalPersonnelData.Location = new System.Drawing.Point(0, 0); pnlHostForUCLocalPersonnelData.Padding = new System.Windows.Forms.Padding(2); pnlSelectedIndivDataItem.Controls.Add(pnlHostForUCLocalPersonnelData); // Create the UserControl Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_LocalPersonnelData ucoLocalPersonnelData = new Ict.Petra.Client.MPartner.Gui.TUC_IndividualData_LocalPersonnelData(); FUserControlSetup.Add(TDynamicLoadableUserControls.dlucLocalPersonnelData, ucoLocalPersonnelData); ucoLocalPersonnelData.Location = new Point(0, 2); ucoLocalPersonnelData.Dock = DockStyle.Fill; pnlHostForUCLocalPersonnelData.Controls.Add(ucoLocalPersonnelData); /* * The following four commands seem strange and unnecessary; however, they are necessary * to make things scale correctly on "Large Fonts (120DPI)" display setting. */ if (TClientSettings.GUIRunningOnNonStandardDPI) { this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; pnlHostForUCLocalPersonnelData.Dock = System.Windows.Forms.DockStyle.None; pnlHostForUCLocalPersonnelData.Dock = System.Windows.Forms.DockStyle.Fill; } ReturnValue = ucoLocalPersonnelData; break; } FPetraUtilsObject.RestoreAdditionalWindowPositionProperties(); return ReturnValue; }