Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/19/16 11:08:00 (8 years ago)
Author:
pfleck
Message:

#1235
Added an AllowContexMenu property in the DockingMainForm to be able to enable/disable the context menu.
Changing the property will only affect DockForms after the change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/DockForm.cs

    r13614 r13628  
    3232  /// </summary>
    3333  internal partial class DockForm : DockContent {
    34     public DockForm(IView view) {
     34    public DockForm(IView view, bool allowContextMenu) {
    3535      InitializeComponent();
    3636      this.view = view;
     37      this.allowContextMenu = allowContextMenu;
     38
    3739      if (view != null) {
    3840        if (view is UserControl) {
     
    9092      get { return this.view; }
    9193    }
     94    private readonly bool allowContextMenu;
    9295
    9396    private void UpdateText() {
     
    117120    #region Context Menu Events
    118121    private void contextMenuStrip_Opening(object sender, System.ComponentModel.CancelEventArgs e) {
     122      if (!allowContextMenu) {
     123        e.Cancel = true;
     124        return;
     125      }
     126
    119127      var contentView = View as IContentView;
    120128      var content = contentView != null ? contentView.Content : null;
Note: See TracChangeset for help on using the changeset viewer.