Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/16/19 23:48:36 (5 years ago)
Author:
abeham
Message:

#2521: Added context lookup parameter

  • Refactored tests
  • Fixed duplicate GUID
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Parameters/3.3/LookupParameter.cs

    r17226 r17254  
    2222using System;
    2323using System.Threading;
     24using HEAL.Attic;
    2425using HeuristicLab.Common;
    2526using HeuristicLab.Core;
    26 using HEAL.Attic;
    2727
    2828namespace HeuristicLab.Parameters {
     
    136136      while (currentExecutionContext != null) {
    137137        IParameter param = null;
    138         while (currentExecutionContext != null && !currentExecutionContext.Parameters.TryGetValue(translatedName, out param))
     138        while (currentExecutionContext != null && (!currentExecutionContext.Parameters.TryGetValue(translatedName, out param)
     139          || param is IContextLookupParameter))
    139140          currentExecutionContext = currentExecutionContext.Parent;
    140141        if (currentExecutionContext == null) break;
     
    143144        lookupParam = param as ILookupParameter;
    144145
    145         if ((valueParam == null) && (lookupParam == null))
     146        if (valueParam == null && lookupParam == null)
    146147          throw new InvalidOperationException(
    147             string.Format("Parameter look-up chain broken. Parameter \"{0}\" is not an \"{1}\" or an \"{2}\".",
     148            string.Format("Parameter look-up chain broken. Parameter \"{0}\" is neither an \"{1}\" nor an \"{2}\".",
    148149                          translatedName, typeof(IValueParameter).GetPrettyName(), typeof(ILookupParameter).GetPrettyName())
    149150          );
Note: See TracChangeset for help on using the changeset viewer.