Mono.Cecil.WindowsRuntimeProjections.ApplyProjection C# (CSharp) Method

ApplyProjection() public static method

public static ApplyProjection ( Mono.Cecil.MethodDefinition method, MethodDefinitionProjection projection ) : void
method Mono.Cecil.MethodDefinition
projection MethodDefinitionProjection
return void
        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;
        }

Same methods

WindowsRuntimeProjections::ApplyProjection ( CustomAttribute attribute, CustomAttributeValueProjection projection ) : void
WindowsRuntimeProjections::ApplyProjection ( FieldDefinition field, FieldDefinitionProjection projection ) : void
WindowsRuntimeProjections::ApplyProjection ( Mono.Cecil.TypeDefinition type, TypeDefinitionProjection projection ) : void
WindowsRuntimeProjections::ApplyProjection ( TypeReference type, TypeReferenceProjection projection ) : void