PageRenderTime 18ms CodeModel.GetById 9ms app.highlight 5ms RepoModel.GetById 0ms app.codeStats 1ms

/IronPython_Main/Runtime/Microsoft.Scripting/Hosting/OverloadDoc.cs

#
C# | 86 lines | 46 code | 11 blank | 29 comment | 0 complexity | 1b60ff593f2bf6321fef98402cd5f096 MD5 | raw file
 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
16using System;
17using System.Collections.Generic;
18using Microsoft.Scripting.Utils;
19
20namespace Microsoft.Scripting.Hosting {
21    /// <summary>
22    /// Provides documentation for a single overload of an invokable object.
23    /// </summary>
24    [Serializable]
25    public class OverloadDoc {
26        private readonly string _name, _doc;
27        private readonly ICollection<ParameterDoc> _params;
28        private readonly ParameterDoc _returnParam;        
29
30        public OverloadDoc(string name, string documentation, ICollection<ParameterDoc> parameters) {
31            ContractUtils.RequiresNotNull(name, "name");
32            ContractUtils.RequiresNotNullItems(parameters, "parameters");
33
34            _name = name;
35            _params = parameters;
36            _doc = documentation;   
37        }
38
39        public OverloadDoc(string name, string documentation, ICollection<ParameterDoc> parameters, ParameterDoc returnParameter) {
40            ContractUtils.RequiresNotNull(name, "name");
41            ContractUtils.RequiresNotNullItems(parameters, "parameters");
42
43            _name = name;
44            _params = parameters;
45            _doc = documentation;
46            _returnParam = returnParameter;
47        }
48
49        /// <summary>
50        /// The name of the invokable object.
51        /// </summary>
52        public string Name {
53            get {
54                return _name;
55            }
56        }
57
58        /// <summary>
59        /// The documentation for the overload or null if no documentation is available.
60        /// </summary>
61        public string Documentation {
62            get {
63                return _doc;
64            }
65        }
66
67        /// <summary>
68        /// The parameters for the invokable object.
69        /// </summary>
70        public ICollection<ParameterDoc> Parameters {
71            get {
72                return _params;
73            }
74        }
75
76        /// <summary>
77        /// Information about the return value.
78        /// </summary>
79        public ParameterDoc ReturnParameter {
80            get {
81                return _returnParam;
82            }
83        }
84    }
85
86}