Ejemplo n.º 1
0
 private IEnumerable <ICustomAttribute> WriteFieldDefinitionFieldsAsAttributes(FieldDefinition member)
 {
     V_0 = new List <ICustomAttribute>();
     if (member.get_IsNotSerialized())
     {
         V_0.Add(AttributesUtilities.GetFieldNotSerializedAttribute(member));
     }
     if (member.get_DeclaringType().get_IsExplicitLayout())
     {
         V_0.Add(AttributesUtilities.GetFieldFieldOffsetAttribute(member));
     }
     return(V_0);
 }
Ejemplo n.º 2
0
        private IEnumerable <ICustomAttribute> WriteFieldDefinitionFieldsAsAttributes(FieldDefinition member)
        {
            List <ICustomAttribute> attributes = new List <ICustomAttribute>();

            //write [NotSerialized] attribute
            if (member.IsNotSerialized)
            {
                attributes.Add(AttributesUtilities.GetFieldNotSerializedAttribute(member));
            }

            //write [FieldOffset(x)] attribute
            if (member.DeclaringType.IsExplicitLayout)
            {
                attributes.Add(AttributesUtilities.GetFieldFieldOffsetAttribute(member));
            }

            return(attributes);
        }