Projektdateien hinzufügen.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.ServiceProcess;
|
||||
using FileInterface.Scheduler;
|
||||
|
||||
namespace FileinterfaceCronScheduler
|
||||
{
|
||||
public sealed class FileinterfaceCronSchedulerService : ServiceBase
|
||||
{
|
||||
private SchedulerRuntime _runtime;
|
||||
|
||||
public FileinterfaceCronSchedulerService()
|
||||
{
|
||||
ServiceName = "FileinterfaceCronScheduler";
|
||||
CanStop = true;
|
||||
CanPauseAndContinue = false;
|
||||
AutoLog = true;
|
||||
}
|
||||
|
||||
protected override void OnStart(string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
_runtime = RuntimeFactory.Create();
|
||||
_runtime.Start();
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (_runtime != null)
|
||||
{
|
||||
_runtime.Dispose();
|
||||
_runtime = null;
|
||||
}
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnStop()
|
||||
{
|
||||
if (_runtime != null)
|
||||
{
|
||||
_runtime.Dispose();
|
||||
_runtime = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user