PageRenderTime 22ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/src/NUnit/interfaces/Extensibility/IExtensionPoint.cs

#
C# | 65 lines | 15 code | 5 blank | 45 comment | 0 complexity | b1524be3766e734571c1b2e6651e45cb MD5 | raw file
Possible License(s): GPL-2.0
  1. // ****************************************************************
  2. // Copyright 2007, Charlie Poole
  3. // This is free software licensed under the NUnit license. You may
  4. // obtain a copy of the license at http://nunit.org
  5. // ****************************************************************
  6. using System;
  7. namespace NUnit.Core.Extensibility
  8. {
  9. /// <summary>
  10. /// Represents a single point of extension for NUnit. Some extension
  11. /// points may accept only a single extension, while others may
  12. /// accept more than one at the same time.
  13. /// </summary>
  14. public interface IExtensionPoint
  15. {
  16. /// <summary>
  17. /// Get the name of this extension point
  18. /// </summary>
  19. string Name { get; }
  20. /// <summary>
  21. /// Get the host that provides this extension point
  22. /// </summary>
  23. IExtensionHost Host { get; }
  24. /// <summary>
  25. /// Install an extension at this extension point. If the
  26. /// extension object does not meet the requirements for
  27. /// this extension point, an exception is thrown.
  28. /// </summary>
  29. /// <param name="extension">The extension to install</param>
  30. void Install(object extension);
  31. /// <summary>
  32. /// Removes an extension from this extension point. If the
  33. /// extension object is not present, the method returns
  34. /// without error.
  35. /// </summary>
  36. /// <param name="extension"></param>
  37. void Remove( object extension );
  38. }
  39. /// <summary>
  40. /// Represents a single point of extension for NUnit. Some extension
  41. /// points may accept only a single extension, while others may
  42. /// accept more than one at the same time. This interface enhances
  43. /// IExtensionPoint by allowing specification of a priority
  44. /// order for applying addins.
  45. /// </summary>
  46. public interface IExtensionPoint2 : IExtensionPoint
  47. {
  48. /// <summary>
  49. /// Install an extension at this extension point specifying
  50. /// an integer priority value for the extension.If the
  51. /// extension object does not meet the requirements for
  52. /// this extension point, or if the extension point does
  53. /// not support the requested priority level, an exception
  54. /// is thrown.
  55. /// </summary>
  56. /// <param name="extension">The extension to install</param>
  57. /// <param name="priority">The priority level for this extension</param>
  58. void Install(object extension, int priority);
  59. }
  60. }