@@ -126,7 +126,7 @@ public ushort TryEvaluate(string exp, ushort def)
126126 try {
127127 var function = Parse ( exp ) ;
128128 var obj = function . Calculate ( this ) ;
129- if ( obj . Type != OperandType . NUMBER ) {
129+ if ( obj . IsNotNumber ) {
130130 obj = obj . ToNumber ( "It can't be converted to number!" ) ;
131131 if ( obj . IsError ) {
132132 LastError = obj . ErrorMsg ;
@@ -151,7 +151,7 @@ public uint TryEvaluate(string exp, uint def)
151151 try {
152152 var function = Parse ( exp ) ;
153153 var obj = function . Calculate ( this ) ;
154- if ( obj . Type != OperandType . NUMBER ) {
154+ if ( obj . IsNotNumber ) {
155155 obj = obj . ToNumber ( "It can't be converted to number!" ) ;
156156 if ( obj . IsError ) {
157157 LastError = obj . ErrorMsg ;
@@ -176,7 +176,7 @@ public ulong TryEvaluate(string exp, ulong def)
176176 try {
177177 var function = Parse ( exp ) ;
178178 var obj = function . Calculate ( this ) ;
179- if ( obj . Type != OperandType . NUMBER ) {
179+ if ( obj . IsNotNumber ) {
180180 obj = obj . ToNumber ( "It can't be converted to number!" ) ;
181181 if ( obj . IsError ) {
182182 LastError = obj . ErrorMsg ;
@@ -201,7 +201,7 @@ public short TryEvaluate(string exp, short def)
201201 try {
202202 var function = Parse ( exp ) ;
203203 var obj = function . Calculate ( this ) ;
204- if ( obj . Type != OperandType . NUMBER ) {
204+ if ( obj . IsNotNumber ) {
205205 obj = obj . ToNumber ( "It can't be converted to number!" ) ;
206206 if ( obj . IsError ) {
207207 LastError = obj . ErrorMsg ;
@@ -226,7 +226,7 @@ public int TryEvaluate(string exp, int def)
226226 try {
227227 var function = Parse ( exp ) ;
228228 var obj = function . Calculate ( this ) ;
229- if ( obj . Type != OperandType . NUMBER ) {
229+ if ( obj . IsNotNumber ) {
230230 obj = obj . ToNumber ( "It can't be converted to number!" ) ;
231231 if ( obj . IsError ) {
232232 LastError = obj . ErrorMsg ;
@@ -251,7 +251,7 @@ public long TryEvaluate(string exp, long def)
251251 try {
252252 var function = Parse ( exp ) ;
253253 var obj = function . Calculate ( this ) ;
254- if ( obj . Type != OperandType . NUMBER ) {
254+ if ( obj . IsNotNumber ) {
255255 obj = obj . ToNumber ( "It can't be converted to number!" ) ;
256256 if ( obj . IsError ) {
257257 LastError = obj . ErrorMsg ;
@@ -276,7 +276,7 @@ public float TryEvaluate(string exp, float def)
276276 try {
277277 var function = Parse ( exp ) ;
278278 var obj = function . Calculate ( this ) ;
279- if ( obj . Type != OperandType . NUMBER ) {
279+ if ( obj . IsNotNumber ) {
280280 obj = obj . ToNumber ( "It can't be converted to number!" ) ;
281281 if ( obj . IsError ) {
282282 LastError = obj . ErrorMsg ;
@@ -301,7 +301,7 @@ public double TryEvaluate(string exp, double def)
301301 try {
302302 var function = Parse ( exp ) ;
303303 var obj = function . Calculate ( this ) ;
304- if ( obj . Type != OperandType . NUMBER ) {
304+ if ( obj . IsNotNumber ) {
305305 obj = obj . ToNumber ( "It can't be converted to number!" ) ;
306306 if ( obj . IsError ) {
307307 LastError = obj . ErrorMsg ;
@@ -326,7 +326,7 @@ public decimal TryEvaluate(string exp, decimal def)
326326 try {
327327 var function = Parse ( exp ) ;
328328 var obj = function . Calculate ( this ) ;
329- if ( obj . Type != OperandType . NUMBER ) {
329+ if ( obj . IsNotNumber ) {
330330 obj = obj . ToNumber ( "It can't be converted to number!" ) ;
331331 if ( obj . IsError ) {
332332 LastError = obj . ErrorMsg ;
@@ -351,7 +351,7 @@ public string TryEvaluate(string exp, string def)
351351 try {
352352 var function = Parse ( exp ) ;
353353 var obj = function . Calculate ( this ) ;
354- if ( obj . Type != OperandType . TEXT ) {
354+ if ( obj . IsNotText ) {
355355 obj = obj . ToText ( "It can't be converted to string!" ) ;
356356 if ( obj . IsError ) {
357357 LastError = obj . ErrorMsg ;
@@ -376,7 +376,7 @@ public bool TryEvaluate(string exp, bool def)
376376 try {
377377 var function = Parse ( exp ) ;
378378 var obj = function . Calculate ( this ) ;
379- if ( obj . Type != OperandType . BOOLEAN ) {
379+ if ( obj . IsNotBoolean ) {
380380 obj = obj . ToBoolean ( "It can't be converted to bool!" ) ;
381381 if ( obj . IsError ) {
382382 LastError = obj . ErrorMsg ;
@@ -401,7 +401,7 @@ public DateTime TryEvaluate(string exp, DateTime def)
401401 try {
402402 var function = Parse ( exp ) ;
403403 var obj = function . Calculate ( this ) ;
404- if ( obj . Type == OperandType . DATE ) {
404+ if ( obj . IsDate ) {
405405 obj = obj . ToMyDate ( "It can't be converted to DateTime!" ) ;
406406 if ( obj . IsError ) {
407407 LastError = obj . ErrorMsg ;
@@ -429,7 +429,7 @@ public TimeSpan TryEvaluate(string exp, TimeSpan def)
429429 try {
430430 var function = Parse ( exp ) ;
431431 var obj = function . Calculate ( this ) ;
432- if ( obj . Type == OperandType . DATE ) {
432+ if ( obj . IsNotDate ) {
433433 obj = obj . ToMyDate ( "It can't be converted to DateTime!" ) ;
434434 if ( obj . IsError ) {
435435 LastError = obj . ErrorMsg ;
@@ -455,7 +455,7 @@ public MyDate TryEvaluate_MyDate(string exp, MyDate def)
455455 try {
456456 var function = Parse ( exp ) ;
457457 var obj = function . Calculate ( this ) ;
458- if ( obj . Type != OperandType . DATE ) {
458+ if ( obj . IsNotDate ) {
459459 obj = obj . ToMyDate ( "It can't be converted to DateTime!" ) ;
460460 if ( obj . IsError ) {
461461 LastError = obj . ErrorMsg ;
0 commit comments