2016-03-30 14:20:52 -07:00
|
|
|
/********************************************************************++
|
|
|
|
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
--********************************************************************/
|
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
|
|
|
|
|
/// are trying to process which parameter set to use based on the missing mandatory parameters
|
|
|
|
|
/// </summary>
|
|
|
|
|
///
|
|
|
|
|
internal class ParameterSetPromptingData
|
|
|
|
|
{
|
|
|
|
|
internal ParameterSetPromptingData(uint parameterSet, bool isDefaultSet)
|
|
|
|
|
{
|
2016-07-29 13:02:49 -07:00
|
|
|
_parameterSet = parameterSet;
|
|
|
|
|
_isDefaultSet = isDefaultSet;
|
2016-03-30 14:20:52 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// True if this parameter set represents the default parameter set
|
|
|
|
|
/// </summary>
|
|
|
|
|
///
|
|
|
|
|
internal bool IsDefaultSet
|
|
|
|
|
{
|
2016-07-29 13:02:49 -07:00
|
|
|
get { return _isDefaultSet; }
|
2016-03-30 14:20:52 -07:00
|
|
|
}
|
2016-07-29 13:02:49 -07:00
|
|
|
private bool _isDefaultSet;
|
2016-03-30 14:20:52 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The parameter set this data represents
|
|
|
|
|
/// </summary>
|
|
|
|
|
///
|
|
|
|
|
internal uint ParameterSet
|
|
|
|
|
{
|
2016-07-29 13:02:49 -07:00
|
|
|
get { return _parameterSet; }
|
2016-03-30 14:20:52 -07:00
|
|
|
}
|
2016-07-29 13:02:49 -07:00
|
|
|
private uint _parameterSet = 0;
|
2016-03-30 14:20:52 -07:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// True if the parameter set represents parameters in all the parameter sets
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal bool IsAllSet
|
|
|
|
|
{
|
2016-07-29 13:02:49 -07:00
|
|
|
get { return _parameterSet == uint.MaxValue; }
|
2016-03-30 14:20:52 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the parameters that take pipeline input and are mandatory in this parameter set
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> PipelineableMandatoryParameters
|
|
|
|
|
{
|
2016-07-29 13:02:49 -07:00
|
|
|
get { return _pipelineableMandatoryParameters; }
|
2016-03-30 14:20:52 -07:00
|
|
|
}
|
2016-07-29 13:02:49 -07:00
|
|
|
private Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> _pipelineableMandatoryParameters =
|
2016-03-30 14:20:52 -07:00
|
|
|
new Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the parameters that take pipeline input by value, and are mandatory in this parameter set
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> PipelineableMandatoryByValueParameters
|
|
|
|
|
{
|
2016-07-29 13:02:49 -07:00
|
|
|
get { return _pipelineableMandatoryByValueParameters; }
|
2016-03-30 14:20:52 -07:00
|
|
|
}
|
2016-07-29 13:02:49 -07:00
|
|
|
private Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> _pipelineableMandatoryByValueParameters =
|
2016-03-30 14:20:52 -07:00
|
|
|
new Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata>();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the parameters that take pipeline input by property name, and are mandatory in this parameter set
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> PipelineableMandatoryByPropertyNameParameters
|
|
|
|
|
{
|
2016-07-29 13:02:49 -07:00
|
|
|
get { return _pipelineableMandatoryByPropertyNameParameters; }
|
2016-03-30 14:20:52 -07:00
|
|
|
}
|
2016-07-29 13:02:49 -07:00
|
|
|
private Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> _pipelineableMandatoryByPropertyNameParameters =
|
2016-03-30 14:20:52 -07:00
|
|
|
new Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the parameters that do not take pipeline input and are mandatory in this parameter set
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> NonpipelineableMandatoryParameters
|
|
|
|
|
{
|
2016-07-29 13:02:49 -07:00
|
|
|
get { return _nonpipelineableMandatoryParameters; }
|
2016-03-30 14:20:52 -07:00
|
|
|
}
|
2016-07-29 13:02:49 -07:00
|
|
|
private Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata> _nonpipelineableMandatoryParameters =
|
2016-03-30 14:20:52 -07:00
|
|
|
new Dictionary<MergedCompiledCommandParameter, ParameterSetSpecificMetadata>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|