Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Pouliot <sebastien@ximian.com>2005-01-11 04:07:14 +0300
committerSebastien Pouliot <sebastien@ximian.com>2005-01-11 04:07:14 +0300
commit510706a09539bd170544bef763b4e2ae5fb30230 (patch)
tree77bb7ff2f8f38061a308255a5a68ae8dd8666542 /mcs/class/corlib/System.Security/SecurityElement.cs
parentc626c63a9eb3958691841562ff16f7e31e06ca07 (diff)
2005-01-10 Sebastien Pouliot <sebastien@ximian.com>
* HostSecurityManager.cs: Fix signature as DetermineApplicationTrust doesn't return a boolean anymore. * SecurityElement.cs: The attributes and children elements are not indented in 2.0. This fix many unit tests that do string compares. * PermissionSetCollection.cs: We can't trust all IList implementations to throw the ArgumentOutOfRangeException - so we better do it here. svn path=/trunk/mcs/; revision=38662
Diffstat (limited to 'mcs/class/corlib/System.Security/SecurityElement.cs')
-rwxr-xr-xmcs/class/corlib/System.Security/SecurityElement.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/mcs/class/corlib/System.Security/SecurityElement.cs b/mcs/class/corlib/System.Security/SecurityElement.cs
index 1b3b5535ab8..ddc8aad35cf 100755
--- a/mcs/class/corlib/System.Security/SecurityElement.cs
+++ b/mcs/class/corlib/System.Security/SecurityElement.cs
@@ -311,6 +311,8 @@ namespace System.Security
{
if (xml == null)
throw new ArgumentNullException ("xml");
+ if (xml.Length == 0)
+ throw new XmlSyntaxException (Locale.GetText ("Empty string."));
try {
SecurityParser sp = new SecurityParser ();
@@ -390,17 +392,24 @@ namespace System.Security
private void ToXml (ref StringBuilder s, int level)
{
+#if ! NET_2_0
s.Append (' ', level * 3);
+#endif
s.Append ("<");
s.Append (tag);
if (attributes != null) {
+#if NET_2_0
+ s.Append (" ");
+#endif
for (int i=0; i < attributes.Count; i++) {
SecurityAttribute sa = (SecurityAttribute) attributes [i];
+#if ! NET_2_0
s.Append (" ");
// all other attributes must align with the first one
if (i != 0)
s.Append (' ', (level * 3) + tag.Length + 1);
+#endif
s.Append (sa.Name)
.Append ("=\"")
.Append (sa.Value)
@@ -420,7 +429,9 @@ namespace System.Security
foreach (SecurityElement child in children) {
child.ToXml (ref s, level + 1);
}
+#if ! NET_2_0
s.Append (' ', level * 3);
+#endif
}
s.Append ("</")
.Append (tag)