DirectiveArgumentDescriptor

We found 10 examples in language CSharp for this search. You will see 13 fragments of code.

        public static DirectiveArgumentDescriptor New(
            IDescriptorContext context,
            NameString argumentName) =>
            new DirectiveArgumentDescriptor(context, argumentName);

        public static DirectiveArgumentDescriptor New(
            IDescriptorContext context,
            PropertyInfo property) =>
            new DirectiveArgumentDescriptor(context, property);


    /// <summary>
    /// Creates a new instance of <see cref="DirectiveArgumentDescriptor "/>
    /// </summary>
    /// <param name="context">The descriptor context</param>
    /// <param name="argumentName">The name of the argument</param>
    /// <returns>An instance of <see cref="DirectiveArgumentDescriptor "/></returns>
    public static DirectiveArgumentDescriptor New(
        IDescriptorContext context,
        NameString argumentName)
        => new(context, argumentName);

    /// <summary>
    /// Creates a new instance of <see cref="DirectiveArgumentDescriptor "/>
    /// </summary>
    /// <param name="context">The descriptor context</param>
    /// <param name="property">The property this argument is used for</param>
    /// <returns>An instance of <see cref="DirectiveArgumentDescriptor "/></returns>
    public static DirectiveArgumentDescriptor New(
        IDescriptorContext context,
        PropertyInfo property)
        => new(context, property);

        [Fact]
        public void Type_Syntax_Type_Null()
        {
            void Error() => DirectiveArgumentDescriptor.New(Context, "foo").Type((string)null);
            Assert.Throws<ArgumentNullException>(Error);
        }

        [Fact]
        public void Type_Syntax_Descriptor_Null()
        {
            void Error() => default(DirectiveArgumentDescriptor).Type("foo");
            Assert.Throws<ArgumentNullException>(Error);
        }


    public IDirectiveArgumentDescriptor Argument(NameString name)
    {
        DirectiveArgumentDescriptor descriptor =
            Arguments.FirstOrDefault(t => t.Definition.Name.Equals(name));
        if (descriptor is { })
        {
            return descriptor;
        }

        descriptor = DirectiveArgumentDescriptor.New(
            Context,
            name.EnsureNotEmpty(nameof(name)));
        Arguments.Add(descriptor);
        return descriptor;
    }

namespace Enrollment.Forms.Configuration.Directives
{
    public class DirectiveArgumentDescriptor
    {
        public string Name { get; set; }
        public object Value { get; set; }
        public string Type { get; set; }
    }
}

using System.Collections.Generic;

namespace Enrollment.Forms.Configuration.Directives
{
    public class DirectiveDefinitionDescriptor
    {
        public string ClassName { get; set; }
        public string FunctionName { get; set; }
        public Dictionary<string, DirectiveArgumentDescriptor> Arguments { get; set; }
    }
}

namespace Enrollment.Forms.Configuration.Directives
{
    public class DirectiveArgumentDescriptor
    {
        public string Name { get; set; }
        public object Value { get; set; }
        public string Type { get; set; }
    }
}

namespace Contoso.Forms.Configuration.Directives
{
    public class DirectiveArgumentDescriptor
    {
        public string Name { get; set; }
        public object Value { get; set; }
        public string Type { get; set; }
    }
}

namespace Contoso.Forms.Configuration.Directives
{
    public class DirectiveArgumentDescriptor
    {
        public string Name { get; set; }
        public object Value { get; set; }
        public string Type { get; set; }
    }
}

using System.Collections.Generic;

namespace Enrollment.Forms.Configuration.Directives
{
    public class DirectiveDefinitionDescriptor
    {
        public string ClassName { get; set; }
        public string FunctionName { get; set; }
        public Dictionary<string, DirectiveArgumentDescriptor> Arguments { get; set; }
    }
}

HotChocolate.Types.Descriptors.DirectiveArgumentDescriptor : IDescriptor

Constructors :

public DirectiveArgumentDescriptor(IDescriptorContext context = , NameString argumentName = )
public DirectiveArgumentDescriptor(IDescriptorContext context = , PropertyInfo property = )

Methods :

public IDirectiveArgumentDescriptor SyntaxNode(InputValueDefinitionNode inputValueDefinition = )
public IDirectiveArgumentDescriptor Name(NameString value = )
public IDirectiveArgumentDescriptor Description(String value = )
public IDirectiveArgumentDescriptor Type()
public IDirectiveArgumentDescriptor Type(TInputType inputType = )
public IDirectiveArgumentDescriptor Type(ITypeNode typeNode = )
public IDirectiveArgumentDescriptor Type(Type type = )
public IDirectiveArgumentDescriptor DefaultValue(IValueNode value = )
public IDirectiveArgumentDescriptor DefaultValue(Object value = )
public IDirectiveArgumentDescriptor Ignore(Boolean ignore = )
public static DirectiveArgumentDescriptor New(IDescriptorContext context = , NameString argumentName = )
public static DirectiveArgumentDescriptor New(IDescriptorContext context = , PropertyInfo property = )
public Void Type()
public Void Type(Type type = )
public Void Type(TInputType inputType = )
public Void Type(ITypeNode typeNode = )
public Void DefaultValue(IValueNode value = )
public Void DefaultValue(Object value = )
public Void Directive(TDirective directiveInstance = )
public Void Directive()
public Void Directive(NameString name = , ArgumentNode[] arguments = )
public IDescriptorExtension<DirectiveArgumentDefinition> Extend()
public DirectiveArgumentDefinition CreateDefinition()
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()