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