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-03-30 14:20:52 -07:00
|
|
|
|
2019-04-24 19:27:22 +05:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
|
2016-03-30 14:20:52 -07:00
|
|
|
namespace Microsoft.PowerShell.Cmdletization
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Collection of method parameters and their arguments
|
|
|
|
|
/// used to invoke a method in an object model wrapped by <see cref="CmdletAdapter<TObjectInstance>"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal sealed class MethodParametersCollection : KeyedCollection<string, MethodParameter>
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2019-01-06 04:40:24 +05:00
|
|
|
/// Creates an empty collection of method parameters.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
|
|
|
|
public MethodParametersCollection()
|
|
|
|
|
: base(StringComparer.Ordinal, 5)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2019-01-06 04:40:24 +05:00
|
|
|
/// Gets key for a method parameter.
|
2016-03-30 14:20:52 -07:00
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
protected override string GetKeyForItem(MethodParameter item)
|
|
|
|
|
{
|
|
|
|
|
return item.Name;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|