PageRenderTime 13ms CodeModel.GetById 9ms app.highlight 1ms 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
 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// ****************************************************************
 6using System;
 7
 8namespace NUnit.Core.Extensibility
 9{
10    /// <summary>
11    /// Represents a single point of extension for NUnit. Some extension
12    /// points may accept only a single extension, while others may
13    /// accept more than one at the same time.
14    /// </summary>
15    public interface IExtensionPoint
16	{
17		/// <summary>
18		/// Get the name of this extension point
19		/// </summary>
20		string Name { get; }
21
22        /// <summary>
23        /// Get the host that provides this extension point
24        /// </summary>
25        IExtensionHost Host { get; }
26
27        /// <summary>
28        /// Install an extension at this extension point. If the
29        /// extension object does not meet the requirements for
30        /// this extension point, an exception is thrown.
31        /// </summary>
32        /// <param name="extension">The extension to install</param>
33        void Install(object extension);
34
35        /// <summary>
36		/// Removes an extension from this extension point. If the
37		/// extension object is not present, the method returns
38		/// without error.
39        /// </summary>
40        /// <param name="extension"></param>
41		void Remove( object extension );
42	}
43
44    /// <summary>
45    /// Represents a single point of extension for NUnit. Some extension
46    /// points may accept only a single extension, while others may
47    /// accept more than one at the same time. This interface enhances
48    /// IExtensionPoint by allowing specification of a priority
49    /// order for applying addins.
50    /// </summary>
51    public interface IExtensionPoint2 : IExtensionPoint
52    {
53        /// <summary>
54        /// Install an extension at this extension point specifying
55        /// an integer priority value for the extension.If the
56        /// extension object does not meet the requirements for
57        /// this extension point, or if the extension point does
58        /// not support the requested priority level, an exception 
59        /// is thrown.
60        /// </summary>
61        /// <param name="extension">The extension to install</param>
62        /// <param name="priority">The priority level for this extension</param>
63        void Install(object extension, int priority);
64    }
65}