/// <summary> /// todoComment /// </summary> /// <param name="id"></param> public void ExecuteAction(eActionId id) { if (CommonDialogsAssembly == null) { CommonDialogsAssembly = Assembly.LoadFrom( TAppSettingsManager.ApplicationDirectory + Path.DirectorySeparatorChar + "Ict.Petra.Client.CommonDialogs.dll"); } switch (id) { case eActionId.eClose: this.Close(); FWinForm.Close(); break; case eActionId.eHelpDevelopmentTeam: #if TODO using (DevelopmentTeamDialog teamDialog = new DevelopmentTeamDialog()) { teamDialog.ShowDialog(); } #endif break; case eActionId.eHelpAbout: System.Type aboutDialogType = CommonDialogsAssembly.GetType("Ict.Petra.Client.CommonDialogs.TFrmAboutDialog"); using (Form aboutDialog = (Form)Activator.CreateInstance(aboutDialogType, new object[] { this.FWinForm })) { aboutDialog.ShowDialog(); } break; case eActionId.eKeyboardShortcuts: System.Type shortcutsDialogType = CommonDialogsAssembly.GetType("Ict.Petra.Client.CommonDialogs.TFrmKeyboardShortcutsDialog"); using (Form shortcutsDialog = (Form)Activator.CreateInstance(shortcutsDialogType, new object[] { this.FWinForm })) { shortcutsDialog.ShowDialog(); } break; case eActionId.eHelp: { // TODO help action } break; } }
/// <summary> /// constructor /// </summary> /// <param name="AId">identifier for the type of menu item</param> public TItemTag(eActionId AId) { id = AId; }
/// <summary> /// todoComment /// </summary> /// <param name="id"></param> public void ExecuteAction(eActionId id) { if (CommonDialogsAssembly == null) { CommonDialogsAssembly = Assembly.LoadFrom( TAppSettingsManager.ApplicationDirectory + Path.DirectorySeparatorChar + "Ict.Petra.Client.CommonDialogs.dll"); } switch (id) { case eActionId.eClose: this.Close(); FWinForm.Close(); break; case eActionId.eHelpDevelopmentTeam: #if TODO using (DevelopmentTeamDialog teamDialog = new DevelopmentTeamDialog()) { teamDialog.ShowDialog(); } #endif break; case eActionId.eHelpAbout: System.Type aboutDialogType = CommonDialogsAssembly.GetType("Ict.Petra.Client.CommonDialogs.TFrmAboutDialog"); using (Form aboutDialog = (Form)Activator.CreateInstance(aboutDialogType, new object[] { this.FWinForm })) { aboutDialog.ShowDialog(); } break; case eActionId.eKeyboardShortcuts: System.Type shortcutsDialogType = CommonDialogsAssembly.GetType("Ict.Petra.Client.CommonDialogs.TFrmKeyboardShortcutsDialog"); Type ActiveFormType = Form.ActiveForm.GetType(); using (Form shortcutsDialog = (Form)Activator.CreateInstance(shortcutsDialogType, new object[] { this.FWinForm })) { // // For some Forms (and Tabs on these Forms) we show a specific Shortcut Tab // // Partner Edit Form if (ActiveFormType.FullName == "Ict.Petra.Client.MPartner.Gui.TFrmPartnerEdit") { // Inquire currently selected Tab object CurrentlySelectedTabPageNameObj = ActiveFormType.GetProperty("CurrentlySelectedTabPageName").GetValue( Form.ActiveForm, null); // If it is the Contact Details Tab: show Shortcut Tab that is specific to the Contact Details Tab if (CurrentlySelectedTabPageNameObj.ToString() == "petpContactDetails") { PropertyInfo InitiallySelectedTabProperty = shortcutsDialog.GetType().GetProperty("InitiallySelectedTab", BindingFlags.Public | BindingFlags.Instance); if ((null != InitiallySelectedTabProperty) && InitiallySelectedTabProperty.CanWrite) { InitiallySelectedTabProperty.SetValue(shortcutsDialog, "PartnerEditContactDetailsTab", null); } } } if (ActiveFormType.FullName == "Ict.Petra.Client.App.PetraClient.TFrmMainWindowNew") { PropertyInfo InitiallySelectedTabProperty = shortcutsDialog.GetType().GetProperty("InitiallySelectedTab", BindingFlags.Public | BindingFlags.Instance); if ((null != InitiallySelectedTabProperty) && InitiallySelectedTabProperty.CanWrite) { InitiallySelectedTabProperty.SetValue(shortcutsDialog, "tpgMainMenu", null); } } shortcutsDialog.ShowDialog(); } break; case eActionId.eHelp: { // TODO help action } break; } }
/// <summary> /// todoComment /// </summary> /// <param name="id"></param> public void ExecuteAction(eActionId id) { if (CommonDialogsAssembly == null) { CommonDialogsAssembly = Assembly.LoadFrom( TAppSettingsManager.ApplicationDirectory + Path.DirectorySeparatorChar + "Ict.Petra.Client.CommonDialogs.dll"); } switch (id) { case eActionId.eClose: this.Close(); FWinForm.Close(); break; case eActionId.eHelpDevelopmentTeam: #if TODO using (DevelopmentTeamDialog teamDialog = new DevelopmentTeamDialog()) { teamDialog.ShowDialog(); } #endif break; case eActionId.eHelpAbout: System.Type aboutDialogType = CommonDialogsAssembly.GetType("Ict.Petra.Client.CommonDialogs.TFrmAboutDialog"); using (Form aboutDialog = (Form)Activator.CreateInstance(aboutDialogType, new object[] { this.FWinForm })) { aboutDialog.ShowDialog(); } break; case eActionId.eKeyboardShortcuts: System.Type shortcutsDialogType = CommonDialogsAssembly.GetType("Ict.Petra.Client.CommonDialogs.TFrmKeyboardShortcutsDialog"); Type ActiveFormType = Form.ActiveForm.GetType(); using (Form shortcutsDialog = (Form)Activator.CreateInstance(shortcutsDialogType, new object[] { this.FWinForm })) { // // For some Forms (and Tabs on these Forms) we show a specific Shortcut Tab // // Partner Edit Form if (ActiveFormType.FullName == "Ict.Petra.Client.MPartner.Gui.TFrmPartnerEdit") { // Inquire currently selected Tab object CurrentlySelectedTabPageNameObj = ActiveFormType.GetProperty("CurrentlySelectedTabPageName").GetValue( Form.ActiveForm, null); // If it is the Contact Details Tab: show Shortcut Tab that is specific to the Contact Details Tab if (CurrentlySelectedTabPageNameObj.ToString() == "petpContactDetails") { PropertyInfo InitiallySelectedTabProperty = shortcutsDialog.GetType().GetProperty("InitiallySelectedTab", BindingFlags.Public | BindingFlags.Instance); if ((null != InitiallySelectedTabProperty) && InitiallySelectedTabProperty.CanWrite) { InitiallySelectedTabProperty.SetValue(shortcutsDialog, "PartnerEditContactDetailsTab", null); } } } shortcutsDialog.ShowDialog(); } break; case eActionId.eHelp: { // TODO help action } break; } }