/// <summary> /// Löst das <see cref="E:System.Windows.Forms.ToolStripItem.Click" />-Ereignis aus. /// </summary> /// <param name="e">Ein <see cref="T:System.EventArgs" />, das die Ereignisdaten enthält.</param> protected override void OnClick(EventArgs e) { if (e != null) { base.OnClick(e); if (this.ClassType == DialogClassType.DialogEntry) { if (dialogEntryItem != null && dialogEntryItem.ParentDialog != null) { Dialog parent = dialogEntryItem.ParentDialog; if (parent.GetActiveDialog() != null) { Dialog ActiveDialog = parent.GetActiveDialog(); DialogEntry SelectedEntry = ActiveDialog.SelectedEntry; parent.FocusOn(); parent.SelectEntry(dialogEntryItem); parent.ActivateSelectedEntry(); /*If the Dialog is not following, the prior selected entry and active dialog will be restored*/ if (!AutoFollow) { //causes activateActivation to get wrong ActiveDialog && wrong switch case is chosen // ActiveDialog.FocusOn(); // if(SelectedEntry != null) // ActiveDialog.SelectEntry(SelectedEntry); } } } } else if (this.ClassType == DialogClassType.Dialog) { if (dialogItem != null && AutoFollow) { if (this.DropDownItems != null && this.DropDownItems.Count != null && this.DropDownItems.Count > 0) { /*Dialog position should follow the navigation through the D2F structure*/ dialogItem.FocusOn(); } } } fire_OnClickEvent(); } }