Ejemplo n.º 1
0
    public MyService()
    {
        var setup = new AppDomainSetup
        {
            ShadowCopyFiles = "true"
        };

        domain = AppDomain.CreateDomain("MyServiceHostDomain", AppDomain.CurrentDomain.Evidence, setup);
        runner = (ServiceShell)domain.CreateInstanceAndUnwrap
                     (typeof(ServiceShell).Assembly.FullName, typeof(ServiceShell).FullName);
        InitializeComponent();
    }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Trace.Listeners.Add(new Log4netTraceListener());
            LogConfig.ConfigureLogger(Assembly.GetExecutingAssembly().Location);

            if (ServiceShell.ProcessInstallOptions(args))
            {
                return;
            }

            if (Environment.UserInteractive)
            {
                Console.SetWindowSize(Math.Min(120, Console.LargestWindowWidth), Math.Min(20, Console.LargestWindowHeight));
            }

            using (var appCore = new FirmataWebApi.Core.FirmataWebApiCore())
            {
                Service.StartService <Service>(
                    appCore.Start,
                    appCore.Stop,
                    Environment.UserInteractive);
            }
        }