Created
January 16, 2014 23:01
-
-
Save VladimirReshetnikov/8465183 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Security; | |
| using System.Security.Permissions; | |
| class B | |
| { | |
| [X(SecurityAction.Demand)] | |
| public B() { } | |
| } | |
| class C : B { } | |
| class X : CodeAccessSecurityAttribute | |
| { | |
| public X(SecurityAction action) : base(action) | |
| { | |
| Console.WriteLine("Allocated " + new object()); | |
| } | |
| public override IPermission CreatePermission() | |
| { | |
| return null; | |
| } | |
| } | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| Console.WriteLine("Allocated " + new C()); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment