Esempio n. 1
0
        public Argument(
            ArgumentDefinition definition)
            : base(definition)
        {
            SyntaxNode   = definition.SyntaxNode;
            DefaultValue = definition.DefaultValue;

            if (definition.Formatters.Count == 0)
            {
                Formatter = null;
            }
            else if (definition.Formatters.Count == 1)
            {
                Formatter = definition.Formatters[0];
            }
            else
            {
                Formatter = new AggregateInputValueFormatter(definition.Formatters);
            }
        }
Esempio n. 2
0
        public Argument(ArgumentDefinition definition, int index)
            : base(definition, index)
        {
            DefaultValue = definition.DefaultValue;

            IReadOnlyList <IInputValueFormatter> formatters = definition.GetFormatters();

            if (formatters.Count == 0)
            {
                Formatter = null;
            }
            else if (formatters.Count == 1)
            {
                Formatter = formatters[0];
            }
            else
            {
                Formatter = new AggregateInputValueFormatter(formatters);
            }
        }
Esempio n. 3
0
        public Argument(
            ArgumentDefinition definition,
            FieldCoordinate fieldCoordinate)
            : base(definition, fieldCoordinate)
        {
            SyntaxNode   = definition.SyntaxNode;
            DefaultValue = definition.DefaultValue;

            var formatters = definition.GetFormatters();

            if (formatters.Count == 0)
            {
                Formatter = null;
            }
            else if (formatters.Count == 1)
            {
                Formatter = formatters[0];
            }
            else
            {
                Formatter = new AggregateInputValueFormatter(formatters);
            }
        }
Esempio n. 4
0
        public InputField(InputFieldDefinition definition, FieldCoordinate fieldCoordinate)
            : base(definition, fieldCoordinate)
        {
            SyntaxNode   = definition.SyntaxNode;
            DefaultValue = definition.DefaultValue;
            Property     = definition.Property;

            if (definition.Formatters.Count == 0)
            {
                Formatter = null;
            }
            else if (definition.Formatters.Count == 1)
            {
                Formatter = definition.Formatters[0];
            }
            else
            {
                Formatter = new AggregateInputValueFormatter(definition.Formatters);
            }

            Type?propertyType = definition.Property?.PropertyType;

            if (propertyType is { IsGenericType : true } &&