Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/04/13 10:15:31 (11 years ago)
Author:
jkarder
Message:

#2116:

  • fixed issues within the outermost control detection
  • fixed visible property assignment of the breadcrumb control in ViewHost
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Breadcrumbs/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs

    r10093 r10103  
    223223    }
    224224
    225     public T GetOutermostViewOfType<T>(Control childControl) where T : class, IView {
     225    public T GetOutermostControlOfType<T>(Control childControl) where T : Control {
    226226      if (childControl == null) throw new ArgumentNullException("childControl", "ChildControl cannot be null.");
    227227
    228       T outermostView = null;
     228      T outermostControl = null;
    229229      for (var control = childControl; control != null; control = control.Parent) {
    230         var vh = control as T;
    231         if (vh != null) outermostView = vh;
    232       }
    233       return outermostView;
     230        var c = control as T;
     231        if (c != null) outermostControl = c;
     232      }
     233      return outermostControl;
    234234    }
    235235
     
    279279      if (childControl == null) throw new ArgumentNullException("childControl", "ChildControl cannot be null.");
    280280
    281       var outermostViewHost = GetOutermostViewOfType<ViewHost>(childControl);
    282       if (outermostViewHost == null)
    283         throw new ArgumentException("No outermost ViewHost could be found for the specified child control.", "childControl");
     281      var outermostViewHost = GetOutermostControlOfType<ViewHost>(childControl);
     282      if (outermostViewHost == null) return null;
    284283
    285284      if (!requireHotlinking || outermostViewHost.HotlinkingEnabled) {
Note: See TracChangeset for help on using the changeset viewer.