Is it possible to convert a string to an operator for use in a logical condition.
For example
if(x Convert.ToOperator(\">\") y) {}
Vici Parser (open-source) may be of help to you. It's a C# expression parser where you can just pass a string containing an expression, and you get the computed result back.
You could do something like this:
public static bool Compare<T>(string op, T x, T y) where T:IComparable
{
switch(op)
{
case "==" : return x.CompareTo(y)==0;
case "!=" : return x.CompareTo(y)!=0;
case ">" : return x.CompareTo(y)>0;
case ">=" : return x.CompareTo(y)>=0;
case "<" : return x.CompareTo(y)<0;
case "<=" : return x.CompareTo(y)<=0;
}
}