Exemplo n.º 1
0
 /// <summary>Search for slot that corresponds to class.</summary>
 /// <remarks>
 /// Search for slot that corresponds to class. <br />If not found add it.
 /// <br />Constrain it. <br />
 /// </remarks>
 public virtual IConstraint Constrain(object example)
 {
     lock (StreamLock())
     {
         IReflectClass claxx = ReflectClassForClass(example);
         if (claxx != null)
         {
             return(AddClassConstraint(claxx));
         }
         QConEvaluation eval = Platform4.EvaluationCreate(_trans, example);
         if (eval != null)
         {
             return(AddEvaluationToAllConstraints(eval));
         }
         Collection4 constraints = new Collection4();
         AddConstraint(constraints, example);
         return(ToConstraint(constraints));
     }
 }