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

Project() public static method

public static Project ( Mono.Cecil.TypeDefinition type ) : void
type Mono.Cecil.TypeDefinition
return void
        public static void Project(TypeDefinition type)
        {
            var treatment = TypeDefinitionTreatment.None;
            var metadata_kind = type.Module.MetadataKind;
            Collection<MethodDefinition> redirectedMethods = null;
            Collection<KeyValuePair<InterfaceImplementation, InterfaceImplementation>> redirectedInterfaces = null;

            if (type.IsWindowsRuntime) {
                if (metadata_kind == MetadataKind.WindowsMetadata) {
                    treatment = GetWellKnownTypeDefinitionTreatment (type);
                    if (treatment != TypeDefinitionTreatment.None) {
                        ApplyProjection (type, new TypeDefinitionProjection (type, treatment, redirectedMethods, redirectedInterfaces));
                        return;
                    }

                    var base_type = type.BaseType;
                    if (base_type != null && IsAttribute (base_type)) {
                        treatment = TypeDefinitionTreatment.NormalAttribute;
                    } else {
                        treatment = GenerateRedirectionInformation (type, out redirectedMethods, out redirectedInterfaces);
                    }
                }
                else if (metadata_kind == MetadataKind.ManagedWindowsMetadata && NeedsWindowsRuntimePrefix (type))
                    treatment = TypeDefinitionTreatment.PrefixWindowsRuntimeName;

                if (treatment == TypeDefinitionTreatment.PrefixWindowsRuntimeName || treatment == TypeDefinitionTreatment.NormalType)
                    if (!type.IsInterface && HasAttribute (type, "Windows.UI.Xaml", "TreatAsAbstractComposableClassAttribute"))
                        treatment |= TypeDefinitionTreatment.Abstract;
            }
            else if (metadata_kind == MetadataKind.ManagedWindowsMetadata && IsClrImplementationType (type))
                treatment = TypeDefinitionTreatment.UnmangleWindowsRuntimeName;

            if (treatment != TypeDefinitionTreatment.None)
                ApplyProjection (type, new TypeDefinitionProjection (type, treatment, redirectedMethods, redirectedInterfaces));
        }

Same methods

WindowsRuntimeProjections::Project ( FieldDefinition field ) : void
WindowsRuntimeProjections::Project ( ICustomAttributeProvider owner, CustomAttribute attribute ) : void
WindowsRuntimeProjections::Project ( Mono.Cecil.MethodDefinition method ) : void
WindowsRuntimeProjections::Project ( TypeReference type ) : void