/src/LinFu.IoC/Configuration/MethodFinderContext.cs

http://github.com/philiplaureano/LinFu · C# · 51 lines · 23 code · 6 blank · 22 comment · 0 complexity · b8841b15215e99c1caf897897c60c8de MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. using LinFu.IoC.Configuration.Interfaces;
  4. namespace LinFu.IoC.Configuration
  5. {
  6. /// <summary>
  7. /// Represents the data associated with a <see cref="IMethodFinder{T}" /> search.
  8. /// </summary>
  9. public class MethodFinderContext : IMethodFinderContext
  10. {
  11. /// <summary>
  12. /// Initializes the context with the default values.
  13. /// </summary>
  14. /// <param name="arguments">The list of arguments that will be passed to the target method.</param>
  15. public MethodFinderContext(params object[] arguments)
  16. {
  17. TypeArguments = new Type[0];
  18. Arguments = arguments;
  19. }
  20. /// <summary>
  21. /// Initializes the context with the default values.
  22. /// </summary>
  23. /// <param name="typeArguments">The type arguments that will be used to construct the target method.</param>
  24. /// <param name="arguments">The list of arguments that will be passed to the target method.</param>
  25. /// <param name="returnType">The type that must be returned by the target method.</param>
  26. public MethodFinderContext(IEnumerable<Type> typeArguments, IEnumerable<object> arguments, Type returnType)
  27. {
  28. TypeArguments = typeArguments;
  29. Arguments = arguments;
  30. ReturnType = returnType;
  31. }
  32. /// <summary>
  33. /// Gets or sets the value indicating the type arguments that will be passed to the target method.
  34. /// </summary>
  35. public IEnumerable<Type> TypeArguments { get; set; }
  36. /// <summary>
  37. /// Gets or sets the value indicating the list of arguments that will be passed to the target method.
  38. /// </summary>
  39. public IEnumerable<object> Arguments { get; set; }
  40. /// <summary>
  41. /// Gets or sets the value indicating the <see cref="System.Type">return type</see> of the target method.
  42. /// </summary>
  43. public Type ReturnType { get; set; }
  44. }
  45. }