X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Fcorlib%2FSystem.Security%2FSecurityCriticalAttribute.cs;h=61494169a496ebf29cbbb94b1e7201354b1762ab;hb=fe301c16ee25c3374751bfe48ccdea1720c42b84;hp=85fb01c76b65c9194a64539a34692bb0ceb397a0;hpb=234225d112c4b018b8d1796f4c06a15812137500;p=mono.git diff --git a/mcs/class/corlib/System.Security/SecurityCriticalAttribute.cs b/mcs/class/corlib/System.Security/SecurityCriticalAttribute.cs index 85fb01c76b6..61494169a49 100644 --- a/mcs/class/corlib/System.Security/SecurityCriticalAttribute.cs +++ b/mcs/class/corlib/System.Security/SecurityCriticalAttribute.cs @@ -28,18 +28,39 @@ #if NET_2_0 -using System.Runtime.InteropServices; - namespace System.Security { - [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Interface, + [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | + AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | + AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple=false, Inherited=false)] - [ComVisible (false)] + [MonoTODO ("Not supported by the runtime")] public sealed class SecurityCriticalAttribute : Attribute { + private SecurityCriticalScope _scope; + public SecurityCriticalAttribute () : base () { + _scope = SecurityCriticalScope.Explicit; + } + + public SecurityCriticalAttribute (SecurityCriticalScope scope) + : base () + { + switch (scope) { + case SecurityCriticalScope.Everything: + _scope = SecurityCriticalScope.Everything; + break; + default: + // that includes all bad enums values + _scope = SecurityCriticalScope.Explicit; + break; + } + } + + public SecurityCriticalScope Scope { + get { return _scope; } } } }