Browse Source

Fixed SD2-388 and SD2-389.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@299 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
858a0c3709
  1. 23
      data/templates/project/CSharp/Service.xpt
  2. 10
      data/templates/project/VBNet/Service.xpt
  3. 3
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs

23
data/templates/project/CSharp/Service.xpt

@ -72,8 +72,7 @@ namespace ${StandardNamespace} @@ -72,8 +72,7 @@ namespace ${StandardNamespace}
/// </summary>
protected override void OnStart(string[] args)
{
// TODO: Add start code here (if required)
// to start your service.
// TODO: Add start code here (if required) to start your service.
}
/// <summary>
@ -81,20 +80,10 @@ namespace ${StandardNamespace} @@ -81,20 +80,10 @@ namespace ${StandardNamespace}
/// </summary>
protected override void OnStop()
{
// TODO: Add tear-down code here (if required)
// to stop your service.
// TODO: Add tear-down code here (if required) to stop your service.
}
}
}
/// <summary>
/// This method starts the service.
/// </summary>
public static void Main()
{
System.ServiceProcess.ServiceBase.Run(new System.ServiceProcess.ServiceBase[] {
new MyService()
});
}
]]></File>
<File name="Program.cs"><![CDATA[${StandardHeader.C#}
@ -108,16 +97,12 @@ namespace ${ProjectName} @@ -108,16 +97,12 @@ namespace ${ProjectName}
static class Program
{
/// <summary>
/// The main entry point for the application.
/// This method starts the service.
/// </summary>
static void Main()
{
ServiceBase[] ServicesToRun;
// To run more than one service you have to add them here
ServicesToRun = new ServiceBase[] { new ${ProjectName}() };
ServiceBase.Run(ServicesToRun);
ServiceBase.Run(new ServiceBase[] { new ${ProjectName}() });
}
}
}

10
data/templates/project/VBNet/Service.xpt

@ -43,17 +43,16 @@ @@ -43,17 +43,16 @@
<Files>
<File name="${ProjectName}.vb"><![CDATA[${StandardHeader.VBNET}
Imports System.ServiceProcess
Public Class ${ProjectName}
Inherits ServiceBase
' The main entry point for the process
<MTAThread()> _
Shared Sub Main()
Dim ServicesToRun() As System.ServiceProcess.ServiceBase
' To run more than one service you have to add them here
ServicesToRun = New System.ServiceProcess.ServiceBase() {New ${ProjectName}}
System.ServiceProcess.ServiceBase.Run(ServicesToRun)
ServiceBase.Run(New ServiceBase() {New ${ProjectName}})
End Sub
Protected Overrides Sub OnStart(ByVal args() As String)
@ -63,7 +62,6 @@ Public Class ${ProjectName} @@ -63,7 +62,6 @@ Public Class ${ProjectName}
Protected Overrides Sub OnStop()
' TODO: Add tear-down code here (if required) to stop your service.
End Sub
End Class
]]></File>

3
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs

@ -32,7 +32,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -32,7 +32,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
public void Run(ProjectCreateInformation projectCreateInformation)
{
string path = FileUtility.Combine(projectCreateInformation.ProjectBasePath, fileName);
string parsedFileName = StringParser.Parse(fileName, new string[,] { {"ProjectName", projectCreateInformation.ProjectName} });
string path = FileUtility.Combine(projectCreateInformation.ProjectBasePath, parsedFileName);
FileService.OpenFile(path);
}
}

Loading…
Cancel
Save