mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-24 04:02:50 +08:00
Fix typo in PairDeconstructor class name
PairDeconstuctor → PairDeconstructor (was missing an 'r') Keeping `PairDeconstuctor` and marking it as obsolete since it's a public type.
This commit is contained in:
parent
48df9cf68b
commit
19eb273813
@ -28,7 +28,7 @@ namespace Spectre.Console.Cli
|
|||||||
Type parameterType, ParameterKind parameterKind, PropertyInfo property,
|
Type parameterType, ParameterKind parameterKind, PropertyInfo property,
|
||||||
string? description, TypeConverterAttribute? converter,
|
string? description, TypeConverterAttribute? converter,
|
||||||
DefaultValueAttribute? defaultValue,
|
DefaultValueAttribute? defaultValue,
|
||||||
PairDeconstructorAttribute? deconstuctor,
|
PairDeconstructorAttribute? deconstructor,
|
||||||
ParameterValueProviderAttribute? valueProvider,
|
ParameterValueProviderAttribute? valueProvider,
|
||||||
IEnumerable<ParameterValidationAttribute> validators, bool required)
|
IEnumerable<ParameterValidationAttribute> validators, bool required)
|
||||||
{
|
{
|
||||||
@ -39,7 +39,7 @@ namespace Spectre.Console.Cli
|
|||||||
Description = description;
|
Description = description;
|
||||||
Converter = converter;
|
Converter = converter;
|
||||||
DefaultValue = defaultValue;
|
DefaultValue = defaultValue;
|
||||||
PairDeconstructor = deconstuctor;
|
PairDeconstructor = deconstructor;
|
||||||
ValueProvider = valueProvider;
|
ValueProvider = valueProvider;
|
||||||
Validators = new List<ParameterValidationAttribute>(validators ?? Array.Empty<ParameterValidationAttribute>());
|
Validators = new List<ParameterValidationAttribute>(validators ?? Array.Empty<ParameterValidationAttribute>());
|
||||||
Required = required;
|
Required = required;
|
||||||
|
@ -7,7 +7,7 @@ namespace Spectre.Console.Cli
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="TKey">The key type.</typeparam>
|
/// <typeparam name="TKey">The key type.</typeparam>
|
||||||
/// <typeparam name="TValue">The value type.</typeparam>
|
/// <typeparam name="TValue">The value type.</typeparam>
|
||||||
public abstract class PairDeconstuctor<TKey, TValue> : IPairDeconstructor
|
public abstract class PairDeconstructor<TKey, TValue> : IPairDeconstructor
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deconstructs the provided <see cref="string"/> into a pair.
|
/// Deconstructs the provided <see cref="string"/> into a pair.
|
||||||
@ -27,4 +27,15 @@ namespace Spectre.Console.Cli
|
|||||||
return Deconstruct(value);
|
return Deconstruct(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Base class for a pair deconstructor.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TKey">The key type.</typeparam>
|
||||||
|
/// <typeparam name="TValue">The value type.</typeparam>
|
||||||
|
/// <remarks>This class is misspelled, use <see cref="PairDeconstructor{TKey,TValue}"/> instead.</remarks>
|
||||||
|
[Obsolete("Use PairDeconstructor instead")]
|
||||||
|
public abstract class PairDeconstuctor<TKey, TValue> : PairDeconstructor<TKey, TValue>
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
@ -56,7 +56,7 @@ namespace Spectre.Console.Tests.Unit.Cli
|
|||||||
public IReadOnlyDictionary<string, string> Values { get; set; }
|
public IReadOnlyDictionary<string, string> Values { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class StringIntDeconstructor : PairDeconstuctor<string, string>
|
public sealed class StringIntDeconstructor : PairDeconstructor<string, string>
|
||||||
{
|
{
|
||||||
protected override (string Key, string Value) Deconstruct(string value)
|
protected override (string Key, string Value) Deconstruct(string value)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user