예제 #1
0
 private void AskScreenShot()
 {
     Task.Delay(60_000).ContinueWith(t => {
         this.camera = new TSCamera();
         this.camera.TakePicture();
     });
 }
예제 #2
0
        static void Main(string[] args)
        {
            var rc = HostFactory.Run(x =>
            {
                x.Service <TSService>(s =>
                {
                    s.ConstructUsing(name => new TSService());
                    s.WhenStarted(ts => ts.Start());
                    s.WhenStopped(ts => ts.Stop());
                });
                x.RunAsLocalSystem();

                //x.StartAutomatically();
                x.StartAutomaticallyDelayed();

                x.SetDescription("TheftShot Service");
                x.SetDisplayName("TheftShot");
                x.SetServiceName("TheftShot");
            });

            var exitCode = (int)Convert.ChangeType(rc, rc.GetTypeCode());

            Environment.ExitCode = exitCode;

            var camera = new TSCamera();
        }