Merge pull request #901 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mcs / class / dlr / Runtime / Microsoft.Scripting / Runtime / ParamDictionaryAttribute.cs
1 /* ****************************************************************************
2  *
3  * Copyright (c) Microsoft Corporation. 
4  *
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.
10  *
11  * You must not remove this notice, or any other, from this software.
12  *
13  *
14  * ***************************************************************************/
15
16 using System;
17
18 namespace Microsoft.Scripting {
19     /// <summary>
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.
23     /// 
24     /// Most languages which support params dictionaries will support the following types:
25     ///     IDictionary&lt;string, anything&gt;
26     ///     IDictionary&lt;object, anything&gt;
27     ///     Dictionary&lt;string, anything&gt;
28     ///     Dictionary&lt;object, anything&gt;
29     ///     IDictionary
30     ///     IAttributesCollection (deprecated)
31     /// 
32     /// For languages which don't have language level support the user will be required to
33     /// create and populate the dictionary by hand.
34     /// 
35     /// This attribute is the dictionary equivalent of the System.ParamArrayAttribute.
36     /// </summary>
37     /// <example>
38     /// public static void KeywordArgFunction([ParamsDictionary]IDictionary&lt;string, object&gt; dict) {
39     ///     foreach (var v in dict) {
40     ///         Console.WriteLine("Key: {0} Value: {1}", v.Key, v.Value);
41     ///     }
42     /// }
43     /// 
44     /// Called from Python:
45     /// 
46     /// KeywordArgFunction(a = 2, b = "abc")
47     /// 
48     /// will print:
49     ///     Key: a Value = 2
50     ///     Key: b Value = abc
51     /// </example>
52     [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
53     public sealed class ParamDictionaryAttribute : Attribute {
54     }
55 }