[msvc] Update csproj files (#4221)
[mono.git] / mcs / nunit24 / NUnitCore / core / ExtensionHost.cs
1 // ****************************************************************\r
2 // Copyright 2007, Charlie Poole\r
3 // This is free software licensed under the NUnit license. You may\r
4 // obtain a copy of the license at http://nunit.org/?p=license&r=2.4\r
5 // ****************************************************************\r
6 using System;\r
7 using NUnit.Core.Extensibility;\r
8 \r
9 namespace NUnit.Core\r
10 {\r
11         /// <summary>\r
12         /// ExtensionHost is the abstract base class used for\r
13         /// all extension hosts. It provides an array of \r
14         /// extension points and a FrameworkRegistry and\r
15         /// implements the IExtensionHost interface. Derived\r
16         /// classes must initialize the extension points.\r
17         /// </summary>\r
18         public abstract class ExtensionHost : IExtensionHost\r
19         {\r
20                 protected FrameworkRegistry frameworks;\r
21 \r
22                 protected IExtensionPoint[] extensions;\r
23 \r
24                 protected ExtensionType supportedTypes;\r
25 \r
26                 public ExtensionHost()\r
27                 {\r
28                         frameworks = new FrameworkRegistry();\r
29                 }\r
30 \r
31                 #region IExtensionHost Interface\r
32                 public IExtensionPoint[] ExtensionPoints\r
33                 {\r
34                         get { return extensions; }\r
35                 }\r
36 \r
37                 public IFrameworkRegistry FrameworkRegistry\r
38                 {\r
39                         get { return frameworks; }\r
40                 }\r
41 \r
42                 public IExtensionPoint GetExtensionPoint( string name )\r
43                 {\r
44                         foreach ( IExtensionPoint extensionPoint in extensions )\r
45                                 if ( extensionPoint.Name == name )\r
46                                         return extensionPoint;\r
47 \r
48                         return null;\r
49                 }\r
50 \r
51                 public ExtensionType ExtensionTypes\r
52                 {\r
53                         get { return supportedTypes; }\r
54                 }\r
55                 #endregion\r
56         }\r
57 }\r