PageRenderTime 20ms CodeModel.GetById 11ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Server/PHPProvider.cs

#
C# | 51 lines | 35 code | 8 blank | 8 comment | 2 complexity | 2d1c95a2bd7d8b90719b535708ccc93e MD5 | raw file
 1//-----------------------------------------------------------------------
 2// <copyright>
 3// Copyright (C) Ruslan Yakushev for the PHP Manager for IIS project.
 4//
 5// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).
 6// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.
 7// </copyright>
 8//----------------------------------------------------------------------- 
 9
10using System;
11using System.Reflection;
12using Microsoft.Web.Management.Server;
13
14namespace Web.Management.PHP
15{
16
17    internal sealed class PHPProvider : ModuleProvider
18    {
19
20        public override string FriendlyName
21        {
22            get
23            {
24                return Resources.PHPManagerFriendlyName;
25            }
26        }
27
28        public override Type ServiceType
29        {
30            get {
31                 return typeof(PHPService);
32            }
33        }
34
35        public override ModuleDefinition GetModuleDefinition(IManagementContext context)
36        {
37            var assembly = Assembly.GetExecutingAssembly();
38            var assemblyName = assembly.GetName();
39            var assemblyFullName = assemblyName.FullName;
40            var clientAssemblyFullName = assemblyFullName.Replace(assemblyName.Name, "Web.Management.PHP.Client");
41
42            return new ModuleDefinition(Name, "Web.Management.PHP.PHPModule, " + clientAssemblyFullName);
43        }
44
45        public override bool SupportsScope(ManagementScope scope)
46        {
47            return (scope == ManagementScope.Site) ||
48                   (scope == ManagementScope.Server);
49        }
50    }
51}