2008-01-02 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mcs / class / corlib / System.Security / SecurityFrame.cs
index 14f412dfb6f56b0f9364a26fca12a2c179081eae..7824e0880dd768a80eefb96900e08f78ee7fc1c8 100644 (file)
@@ -31,6 +31,7 @@ using System.Globalization;
 using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Security.Permissions;
+using System.Text;
 
 namespace System.Security {
 
@@ -152,6 +153,21 @@ namespace System.Security {
                        return true;
                }
 
+               public override string ToString ()
+               {
+                       StringBuilder sb = new StringBuilder ();
+                       sb.AppendFormat ("Frame: {0}{1}", _method, Environment.NewLine);
+                       sb.AppendFormat ("\tAppDomain: {0}{1}", Domain, Environment.NewLine);
+                       sb.AppendFormat ("\tAssembly: {0}{1}", Assembly, Environment.NewLine);
+                       if (_assert != null)
+                               sb.AppendFormat ("\tAssert: {0}{1}", _assert, Environment.NewLine);
+                       if (_deny != null)
+                               sb.AppendFormat ("\tDeny: {0}{1}", _deny, Environment.NewLine);
+                       if (_permitonly != null)
+                               sb.AppendFormat ("\tPermitOnly: {0}{1}", _permitonly, Environment.NewLine);
+                       return sb.ToString ();
+               }
+
                static public ArrayList GetStack (int skipFrames)
                {
                        Array stack = _GetSecurityStack (skipFrames+2);