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))); }
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); }
internal NamedAttributeValueWithMonoCecil(AssemblyWithMonoCecil assembly, CustomAttributeNamedArgument attributeValue) { this.attributeValue = attributeValue; value = ConstantExpressionFactory.CreateExpression(assembly, attributeValue.Argument.Value); }