Exemplo n.º 1
0
        public static void Project(FieldDefinition field)
        {
            FieldDefinitionTreatment fieldDefinitionTreatment = FieldDefinitionTreatment.None;
            TypeDefinition           declaringType            = field.DeclaringType;

            if (declaringType.Module.MetadataKind == MetadataKind.WindowsMetadata && field.IsRuntimeSpecialName && field.Name == "value__")
            {
                TypeReference baseType = declaringType.BaseType;
                if (baseType != null && IsEnum(baseType))
                {
                    fieldDefinitionTreatment = FieldDefinitionTreatment.Public;
                }
            }
            if (fieldDefinitionTreatment != 0)
            {
                ApplyProjection(field, new FieldDefinitionProjection(field, fieldDefinitionTreatment));
            }
        }
 public FieldDefinitionProjection(FieldDefinition field, FieldDefinitionTreatment treatment)
 {
     Attributes = field.Attributes;
     Treatment  = treatment;
 }
 public FieldDefinitionProjection(FieldDefinition field, FieldDefinitionTreatment treatment)
 {
     Attributes = field.Attributes;
     Treatment = treatment;
 }