PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

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

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