Exemple #1
0
        // NOTE: May be called on invalid definitions
        public override bool FieldAlwaysUsed(CST.AssemblyDef assemblyDef, CST.TypeDef typeDef, CST.FieldDef fieldDef)
        {
#if false
            if (env.AttributeHelper.FieldHasAttribute(assemblyDef, typeDef, fieldDef, env.Global.CompilerGeneratedAttributeRef, false))
            {
                return(false);
            }
#endif
            if (env.AttributeHelper.FieldHasAttribute(assemblyDef, typeDef, fieldDef, env.AttributeHelper.IgnoreAttributeRef, true, true))
            {
                return(false);
            }

            if (HasFullReflection(assemblyDef, typeDef))
            {
                return(true);
            }

            var isUsed = default(bool);
            env.AttributeHelper.GetValueFromField(assemblyDef, typeDef, fieldDef, env.AttributeHelper.UsedAttributeRef, env.AttributeHelper.TheIsUsedProperty, true, false, ref isUsed);
            if (isUsed)
            {
                return(true);
            }

            return(false);
        }
Exemple #2
0
 public abstract bool FieldAlwaysUsed(AssemblyDef assemblyDef, TypeDef typeDef, FieldDef fieldDef);
Exemple #3
0
 public string ResolveFieldDefToSlot(CST.AssemblyDef assemblyDef, CST.TypeDef typeDef, CST.FieldDef fieldDef)
 {
     return(TypeMappingFor(assemblyDef, typeDef).ResolveFieldToSlot
                (fieldDef.QualifiedMemberName(env.Global, assemblyDef, typeDef)));
 }