+
+ public void AddDeclarativeSecurity( SecurityAction action, PermissionSet pset) {
+ if (pset == null)
+ throw new ArgumentNullException ("pset");
+ if ((action == SecurityAction.RequestMinimum) ||
+ (action == SecurityAction.RequestOptional) ||
+ (action == SecurityAction.RequestRefuse))
+ throw new ArgumentException ("Request* values are not permitted", "action");
+
+ RejectIfCreated ();
+
+ if (permissions != null) {
+ /* Check duplicate actions */
+ foreach (RefEmitPermissionSet set in permissions)
+ if (set.action == action)
+ throw new InvalidOperationException ("Multiple permission sets specified with the same SecurityAction.");
+
+ RefEmitPermissionSet[] new_array = new RefEmitPermissionSet [permissions.Length + 1];
+ permissions.CopyTo (new_array, 0);
+ permissions = new_array;
+ }
+ else
+ permissions = new RefEmitPermissionSet [1];
+
+ permissions [permissions.Length - 1] = new RefEmitPermissionSet (action, pset.ToXml ().ToString ());
+ attrs |= MethodAttributes.HasSecurity;
+ }
+
+ [MonoTODO]
+ public void SetMarshal (UnmanagedMarshal unmanagedMarshal)
+ {
+ RejectIfCreated ();
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public void SetSymCustomAttribute (string name, byte[] data)
+ {
+ RejectIfCreated ();
+ throw new NotImplementedException ();
+ }
+
+ public override string ToString()
+ {
+ return "MethodBuilder [" + type.Name + "::" + name + "]";
+ }
+
+ [MonoTODO]
+ public override bool Equals (object obj)
+ {
+ return base.Equals (obj);
+ }
+
+ public override int GetHashCode ()
+ {
+ return name.GetHashCode ();
+ }
+