public OptionSet Add (ArgumentSource source) { if (source == null) throw new ArgumentNullException (nameof(source)); sources.Add (source); return this; }
public IntegerArgumentAttribute(string argumentName, ArgumentSource argumentSource) : base(argumentName, argumentSource) { this.DefaultValue = 0; this.Min = 0; this.Max = int.MaxValue; }
// ---------------- Constructor ---------------- protected BaseAttribute(string argumentName, ArgumentSource argumentSource) { this.ArgName = argumentName; this.ArgumentSource = argumentSource; this.Description = string.Empty; this.Required = false; this.HasSecretValue = false; }
public OptionSet Add(ArgumentSource source) { if (source == null) { throw new ArgumentNullException("source"); } sources.Add(source); return(this); }
public override bool GetArguments (string value, out IEnumerable<string> replacement) { if (string.IsNullOrEmpty (value) || !value.StartsWith ("@")) { replacement = null; return false; } replacement = ArgumentSource.GetArgumentsFromFile (value.Substring (1)); return true; }
public EnumArgumentAttribute(Type enumType, string argumentName, ArgumentSource argumentSource) : base(argumentName, argumentSource) { if (enumType.IsEnum == false) { throw new ArgumentException( "Passed in type is not an Enum", nameof(enumType) ); } this.enumType = enumType; this.IgnoreCase = false; this.DefaultValue = (Enum)Activator.CreateInstance(enumType); }
static string[] Parse(string source, int max) { string[] values = new string [max]; int i = 0; foreach (string s in ArgumentSource.GetArguments(new StringReader(source))) { if (i < (values.Length - 1)) { values [i++] = s; } else { values [i] = values [i] == null ? s : values [i] + " " + s; } } return(values); }
public static void Print(IVMBindingContext context, ArgumentSource args) { Console.WriteLine("monctest:" + context.GetString(args.GetArgument(0))); }
/// <summary> /// Initializes a new instance with the specified values. /// </summary> public ArgumentValue(object?value, ArgumentSource source) { Value = value; Source = source; }
// ---------------- Constructor ---------------- protected BasePathAttribute(string argumentName, ArgumentSource argumentSource) : base(argumentName, argumentSource) { this.DefaultValue = null; this.MustExist = false; }
public static ImmutableList <string> GetArgumentList(string args) { using (var tr = new StringReader(args)) return(ArgumentSource.GetArguments(tr).ToImmutableList()); }
private static void NoOpBinding(IVMBindingContext context, ArgumentSource args) { }
public FilePathArgumentAttribute(string argumentName, ArgumentSource argumentSource) : base(argumentName, argumentSource) { }
public StringArgumentAttribute(string argumentName, ArgumentSource argumentSource) : base(argumentName, argumentSource) { this.DefaultValue = string.Empty; }
public BooleanArgumentAttribute(string argumentName, ArgumentSource argumentSource) : base(argumentName, argumentSource) { this.DefaultValue = false; }
public DirectoryPathArgumentAttribute(string argumentName, ArgumentSource argumentSource) : base(argumentName, argumentSource) { }