MethodBuilder.AddDeclarativeSecurity(System.Security.Permissions.SecurityAction, System.Security.PermissionSet) can be called several times, with each call specifying a security action (such as Demand, Assert, and Deny) and a set of permissions that the action applies to.
In the .NET Framework versions 1.0, 1.1, and 2.0, the declarative security attributes applied to a method by using the MethodBuilder.AddDeclarativeSecurity(System.Security.Permissions.SecurityAction, System.Security.PermissionSet) method are stored in the old XML metadata format. See Emitting Declarative Security Attributes.