2 using System.Reflection;
4 using System.Security.Permissions;
5 using System.Threading;
11 public static void TestStatic ()
14 string name = Thread.CurrentThread.Name;
18 Console.WriteLine ("\tDelegate running on thread: {0} (from pool: {1})\n{2}", name,
19 Thread.CurrentThread.IsThreadPoolThread, Environment.StackTrace);
23 Console.WriteLine (Assembly.GetExecutingAssembly ().Evidence.Count);
26 catch (SecurityException se) {
28 Console.WriteLine ("EXPECTED SecurityException {0}", se);
30 catch (Exception ex) {
31 Console.WriteLine ("UNEXPECTED {0}", ex);
39 // this Deny will prevent the Assembly.Evidence property from working
40 [SecurityPermission (SecurityAction.Deny, ControlEvidence = true)]
41 public static int Main (string[] args)
44 debug = (args.Length > 0);
46 Thread.CurrentThread.Name = "Main";
47 Console.WriteLine (">Thread.Name: {0}", Thread.CurrentThread.Name);
50 Test t = new Test (TestStatic);
51 IAsyncResult ar = t.BeginInvoke (null, null);
55 Console.WriteLine ("<Thread.Name: {0}", Thread.CurrentThread.Name);