Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ArgumentException in Tablets.Count method

sistematically, but only on one PC, while executing this code:

using Microsoft.Ink;

...

Tablets allTablets = new Tablets();
int numTablet = allTablets.Count;

I get this exception.

System.ArgumentException: Valore non compreso nell'intervallo previsto. {In English --> Value not in the right range}
in Microsoft.Ink.InkTabletsClass.get_Count()
in Microsoft.Ink.Tablets.get_Count()

How could a COUNT throw this kind of exception? Does it means that the Count method return a value that is not int? Thanks.

like image 330
Andrea Avatar asked Mar 21 '26 00:03

Andrea


1 Answers

How could a COUNT throw this kind of exception?

Because of some logic that is implemented in the getter of the Count property of the Tablets class. It is in the getter that the exception is thrown.

Does it means that the Count method return a value that is not int?

No. An int property can only return an int value or throw an exception. It can never return a value of any other type. The compiler enforces this.

like image 99
mm8 Avatar answered Mar 22 '26 14:03

mm8



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!