mscorlib(4.0.0.0) API with additions
SecurityAttribute.cs
2 
4 {
7  [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
8  [ComVisible(true)]
9  public abstract class SecurityAttribute : Attribute
10  {
11  internal SecurityAction m_action;
12 
13  internal bool m_unrestricted;
14 
17  public SecurityAction Action
18  {
19  get
20  {
21  return m_action;
22  }
23  set
24  {
25  m_action = value;
26  }
27  }
28 
32  public bool Unrestricted
33  {
34  get
35  {
36  return m_unrestricted;
37  }
38  set
39  {
40  m_unrestricted = value;
41  }
42  }
43 
47  {
48  m_action = action;
49  }
50 
53  public abstract IPermission CreatePermission();
54 
55  [SecurityCritical]
56  internal static IntPtr FindSecurityAttributeTypeHandle(string typeName)
57  {
58  PermissionSet.s_fullTrust.Assert();
59  Type type = Type.GetType(typeName, throwOnError: false, ignoreCase: false);
60  if (type == null)
61  {
62  return IntPtr.Zero;
63  }
64  return type.TypeHandle.Value;
65  }
66  }
67 }
abstract IPermission CreatePermission()
When overridden in a derived class, creates a permission object that can then be serialized into bina...
virtual RuntimeTypeHandle TypeHandle
Gets the handle for the current T:System.Type.
Definition: Type.cs:141
SecurityAction Action
Gets or sets a security action.
Represents the base class for custom attributes.
Definition: Attribute.cs:15
Definition: __Canon.cs:3
IntPtr Value
Gets a handle to the type represented by this instance.
SecurityAction
Specifies the security actions that can be performed using declarative security.
Represents a collection that can contain many different types of permissions.
Specifies the base attribute class for declarative security from which T:System.Security....
bool Unrestricted
Gets or sets a value indicating whether full (unrestricted) permission to the resource protected by t...
A platform-specific type that is used to represent a pointer or a handle.
Definition: IntPtr.cs:14
Represents type declarations: class types, interface types, array types, value types,...
Definition: Type.cs:18
Defines methods implemented by permission types.
Definition: IPermission.cs:7
AttributeTargets
Specifies the application elements on which it is valid to apply an attribute.
SecurityAttribute(SecurityAction action)
Initializes a new instance of T:System.Security.Permissions.SecurityAttribute with the specified T:Sy...
static readonly IntPtr Zero
A read-only field that represents a pointer or handle that has been initialized to zero.
Definition: IntPtr.cs:20
Specifies that the class can be serialized.
static Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Gets the T:System.Type with the specified name, specifying whether to throw an exception if the type ...
Definition: Type.cs:853
void Assert()
Declares that the calling code can access the resource protected by a permission demand through the c...