Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -41,9 +41,6 @@ using System.Threading;
namespace System.ServiceProcess
{
#if ONLY_1_1
[Designer ("Microsoft.VisualStudio.Install.UserNTServiceDesigner, " + Consts.AssemblyMicrosoft_VisualStudio, "System.ComponentModel.Design.IRootDesigner")]
#endif
[InstallerType (typeof (ServiceProcessInstaller))]
public class ServiceBase : Component
{

View File

@@ -125,7 +125,6 @@ namespace System.ServiceProcess {
}
}
#if NET_2_0
private static char[] invalidServiceNameChars = new char[] { '/', '\\' };
internal static void ValidateServiceName (string name)
@@ -138,13 +137,5 @@ namespace System.ServiceProcess {
throw new ArgumentException (msg, "ServiceName");
}
}
#else
internal static void ValidateServiceName (string name)
{
if (name == null)
throw new ArgumentNullException ("ServiceName");
// FIXME: maybe other checks are required (but not documented)
}
#endif
}
}

View File

@@ -32,9 +32,7 @@ using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration.Install;
#if NET_2_0
using System.Runtime.InteropServices;
#endif
namespace System.ServiceProcess
{
@@ -49,14 +47,9 @@ namespace System.ServiceProcess
private string service_name;
private string[] services_depended_on;
private ServiceStartMode start_type;
#if NET_2_0
private string description;
#endif
#if NET_4_0
private bool delayedAutoStart;
#endif
#if NET_4_0
[DefaultValue(false)]
[ServiceProcessDescription("Indicates that the service's start should be delayed after other automatically started services have started.")]
public bool DelayedAutoStart {
@@ -67,9 +60,7 @@ namespace System.ServiceProcess
delayedAutoStart = value;
}
}
#endif
#if NET_2_0
[ComVisible (false)]
[DefaultValue ("")]
[ServiceProcessDescription ("Indicates the service's description (a brief comment that explains the purpose of the service). ")]
@@ -81,12 +72,9 @@ namespace System.ServiceProcess
description = value;
}
}
#endif
[DefaultValue("")]
#if NET_2_0
[ServiceProcessDescription ("Indicates the friendly name that identifies the service to the user.")]
#endif
public string DisplayName {
get {
return display_name;
@@ -97,9 +85,7 @@ namespace System.ServiceProcess
}
[DefaultValue("")]
#if NET_2_0
[ServiceProcessDescription ("Indicates the name used by the system to identify this service.")]
#endif
[TypeConverter("System.Diagnostics.Design.StringValueConverter, " + Consts.AssemblySystem_Design)]
public string ServiceName {
get {
@@ -112,9 +98,7 @@ namespace System.ServiceProcess
}
}
#if NET_2_0
[ServiceProcessDescription ("Indicates the services that must be running in order for this service to run.")]
#endif
public string[] ServicesDependedOn {
get {
return services_depended_on;
@@ -125,9 +109,7 @@ namespace System.ServiceProcess
}
[DefaultValue (ServiceStartMode.Manual)]
#if NET_2_0
[ServiceProcessDescription ("Indicates how and when this service is started.")]
#endif
public ServiceStartMode StartType {
get {
return start_type;

View File

@@ -47,9 +47,7 @@ namespace System.ServiceProcess
private string username;
[DefaultValue (ServiceAccount.User)]
#if NET_2_0
[ServiceProcessDescription ("Indicates the account type under which the service will run.")]
#endif
public ServiceAccount Account {
get {
return account;

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.ServiceProcess
{
@@ -78,4 +77,3 @@ namespace System.ServiceProcess
}
}
#endif

View File

@@ -28,7 +28,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.ServiceProcess
{
@@ -46,4 +45,3 @@ namespace System.ServiceProcess
}
}
#endif

View File

@@ -43,12 +43,10 @@ namespace System.ServiceProcess
{
}
#if NET_2_0
public TimeoutException (string message, Exception innerException)
: base (message, innerException)
{
}
#endif
protected TimeoutException (SerializationInfo info, StreamingContext context) : base (info, context)
{

View File

@@ -591,13 +591,8 @@ namespace System.ServiceProcess
IntPtr buffer = IntPtr.Zero;
try {
#if NET_2_0
scHandle = OpenServiceControlManager (machineName,
SERVICE_MANAGER_RIGHTS.SC_MANAGER_ENUMERATE_SERVICE);
#else
scHandle = OpenServiceControlManager (machineName,
SERVICE_MANAGER_RIGHTS.SC_MANAGER_ENUMERATE_SERVICE, true);
#endif
uint bufferSize = 0;
uint bytesNeeded = 0;