Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/System.Management.Automation/engine/CommandProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ internal CommandProcessor(IScriptCommandInfo scriptCommandInfo, ExecutionContext
Init(scriptCommandInfo);
}

// CommandProcessor

#endregion ctor

#region internal members
Expand Down
36 changes: 17 additions & 19 deletions src/System.Management.Automation/engine/CommandProcessorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal CommandProcessorBase()
}

/// <summary>
/// Initializes the base command processor class with the command metadata
/// Initializes the base command processor class with the command metadata.
/// </summary>
/// <param name="commandInfo">
/// The metadata about the command to run.
Expand Down Expand Up @@ -64,12 +64,12 @@ internal CommandProcessorBase(CommandInfo commandInfo)

private InternalCommand _command;

// marker of whether BeginProcessing() has already run,
// also used by CommandProcessor
// Marker of whether BeginProcessing() has already run,
// also used by CommandProcessor.
internal bool RanBeginAlready;

// marker of whether this command has already been added to
// a PipelineProcessor. It is an error to add the same command
// Marker of whether this command has already been added to
// a PipelineProcessor. It is an error to add the same command
// more than once.
internal bool AddedToPipelineAlready
{
Expand Down Expand Up @@ -107,9 +107,8 @@ internal bool AddedToPipelineAlready
/// <summary>
/// If this flag is true, the commands in this Pipeline will redirect
/// the global error output pipe to the command's error output pipe.
///
/// (see the comment in Pipeline.RedirectShellErrorOutputPipe for an
/// explanation of why this flag is needed)
/// (See the comment in Pipeline.RedirectShellErrorOutputPipe for an
/// explanation of why this flag is needed).
/// </summary>
internal bool RedirectShellErrorOutputPipe { get; set; } = false;

Expand Down Expand Up @@ -176,7 +175,8 @@ internal bool UseLocalScope
/// <param name="scriptBlock">The script block being dotted</param>
/// <param name="languageMode">The current language mode</param>
/// <param name="invocationInfo">The invocation info about the command</param>
protected static void ValidateCompatibleLanguageMode(ScriptBlock scriptBlock,
protected static void ValidateCompatibleLanguageMode(
ScriptBlock scriptBlock,
PSLanguageMode languageMode,
InvocationInfo invocationInfo)
{
Expand Down Expand Up @@ -228,7 +228,7 @@ internal ExecutionContext Context
}

/// <summary>
/// Etw activity for this pipeline
/// Etw activity for this pipeline.
/// </summary>
internal Guid PipelineActivityId { get; set; } = Guid.Empty;

Expand All @@ -255,7 +255,7 @@ internal virtual bool IsHelpRequested(out string helpTarget, out HelpCategory he
}

/// <summary>
/// Creates a command processor for "get-help [helpTarget]"
/// Creates a command processor for "get-help [helpTarget]".
/// </summary>
/// <param name="context">context for the command processor</param>
/// <param name="helpTarget">help target</param>
Expand Down Expand Up @@ -307,7 +307,7 @@ internal bool IsPipelineInputExpected()
internal SessionStateInternal CommandSessionState { get; set; }

/// <summary>
/// Gets sets the session state scope for this command processor object
/// Gets or sets the session state scope for this command processor object.
/// </summary>
protected internal SessionStateScope CommandScope { get; protected set; }

Expand Down Expand Up @@ -392,7 +392,7 @@ internal void AddParameter(CommandParameterInternal parameter)
internal abstract void Prepare(IDictionary psDefaultParameterValues);

/// <summary>
/// Write warning message for an obsolete command
/// Write warning message for an obsolete command.
/// </summary>
/// <param name="obsoleteAttr"></param>
private void HandleObsoleteCommand(ObsoleteAttribute obsoleteAttr)
Expand Down Expand Up @@ -560,7 +560,7 @@ internal void DoExecute()
/// Internally it calls EndProcessing() of the InternalCommand.
/// </summary>
/// <exception cref="PipelineStoppedException">
/// a terminating error occurred, or the pipeline was otherwise stopped
/// A terminating error occurred, or the pipeline was otherwise stopped.
/// </exception>
internal virtual void Complete()
{
Expand Down Expand Up @@ -589,7 +589,7 @@ internal virtual void Complete()
} // Complete

/// <summary>
/// Calls the virtual Complete method after setting the appropriate session state scope
/// Calls the virtual Complete method after setting the appropriate session state scope.
/// </summary>
internal void DoComplete()
{
Expand Down Expand Up @@ -652,9 +652,8 @@ internal void DoComplete()
}

/// <summary>
/// for diagnostic purposes
/// For diagnostic purposes.
/// </summary>
/// <returns></returns>
public override string ToString()
{
if (CommandInfo != null)
Expand Down Expand Up @@ -942,7 +941,7 @@ private void Dispose(bool disposing)
}

/// <summary>
/// Finalizer for class CommandProcessorBase
/// Finalizer for class CommandProcessorBase.
/// </summary>
~CommandProcessorBase()
{
Expand All @@ -952,4 +951,3 @@ private void Dispose(bool disposing)
#endregion IDispose
}
}

49 changes: 23 additions & 26 deletions src/System.Management.Automation/engine/CompiledCommandParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@
namespace System.Management.Automation
{
/// <summary>
/// The metadata associated with a parameter
/// The metadata associated with a parameter.
/// </summary>
internal class CompiledCommandParameter
{
#region ctor

/// <summary>
/// Constructs an instance of the CompiledCommandAttribute using the specified
/// runtime-defined parameter
/// runtime-defined parameter.
/// </summary>
/// <param name="runtimeDefinedParameter">
/// A runtime defined parameter that contains the definition of the parameter and its
/// metadata.
/// A runtime defined parameter that contains the definition of the parameter and its metadata.
/// </param>
/// <param name="processingDynamicParameters">
/// True if dynamic parameters are being processed, or false otherwise.
Expand Down Expand Up @@ -197,7 +196,7 @@ internal CompiledCommandParameter(MemberInfo member, bool processingDynamicParam
internal string Name { get; private set; }

/// <summary>
/// The PSTypeName from a PSTypeNameAttribute
/// The PSTypeName from a PSTypeNameAttribute.
/// </summary>
internal string PSTypeName { get; private set; }

Expand All @@ -217,7 +216,7 @@ internal CompiledCommandParameter(MemberInfo member, bool processingDynamicParam
internal bool IsDynamic { get; private set; }

/// <summary>
/// Gets the parameter collection type information
/// Gets the parameter collection type information.
/// </summary>
internal ParameterCollectionTypeInformation CollectionTypeInformation { get; private set; }

Expand All @@ -228,46 +227,46 @@ internal CompiledCommandParameter(MemberInfo member, bool processingDynamicParam
internal Collection<Attribute> CompiledAttributes { get; private set; }

/// <summary>
/// Gets the collection of data generation attributes on this parameter
/// Gets the collection of data generation attributes on this parameter.
/// </summary>
internal ArgumentTransformationAttribute[] ArgumentTransformationAttributes { get; private set; }

/// <summary>
/// Gets the collection of data validation attributes on this parameter
/// Gets the collection of data validation attributes on this parameter.
/// </summary>
internal ValidateArgumentsAttribute[] ValidationAttributes { get; private set; }

/// <summary>
/// Get and private set the obsolete attribute on this parameter
/// Get and private set the obsolete attribute on this parameter.
/// </summary>
internal ObsoleteAttribute ObsoleteAttribute { get; private set; }

/// <summary>
/// If true, null can be bound to the parameter even if the parameter is mandatory
/// If true, null can be bound to the parameter even if the parameter is mandatory.
/// </summary>
internal bool AllowsNullArgument { get; private set; }

/// <summary>
/// If true, null cannot be bound to the parameter (ValidateNotNull
/// and/or ValidateNotNullOrEmpty has been specified)
/// and/or ValidateNotNullOrEmpty has been specified).
/// </summary>
internal bool CannotBeNull { get; private set; }

/// <summary>
/// If true, an empty string can be bound to the string parameter
/// even if the parameter is mandatory
/// even if the parameter is mandatory.
/// </summary>
internal bool AllowsEmptyStringArgument { get; private set; }

/// <summary>
/// If true, an empty collection can be bound to the collection/array parameter
/// even if the parameter is mandatory
/// even if the parameter is mandatory.
/// </summary>
internal bool AllowsEmptyCollectionArgument { get; private set; }

/// <summary>
/// Gets or sets the value that tells whether this parameter
/// is for the "all" parameter set
/// is for the "all" parameter set.
/// </summary>
internal bool IsInAllSets { get; set; }

Expand Down Expand Up @@ -298,12 +297,12 @@ internal CompiledCommandParameter(MemberInfo member, bool processingDynamicParam
internal Action<object, object> Setter { get; set; }

/// <summary>
/// A dictionary of the parameter sets and the parameter set specific data for this parameter
/// A dictionary of the parameter sets and the parameter set specific data for this parameter.
/// </summary>
internal Dictionary<string, ParameterSetSpecificMetadata> ParameterSetData { get; private set; }

/// <summary>
/// The alias names for this parameter
/// The alias names for this parameter.
/// </summary>
internal string[] Aliases { get; private set; }

Expand Down Expand Up @@ -342,7 +341,7 @@ internal bool DoesParameterSetTakePipelineInput(uint validParameterSetFlags)
}

return false;
} // DoesParameterSetTakePipelineInput
}

/// <summary>
/// Gets the parameter set data for this parameter for the specified parameter set
Expand Down Expand Up @@ -379,7 +378,7 @@ internal ParameterSetSpecificMetadata GetParameterSetData(uint parameterSetFlag)
}

/// <summary>
/// Gets the parameter set data for this parameter for the specified parameter sets
/// Gets the parameter set data for this parameter for the specified parameter sets.
/// </summary>
/// <param name="parameterSetFlags">
/// The parameter sets to get the parameter set data for.
Expand Down Expand Up @@ -429,10 +428,9 @@ private void ProcessAttribute(
return;

CompiledAttributes.Add(attribute);
// Now process the attribute based on it's type

ParameterAttribute paramAttr = attribute as ParameterAttribute;
if (paramAttr != null)
// Now process the attribute based on it's type
if (attribute is ParameterAttribute paramAttr)
{
ProcessParameterAttribute(memberName, paramAttr);
return;
Expand Down Expand Up @@ -579,7 +577,7 @@ internal enum ParameterCollectionType
}

/// <summary>
/// Contains the collection type information for a parameter
/// Contains the collection type information for a parameter.
/// </summary>
internal class ParameterCollectionTypeInformation
{
Expand Down Expand Up @@ -668,17 +666,16 @@ internal ParameterCollectionTypeInformation(Type type)
// elementType remains null
return;
}
} // ctor
}

/// <summary>
/// The collection type of the parameter
/// The collection type of the parameter.
/// </summary>
internal ParameterCollectionType ParameterCollectionType { get; private set; }

/// <summary>
/// The type of the elements in the collection
/// The type of the elements in the collection.
/// </summary>
internal Type ElementType { get; private set; }
}
}

Loading