// Miguel de Icaza (miguel@novell.com)
// Ben Maurer (bmaurer@ximian.com).
//
-// (C) 2005 Novell, Inc.
-//
-
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System;
using System.Globalization;
using System.ComponentModel;
+using System.Security.Permissions;
namespace System.Web.UI.WebControls {
[TypeConverter(typeof (UnitConverter))]
#if NET_2_0
[Serializable]
+#else
+ // CAS
+ [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
#endif
public struct Unit {
UnitType type;
i++;
if (!Char.IsDigit (value [i]))
throw new ArgumentOutOfRangeException ("value");
+ } else if (!Char.IsDigit (value [i])) {
+ throw new FormatException ();
}
double dv = 0;