c# - Tablets.Count 方法中的 ArgumentException

标签 c# exception tablet

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/

相关文章:

android - 如何让我的手机应用填满平板电脑 (Xoom) 的整个屏幕?

c# - 在 StackExchange.Redis 中通过键模式获取值

java "not comparable"异常?

Android 应用程序无法在平板电脑上运行

自定义异常的 Java 解析异常

python - 正确处理 logging.config.fileConfig 抛出的 IOError?

android - “为平板电脑设计应用”优化技巧

c# - 使用信号量进行线程编程

c# - 我可以避免在从 iPhoneOSGameView 派生的 View 中导出 LayerClass 吗?

c# - 为什么我的 SQL 查询在转换后比较日期时选择所有行?