35 references to ParameterType
Microsoft.TemplateEngine.Cli (35)
ChoiceTemplateParameter.cs (3)
25throw new ArgumentException($"{nameof(parameter)} should have {nameof(parameter.Type)} {nameof(ParameterType.Choice)}"); 40internal override ParameterType Type => ParameterType.Choice;
CliTemplateParameter.cs (29)
43if (Type == ParameterType.Boolean && string.Equals(parameter.DefaultIfOptionWithoutValue, "true", StringComparison.OrdinalIgnoreCase)) 76ParameterType type = ParameterType.String, 116internal virtual ParameterType Type { get; private set; } 150|| (Type == ParameterType.String || Type == ParameterType.Choice) && DefaultValue != null) 161if (Type == ParameterType.Hex) 211ParameterType.Boolean => new Option<bool>(name) 215ParameterType.Integer => new Option<long>(name) 220ParameterType.String => new Option<string>(name) 225ParameterType.Float => new Option<double>(name) 230ParameterType.Hex => new Option<long>(name) 235_ => throw new Exception($"Unexpected value for {nameof(ParameterType)}: {Type}.") 285private static string ParameterTypeToString(ParameterType dataType) 289ParameterType.Boolean => "bool", 290ParameterType.Choice => "choice", 291ParameterType.Float => "float", 292ParameterType.Hex => "hex", 293ParameterType.Integer => "integer", 298private static ParameterType ParseType(string dataType) 302"bool" => ParameterType.Boolean, 303"boolean" => ParameterType.Boolean, 304"choice" => ParameterType.Choice, 305"float" => ParameterType.Float, 306"int" => ParameterType.Integer, 307"integer" => ParameterType.Integer, 308"hex" => ParameterType.Hex, 309_ => ParameterType.String 507if (Type == ParameterType.Boolean)
Commands\create\CombinedChoiceTemplateParameter.cs (2)
32if (parameter.Type != ParameterType.Choice) 34throw new ArgumentException($"{nameof(parameter)} should have {nameof(parameter.Type)} {nameof(ParameterType.Choice)}");
Commands\create\TemplateCommandArgs.cs (1)
118if (parameter.Type == ParameterType.Hex && optionResult.Option is Option<long>)