TeeChart for Android DateTime FormatException

时间:2012-06-11 21:59:54

标签: xamarin.android teechart

我一直在评估TeeChart for Mono / Android,但每次我尝试运行示例项目时,我的模拟器都会抛出异常:

System.FormatException: String was not recognized as a valid DateTime.
 at System.DateTime.Parse  (string,System.IFormatProvider,System.Globalization.DateTimeStyles) [0x00027] in /Users  /builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/corlib/System/DateTime.cs:830

 at System.DateTime.Parse (string,System.IFormatProvider) [0x00000] in /Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/corlib/System/DateTime.cs:818

 at System.DateTime.Parse (string) [0x00000] in /Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/mono/mcs/class/corlib/System/DateTime.cs:813

 at Steema.TeeChart.Chart.BetaNotExpired () <IL 0x0000c, 0x000cf>

 at Steema.TeeChart.Chart.InternalDraw (Android.Graphics.Canvas) <IL 0x00001, 0x0004b>

 at Steema.TeeChart.TChart.Draw (Android.Graphics.Canvas,System.Drawing.Rectangle) <IL 0x000c4, 0x004ef>

 at Steema.TeeChart.TChart.Draw (Android.Graphics.Canvas) <IL 0x00007, 0x00097>

 at Steema.TeeChart.TChart.OnDraw (Android.Graphics.Canvas) <IL 0x00055, 0x001a3>

 at Android.Views.View.n_OnDraw_Landroid_graphics_Canvas_ (intptr,intptr,intptr) [0x00010] in /Users/builder/data/lanes/monodroid-mac-4.2-series/804357b4/source/monodroid/src/Mono.Android/platforms/android-12/src/generated/Android.Views.View.cs:9297

 at (wrapper dynamic-method) object.69af4743-db01-4501-8f13-77deb4a4e86e (intptr,intptr,intptr) <IL 0x00012, 0x00033>

基于堆栈跟踪,我猜它与BetaNotExpired有关,可能是查找值,但我今天刚刚请求并收到了评估版本。有谁知道怎么让TeeChart工作?

1 个答案:

答案 0 :(得分:0)

对不起,我的不好。此测试版将于7月31日到期。我忘了使用文化中立机制。我使用 DateTime.Parse(“31/07/2012”),而您可能需要 DateTime.Parse(“07/31/2012”) DateTime.Parse( “2012/07/31”)。所以我更改了TeeChart.Monodroid.dll以使用文化中立机制将DateTime值转换为DateTime.ToUniversalTime()的通用时间。您可以下载新程序集here。它是用Mono for Android 4.2.3 beta编译的。如果有必要,我也可以编译为4.2。如果错误修复无法解决问题,请告诉我。

提前致谢。