public static void ApplyProjection(MethodDefinition method, MethodDefinitionProjection projection)
{
if (projection == null)
return;
var treatment = projection.Treatment;
if ((treatment & MethodDefinitionTreatment.Abstract) != 0)
method.Attributes |= MethodAttributes.Abstract;
if ((treatment & MethodDefinitionTreatment.Private) != 0)
method.Attributes = (method.Attributes & ~MethodAttributes.MemberAccessMask) | MethodAttributes.Private;
if ((treatment & MethodDefinitionTreatment.Public) != 0)
method.Attributes = (method.Attributes & ~MethodAttributes.MemberAccessMask) | MethodAttributes.Public;
if ((treatment & MethodDefinitionTreatment.Runtime) != 0)
method.ImplAttributes |= MethodImplAttributes.Runtime;
if ((treatment & MethodDefinitionTreatment.InternalCall) != 0)
method.ImplAttributes |= MethodImplAttributes.InternalCall;
method.WindowsRuntimeProjection = projection;
}