Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5741


Ignore:
Timestamp:
03/17/11 17:02:34 (14 years ago)
Author:
gkronber
Message:

#1432: implemented NonDiscoverableType attribute and removed attributed types from type discovery.

Location:
trunk/sources
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators/3.3/EmptyOperator.cs

    r5445 r5741  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     25using HeuristicLab.PluginInfrastructure;
    2526
    2627namespace HeuristicLab.Operators {
     
    3031  [Item("EmptyOperator", "An operator which represents an empty statement.")]
    3132  [StorableClass]
     33  [NonDiscoverableType]
    3234  public sealed class EmptyOperator : SingleSuccessorOperator {
    3335    [StorableConstructor]
  • trunk/sources/HeuristicLab.Optimization/3.3/UserDefinedProblem.cs

    r5445 r5741  
    3131using HeuristicLab.Parameters;
    3232using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     33using HeuristicLab.PluginInfrastructure;
    3334
    3435namespace HeuristicLab.Optimization {
     
    222223    [Item("EmptyUserDefinedProblemEvaluator", "A dummy evaluator that will throw an exception when executed.")]
    223224    [StorableClass]
     225    [NonDiscoverableType]
    224226    private sealed class EmptyUserDefinedProblemEvaluator : ParameterizedNamedItem, ISingleObjectiveEvaluator {
    225227
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/DefaultApplicationManager.cs

    r5632 r5741  
    258258      return from t in assembly.GetTypes()
    259259             where CheckTypeCompatibility(type, t)
    260              where onlyInstantiable == false || (!t.IsAbstract && !t.IsInterface && !t.HasElementType)
     260             where onlyInstantiable == false ||
     261                (!t.IsAbstract && !t.IsInterface && !t.HasElementType)
     262             where !IsNonDiscoverableType(t)
    261263             select BuildType(t, type);
     264    }
     265
     266    private static bool IsNonDiscoverableType(Type t) {
     267      return t.GetCustomAttributes(typeof(NonDiscoverableTypeAttribute), false).Any();
    262268    }
    263269
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/HeuristicLab.PluginInfrastructure-3.3.csproj

    r5163 r5741  
    2121    </UpgradeBackupLocation>
    2222    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    23     <TargetFrameworkProfile></TargetFrameworkProfile>
     23    <TargetFrameworkProfile>
     24    </TargetFrameworkProfile>
    2425    <PublishUrl>publish\</PublishUrl>
    2526    <Install>true</Install>
     
    213214    <Compile Include="Attributes\ApplicationAttribute.cs" />
    214215    <Compile Include="Attributes\ContactInformationAttribute.cs" />
     216    <Compile Include="Attributes\NonDiscoverableTypeAttribute.cs" />
    215217    <Compile Include="Attributes\PluginAttribute.cs" />
    216218    <Compile Include="Attributes\PluginDependencyAttribute.cs" />
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs

    r5445 r5741  
    122122               where CheckTypeCompatibility(type, t)
    123123               where onlyInstantiable == false || (!t.IsAbstract && !t.IsInterface && !t.HasElementType)
     124               where !IsNonDiscoverableType(t)
    124125               select BuildType(t, type);
    125126      }
     
    130131        return Enumerable.Empty<Type>();
    131132      }
     133    }
     134
     135    private static bool IsNonDiscoverableType(Type t) {
     136      return t.GetCustomAttributes(typeof(NonDiscoverableTypeAttribute), false).Any();
    132137    }
    133138
Note: See TracChangeset for help on using the changeset viewer.