2020-03-24 11:08:37 -07:00
|
|
|
// Copyright (c) Microsoft Corporation.
|
2018-02-13 09:23:53 -08:00
|
|
|
// Licensed under the MIT License.
|
2016-07-29 13:02:49 -07:00
|
|
|
|
2016-03-30 14:20:52 -07:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace System.Management.Automation
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This class holds the data for missing mandatory parameters for each parameter set as we
|
2019-01-06 04:40:24 +05:00
|
|
|
/// are trying to process which parameter set to use based on the missing mandatory parameters.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
|
|
|
|
internal class ParameterSetPromptingData
|
|
|
|
|
{
|
|
|
|
|
internal ParameterSetPromptingData(uint parameterSet, bool isDefaultSet)
|
|
|
|
|
{
|
2016-08-02 13:29:09 -07:00
|
|
|
ParameterSet = parameterSet;
|
|
|
|
|
IsDefaultSet = isDefaultSet;
|
2016-03-30 14:20:52 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2019-01-06 04:40:24 +05:00
|
|
|
/// True if this parameter set represents the default parameter set.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
2016-08-02 13:29:09 -07:00
|
|
|
internal bool IsDefaultSet { get; }
|
2016-03-30 14:20:52 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
2019-01-06 04:40:24 +05:00
|
|
|
/// The parameter set this data represents.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
2016-08-02 13:29:09 -07:00
|
|
|
internal uint ParameterSet { get; } = 0;
|
2016-03-30 14:20:52 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
2019-01-06 04:40:24 +05:00
|
|
|
/// True if the parameter set represents parameters in all the parameter sets.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
|
|
|
|
internal bool IsAllSet
|
|
|
|
|
{
|
2016-08-02 13:29:09 -07:00
|
|
|
get { return ParameterSet == uint.MaxValue; }
|
2016-03-30 14:20:52 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2019-01-06 04:40:24 +05:00
|
|
|
/// Gets the parameters that take pipeline input and are mandatory in this parameter set.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
|
|
|
|
internal Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> PipelineableMandatoryParameters
|
2016-08-02 13:29:09 -07:00
|
|
|
{ get; } = new Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata>();
|
2016-03-30 14:20:52 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
2019-01-06 04:40:24 +05:00
|
|
|
/// Gets the parameters that take pipeline input by value, and are mandatory in this parameter set.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
|
|
|
|
internal Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> PipelineableMandatoryByValueParameters
|
2016-08-02 13:29:09 -07:00
|
|
|
{ get; } = new Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata>();
|
2016-03-30 14:20:52 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
2019-01-06 04:40:24 +05:00
|
|
|
/// Gets the parameters that take pipeline input by property name, and are mandatory in this parameter set.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
|
|
|
|
internal Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> PipelineableMandatoryByPropertyNameParameters
|
2016-08-02 13:29:09 -07:00
|
|
|
{ get; } = new Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata>();
|
2016-03-30 14:20:52 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
2019-01-06 04:40:24 +05:00
|
|
|
/// Gets the parameters that do not take pipeline input and are mandatory in this parameter set.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
|
|
|
|
internal Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> NonpipelineableMandatoryParameters
|
2016-08-02 13:29:09 -07:00
|
|
|
{ get; } = new Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata>();
|
2016-03-30 14:20:52 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|