samedi 4 juin 2016

How to get boolean result of a comparison in string?

I want to create the condition statement deriving from a string. The statements may contain control ids.

Something like:

string comparison = "txtBox1.Text == \"0\"";

bool ret = ConvertToBoolean(comparison);

or like:

   string testMethod = "public bool TestMethod() { return txtBox1.Text == \"0\" }; ";
        Run(comparison);

I had tried this: http://ift.tt/1xeUX1D

But it can't access the control.





Aucun commentaire:

Enregistrer un commentaire