public bool ParseArgument(string value, out object result) { return(ConsoleCommandsParametersHelper.ParseArgument( value, this.parameterInfo.ParameterInfo.ParameterType, out result)); }
public IEnumerable <string> GetSuggestions(string startsWith) { if (this.customSuggestionsAttribute is not null) { return(this.customSuggestionsAttribute .GetSuggestions(this.parameterInfo.ParameterInfo.Member.DeclaringType, startsWith)); } return(ConsoleCommandsParametersHelper.GetSuggestions( startsWith, this.parameterInfo.ParameterInfo.ParameterType)); }
private string CreateName() { var info = this.parameterInfo.ParameterInfo; var isOptional = this.hasCurrentCharacterAttribute || info.HasDefaultValue; var stringBuilder = new StringBuilder(255); stringBuilder.Append(isOptional ? '[' : '<'); stringBuilder.Append( ConsoleCommandsParametersHelper.GetParameterDescription( info.ParameterType, info.Name)); stringBuilder.Append(isOptional ? ']' : '>'); return(stringBuilder.ToString()); }
protected override void PrepareProto() { base.PrepareProto(); ConsoleCommandsParametersHelper.Register(this); }