1 /* ****************************************************************************
3 * Copyright (c) Microsoft Corporation.
5 * This source code is subject to terms and conditions of the Apache License, Version 2.0. A
6 * copy of the license can be found in the License.html file at the root of this distribution. If
7 * you cannot locate the Apache License, Version 2.0, please send an email to
8 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
9 * by the terms of the Apache License, Version 2.0.
11 * You must not remove this notice, or any other, from this software.
14 * ***************************************************************************/
18 namespace Microsoft.Scripting {
20 /// This attribute is used to mark a parameter that can accept any keyword parameters that
21 /// are not bound to normal arguments. The extra keyword parameters will be
22 /// passed in a dictionary which is created for the call.
24 /// Most languages which support params dictionaries will support the following types:
25 /// IDictionary<string, anything>
26 /// IDictionary<object, anything>
27 /// Dictionary<string, anything>
28 /// Dictionary<object, anything>
30 /// IAttributesCollection (deprecated)
32 /// For languages which don't have language level support the user will be required to
33 /// create and populate the dictionary by hand.
35 /// This attribute is the dictionary equivalent of the System.ParamArrayAttribute.
38 /// public static void KeywordArgFunction([ParamsDictionary]IDictionary<string, object> dict) {
39 /// foreach (var v in dict) {
40 /// Console.WriteLine("Key: {0} Value: {1}", v.Key, v.Value);
44 /// Called from Python:
46 /// KeywordArgFunction(a = 2, b = "abc")
50 /// Key: b Value = abc
52 [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
53 public sealed class ParamDictionaryAttribute : Attribute {