PageRenderTime 52ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/IronPython_Main/Languages/IronPython/IronPython/Runtime/Binding/ContextArgBuilder.cs

#
C# | 52 lines | 28 code | 7 blank | 17 comment | 0 complexity | 8d35e22f378cb08f59ca019c6a3cc45d 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. #if !CLR2
  16. using System.Linq.Expressions;
  17. #else
  18. using Microsoft.Scripting.Ast;
  19. #endif
  20. using System.Collections.Generic;
  21. using System.Diagnostics;
  22. using System.Reflection;
  23. using System;
  24. using System.Dynamic;
  25. using Microsoft.Scripting.Actions.Calls;
  26. using Microsoft.Scripting.Utils;
  27. namespace IronPython.Runtime.Binding {
  28. /// <summary>
  29. /// ArgBuilder which provides the CodeContext parameter to a method.
  30. /// </summary>
  31. public sealed class ContextArgBuilder : ArgBuilder {
  32. public ContextArgBuilder(ParameterInfo info)
  33. : base(info){
  34. }
  35. public override int Priority {
  36. get { return -1; }
  37. }
  38. public override int ConsumedArgumentCount {
  39. get { return 0; }
  40. }
  41. protected override Expression ToExpression(OverloadResolver resolver, RestrictedArguments args, bool[] hasBeenUsed) {
  42. return ((PythonOverloadResolver)resolver).ContextExpression;
  43. }
  44. }
  45. }