Пример #1
0
        protected override MultiValue GetFieldValue(FieldDefinition field)
        {
            switch (field.Name)
            {
            case "EmptyTypes" when field.DeclaringType.IsTypeOf(WellKnownType.System_Type): {
                return(ArrayValue.Create(0, field.DeclaringType));
            }

            case "Empty" when field.DeclaringType.IsTypeOf(WellKnownType.System_String): {
                return(new KnownStringValue(string.Empty));
            }

            default: {
                DynamicallyAccessedMemberTypes memberTypes = _context.Annotations.FlowAnnotations.GetFieldAnnotation(field);
                return(new FieldValue(ResolveToTypeDefinition(field.FieldType), field, memberTypes));
            }
            }
        }