* OleDbParameterCollectionTest.cs: Fix compile error in 1.1 profile.
[mono.git] / mcs / class / System.ServiceProcess / System.ServiceProcess / ServiceInstaller.cs
1 //
2 // System.ServiceProcess.ServiceInstaller.cs
3 //
4 // Authors:
5 //      Geoff Norton (gnorton@customerdna.com)
6 //
7 // (C) 2005, Geoff Norton
8 //
9
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System;
32 using System.Collections;
33 using System.ComponentModel;
34 using System.Configuration.Install;
35 #if NET_2_0
36 using System.Runtime.InteropServices;
37 #endif
38
39 namespace System.ServiceProcess
40 {
41         [MonoTODO]
42         public class ServiceInstaller : ComponentInstaller
43         {
44                 public ServiceInstaller ()
45                 {
46                 }
47                 
48                 private string display_name;
49                 private string service_name;
50                 private string[] services_depended_on;
51                 private ServiceStartMode start_type;
52
53 #if NET_2_0
54                 private string description;
55
56                 [ComVisible (false)]
57                 [DefaultValue ("")]
58                 [ServiceProcessDescription ("Indicates the service's description (a brief comment that explains the purpose of the service). ")]
59                 public string Description {
60                         get {
61                                 return description;
62                         }
63                         set {
64                                 description = value;
65                         }
66                 }
67 #endif
68
69                 [DefaultValue("")]
70 #if NET_2_0
71                 [ServiceProcessDescription ("Indicates the friendly name that identifies the service to the user.")]
72 #endif
73                 public string DisplayName {
74                         get {
75                                 return display_name;
76                         }
77                         set {
78                                 display_name = value;
79                         }
80                 }
81
82                 [DefaultValue("")]
83 #if NET_2_0
84                 [ServiceProcessDescription ("Indicates the name used by the system to identify this service.")]
85 #endif
86                 [TypeConverter("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
87                 public string ServiceName {
88                         get {
89                                 return service_name;
90                         }
91                         set {
92                                 if (value == null || value.Length == 0 || value.Length > 256)
93                                         throw new ArgumentException ();
94                                 service_name = value;
95                         }
96                 }
97
98 #if NET_2_0
99                 [ServiceProcessDescription ("Indicates the services that must be running in order for this service to run.")]
100 #endif
101                 public string[] ServicesDependedOn {
102                         get {
103                                 return services_depended_on;
104                         }
105                         set {
106                                 services_depended_on = value;
107                         }
108                 }
109
110                 [DefaultValue (ServiceStartMode.Manual)]
111 #if NET_2_0
112                 [ServiceProcessDescription ("Indicates how and when this service is started.")]
113 #endif
114                 public ServiceStartMode StartType {
115                         get {
116                                 return start_type;
117                         }
118                         set {
119                                 start_type = value;
120                         }
121                 }
122
123                 public override void CopyFromComponent (IComponent component)
124                 {
125                         if (!component.GetType ().IsSubclassOf (typeof (ServiceBase)))
126                                 throw new ArgumentException ();
127                 }
128
129                 public override void Install (IDictionary stateSaver)
130                 {
131                         throw new NotImplementedException ();
132                 }
133         
134                 public override bool IsEquivalentInstaller (ComponentInstaller otherInstaller)
135                 {
136                         throw new NotImplementedException ();
137                 }
138
139                 public override void Rollback (IDictionary savedState)
140                 {
141                         throw new NotImplementedException ();
142                 }
143
144                 public override void Uninstall (IDictionary savedState)
145                 {
146                         throw new NotImplementedException ();
147                 }
148         }
149 }