sistematically,但仅在一台 PC 上,同时执行此代码:
using Microsoft.Ink;
...
Tablets allTablets = new Tablets();
int numTablet = allTablets.Count;
我得到这个异常。
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()
COUNT 怎么会抛出这种异常? 这是否意味着 Count 方法返回一个不是 int 的值? 谢谢。
最佳答案
How could a COUNT throw this kind of exception?
因为在 Tablets
类的 Count
属性的 getter 中实现了一些逻辑。正是在 getter 中抛出了异常。
Does it means that the Count method return a value that is not int?
没有。 int
属性只能返回 int
值或抛出异常。它永远不能返回任何其他类型的值。编译器强制执行此操作。
关于c# - Tablets.Count 方法中的 ArgumentException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46119562/