+2005-01-11 Sebastien Pouliot <sebastien@ximian.com>
+
+ * PermissionSetAttribute.cs: Throw proper exception if XML cannot be
+ decoded. Actually load (not just creates) the XML permissions.
+
2005-01-08 Sebastien Pouliot <sebastien@ximian.com>
* PermissionSetAttribute.cs: Implemented Hex property (2.0) now that
private PermissionSet CreateFromXml (string xml)
{
SecurityParser sp = new SecurityParser ();
- sp.LoadXml (xml);
+ try {
+ sp.LoadXml (xml);
+ }
+ catch (Mono.Xml.MiniParser.XMLError xe) {
+ throw new XmlSyntaxException (xe.Line, xe.ToString ());
+ }
SecurityElement se = sp.ToXml ();
string className = se.Attribute ("class");
if (className.EndsWith ("NamedPermissionSet")) {
NamedPermissionSet nps = new NamedPermissionSet (se.Attribute ("Name"), state);
+ nps.FromXml (se);
return (PermissionSet) nps;
}
else if (className.EndsWith ("PermissionSet")) {
PermissionSet ps = new PermissionSet (state);
+ ps.FromXml (se);
return ps;
}
return null;