Created
January 23, 2011 21:47
-
-
Save cammerman/792474 to your computer and use it in GitHub Desktop.
Service example VS2008 generated boilerplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Program | |
{ | |
/// <summary> | |
/// The main entry point for the application. | |
/// </summary> | |
static void Main() | |
{ | |
ServiceBase[] ServicesToRun; | |
ServicesToRun = new ServiceBase[] | |
{ | |
new Service1() | |
}; | |
ServiceBase.Run(ServicesToRun); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[RunInstaller(true)] | |
public partial class ProjectInstaller : Installer | |
{ | |
public ProjectInstaller() | |
{ | |
InitializeComponent(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
partial class ProjectInstaller | |
{ | |
/// <summary> | |
/// Required designer variable. | |
/// </summary> | |
private System.ComponentModel.IContainer components = null; | |
/// <summary> | |
/// Clean up any resources being used. | |
/// </summary> | |
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |
protected override void Dispose(bool disposing) | |
{ | |
if (disposing && (components != null)) | |
{ | |
components.Dispose(); | |
} | |
base.Dispose(disposing); | |
} | |
#region Component Designer generated code | |
/// <summary> | |
/// Required method for Designer support - do not modify | |
/// the contents of this method with the code editor. | |
/// </summary> | |
private void InitializeComponent() | |
{ | |
this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller(); | |
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller(); | |
// | |
// serviceProcessInstaller1 | |
// | |
this.serviceProcessInstaller1.Password = null; | |
this.serviceProcessInstaller1.Username = null; | |
// | |
// serviceInstaller1 | |
// | |
this.serviceInstaller1.ServiceName = "Service1"; | |
// | |
// ProjectInstaller | |
// | |
this.Installers.AddRange(new System.Configuration.Install.Installer[] { | |
this.serviceProcessInstaller1, | |
this.serviceInstaller1}); | |
} | |
#endregion | |
private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1; | |
private System.ServiceProcess.ServiceInstaller serviceInstaller1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class Service1 : ServiceBase | |
{ | |
public Service1() | |
{ | |
InitializeComponent(); | |
} | |
protected override void OnStart(string[] args) | |
{ | |
} | |
protected override void OnStop() | |
{ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
partial class Service1 | |
{ | |
/// <summary> | |
/// Required designer variable. | |
/// </summary> | |
private System.ComponentModel.IContainer components = null; | |
/// <summary> | |
/// Clean up any resources being used. | |
/// </summary> | |
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |
protected override void Dispose(bool disposing) | |
{ | |
if (disposing && (components != null)) | |
{ | |
components.Dispose(); | |
} | |
base.Dispose(disposing); | |
} | |
#region Component Designer generated code | |
/// <summary> | |
/// Required method for Designer support - do not modify | |
/// the contents of this method with the code editor. | |
/// </summary> | |
private void InitializeComponent() | |
{ | |
components = new System.ComponentModel.Container(); | |
this.ServiceName = "Service1"; | |
} | |
#endregion | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment