Example #1
0
 internal ConstantGroupWithReflection(ITypeWithReflection declaringType, FieldInfo field)
 {
     this.declaringType = declaringType;
     this.field         = field;
     attributes         = new Lazy <Attributes>(() => new Attributes(field));
     fieldType          = TypeReferenceWithReflectionFactory.CreateReference(field.FieldType, field);
     constantValue      = new Lazy <IConstantExpressionWithReflection>(
         () => ConstantExpressionFactory.CreateExpression(field.GetValue(null)));
 }
Example #2
0
        internal ConstantGroupWithMonoCecil(ITypeWithMonoCecil declaringType, FieldDefinition field)
        {
            this.declaringType = declaringType;
            this.field         = field;
            AssemblyWithMonoCecil assembly = declaringType.Assembly;

            attributes    = new Lazy <Attributes>(() => new Attributes(assembly, field));
            fieldType     = TypeReferenceWithMonoCecilFactory.CreateReference(assembly, field.FieldType, field);
            ConstantValue = ConstantExpressionFactory.CreateExpression(assembly, field.Constant);
        }
 internal NamedAttributeValueWithReflection(CustomAttributeNamedArgument attributeValue)
 {
     this.attributeValue = attributeValue;
     value = ConstantExpressionFactory.CreateExpression(attributeValue.TypedValue.Value);
 }
Example #4
0
 internal NamedAttributeValueWithMonoCecil(AssemblyWithMonoCecil assembly, CustomAttributeNamedArgument attributeValue)
 {
     this.attributeValue = attributeValue;
     value = ConstantExpressionFactory.CreateExpression(assembly, attributeValue.Argument.Value);
 }