示例#1
0
 /*----------------------------------------------------------------------------------------*/
 private void InitializeHeuristics()
 {
     Heuristics.Add(new StandardHeuristic <ConstructorInfo>());
     Heuristics.Add(new StandardHeuristic <MethodInfo>());
     Heuristics.Add(new StandardHeuristic <PropertyInfo>());
     Heuristics.Add(new StandardHeuristic <FieldInfo>());
 }
示例#2
0
 public void Add(SpamHeuristic heuristic, float weight = 1)
 {
     Heuristics.Add(heuristic, weight);
 }
 /*----------------------------------------------------------------------------------------*/
 /// <summary>
 /// Declares a heuristic for selecting methods for injection.
 /// </summary>
 /// <param name="condition">The condition to match.</param>
 protected void InjectMethods(ICondition <MethodInfo> condition)
 {
     Heuristics.Add(new ConditionHeuristic <MethodInfo>(condition));
 }
 /*----------------------------------------------------------------------------------------*/
 /// <summary>
 /// Declares a heuristic for selecting properties for injection.
 /// </summary>
 /// <param name="predicate">The predicate to match.</param>
 protected void InjectProperties(Predicate <PropertyInfo> predicate)
 {
     Heuristics.Add(new ConditionHeuristic <PropertyInfo>(predicate));
 }
 /*----------------------------------------------------------------------------------------*/
 /// <summary>
 /// Declares a heuristic for selecting properties for injection.
 /// </summary>
 /// <param name="condition">The condition to match.</param>
 protected void InjectProperties(ICondition <PropertyInfo> condition)
 {
     Heuristics.Add(new ConditionHeuristic <PropertyInfo>(condition));
 }
 /*----------------------------------------------------------------------------------------*/
 /// <summary>
 /// Declares a heuristic for selecting constructors for injection.
 /// </summary>
 /// <param name="predicate">The predicate to match.</param>
 protected void InjectConstructors(Predicate <ConstructorInfo> predicate)
 {
     Heuristics.Add(new ConditionHeuristic <ConstructorInfo>(predicate));
 }
 /*----------------------------------------------------------------------------------------*/
 /// <summary>
 /// Declares a heuristic for selecting constructors for injection.
 /// </summary>
 /// <param name="condition">The condition to match.</param>
 protected void InjectConstructors(ICondition <ConstructorInfo> condition)
 {
     Heuristics.Add(new ConditionHeuristic <ConstructorInfo>(condition));
 }
 /*----------------------------------------------------------------------------------------*/
 /// <summary>
 /// Declares a heuristic for selecting fields for injection.
 /// </summary>
 /// <param name="predicate">The predicate to match.</param>
 protected void InjectFields(Predicate <FieldInfo> predicate)
 {
     Heuristics.Add(new ConditionHeuristic <FieldInfo>(predicate));
 }
 /*----------------------------------------------------------------------------------------*/
 /// <summary>
 /// Declares a heuristic for selecting fields for injection.
 /// </summary>
 /// <param name="condition">The condition to match.</param>
 protected void InjectFields(ICondition <FieldInfo> condition)
 {
     Heuristics.Add(new ConditionHeuristic <FieldInfo>(condition));
 }
 /*----------------------------------------------------------------------------------------*/
 /// <summary>
 /// Declares a heuristic for selecting methods for injection.
 /// </summary>
 /// <param name="predicate">The predicate to match.</param>
 protected void InjectMethods(Predicate <MethodInfo> predicate)
 {
     Heuristics.Add(new ConditionHeuristic <MethodInfo>(predicate));
 }