Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/08/19 14:59:31 (6 years ago)
Author:
pfleck
Message:

#2972 merged trunk into branch

Location:
branches/2972_PDPRowSelect
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2972_PDPRowSelect

  • branches/2972_PDPRowSelect/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ControlExtensions.cs

    r15583 r16518  
    4646      }
    4747    }
    48 
    49     public static IEnumerable<Control> GetNestedControls(this Control control, Func<Control, bool> condition = null) {
    50       if (control == null) yield break;
    51       if (condition == null) condition = (c) => true;
    52 
    53       Queue<Control> unprocessed = new Queue<Control>();
    54       unprocessed.Enqueue(control);
    55 
    56       while (unprocessed.Count > 0) {
    57         Control c = unprocessed.Dequeue();
    58         if (condition(c)) yield return c;
    59         foreach (Control child in c.Controls)
    60           unprocessed.Enqueue(child);
    61       }
    62     }
    6348  }
    6449}
  • branches/2972_PDPRowSelect/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs

    r16430 r16518  
    3838      : base() {
    3939      if (control == null) throw new ArgumentNullException("control");
     40      if (control.Parent == null) throw new InvalidOperationException("A Progress can only be shown on controls that have a Parent-control. Therefore, Dialogs and Forms cannot have an associated ProgressView.");
    4041      if (content == null) throw new ArgumentNullException("content");
    4142      InitializeComponent();
     
    114115      UpdateButtonsState();
    115116
     117      Control.SuspendRepaint();
    116118      Control.Enabled = false;
    117119      Parent = Control.Parent;
    118120      BringToFront();
     121      Control.ResumeRepaint(true);
    119122      Visible = true;
    120123    }
     
    128131
    129132      Visible = false;
     133      Control.SuspendRepaint();
    130134      Control.Enabled = true;
     135      Control.ResumeRepaint(true);
    131136      Parent = null;
    132137    }
Note: See TracChangeset for help on using the changeset viewer.