Start() public method

public Start ( bool serviceMode = false ) : void
serviceMode bool
return void
Example #1
0
        //Evan will have to support me and my cat once this gets released into the public.

        private static void Main(string[] args)

        {
            var ulterius = new Ulterius();

            ulterius.Start();
        }
Example #2
0
 public void Start()
 {
     _ulterius = new Ulterius();
     _ulterius.Start(true);
     HandleMonitor();
     var hardware = new HardwareSurvey();
     hardware.Setup(true);
     Console.ReadLine();
 }
Example #3
0
        public void Start()
        {
            _ulterius = new Ulterius();
            _ulterius.Start(true);
            HandleMonitor();
            var hardware = new HardwareSurvey();

            hardware.Setup(true);
            Console.ReadLine();
        }
Example #4
0
        //Evan will have to support me and my cat once this gets released into the public.


        private static void Main(string[] args)

        {

            if (!Debugger.IsAttached)
            {

                ExceptionHandler.AddGlobalHandlers();
                Console.WriteLine("Exception Handlers Attached");
            }
            if (System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location)).Count() > 1) return;
          
            ProfileOptimization.SetProfileRoot(AppEnvironment.DataPath);
            ProfileOptimization.StartProfile("Startup.Profile");

            if (args.Length > 0)
            {

                HostFactory.Run(x => //1
                {
                    x.Service<UlteriusAgent>(s => //2
                    {
                        s.ConstructUsing(name => new UlteriusAgent()); //3
                        s.WhenStarted(tc => tc.Start()); //4
                        s.WhenStopped(tc => tc.Stop());
                        s.WhenSessionChanged((se, e, id) => { se.HandleEvent(e, id); }); //5
                    });
                    x.RunAsLocalSystem(); //6
                    x.EnableSessionChanged();
                    x.SetDescription("The server that powers Ulterius"); //7
                    x.SetDisplayName("Ulterius Server"); //8
                    x.SetServiceName("UlteriusServer"); //9
                });
            }
            else
            {
                var ulterius = new Ulterius();
                ulterius.Start();
                var hardware = new HardwareSurvey();
                hardware.Setup();
                if (Tools.RunningPlatform() == Tools.Platform.Windows)
                {
                    UlteriusTray.ShowTray();
                }
                else
                {
                    Console.ReadKey(true);
                }
            }
        }
Example #5
0
        //Evan will have to support me and my cat once this gets released into the public.


        private static void Main(string[] args)

        {
            if (System.Diagnostics.Process.GetProcessesByName(System.IO.Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location)).Count() > 1)
            {
                return;
            }

            ProfileOptimization.SetProfileRoot(AppEnvironment.DataPath);
            ProfileOptimization.StartProfile("Startup.Profile");

            if (args.Length > 0)
            {
                HostFactory.Run(x =>                                                     //1
                {
                    x.Service <UlteriusAgent>(s =>                                       //2
                    {
                        s.ConstructUsing(name => new UlteriusAgent());                   //3
                        s.WhenStarted(tc => tc.Start());                                 //4
                        s.WhenStopped(tc => tc.Stop());
                        s.WhenSessionChanged((se, e, id) => { se.HandleEvent(e, id); }); //5
                    });
                    x.RunAsLocalSystem();                                                //6
                    x.EnableSessionChanged();
                    x.SetDescription("The server that powers Ulterius");                 //7
                    x.SetDisplayName("Ulterius Server");                                 //8
                    x.SetServiceName("UlteriusServer");                                  //9
                });
            }
            else
            {
                var ulterius = new Ulterius();
                ulterius.Start();
                var hardware = new HardwareSurvey();
                hardware.Setup();
                if (Tools.RunningPlatform() == Tools.Platform.Windows)
                {
                    UlteriusTray.ShowTray();
                }
                else
                {
                    Console.ReadKey(true);
                }
            }
        }
Example #6
0
        //Evan will have to support me and my cat once this gets released into the public.


        private static void Main(string[] args)

        {
            ProfileOptimization.SetProfileRoot(AppEnvironment.DataPath);
            ProfileOptimization.StartProfile("Startup.Profile");

            var ulterius = new Ulterius();

            ulterius.Start();
            var hardware = new HardwareSurvey();

            hardware.Setup();
            //TODO Gdk tray icons
            if (Tools.RunningPlatform() == Tools.Platform.Windows)
            {
                UlteriusTray.ShowTray();
            }
            else
            {
                Console.ReadKey(true);
            }
        }
Example #7
0
        private static void Main(string[] args)

        {
            //Fix screensize issues for Screen Share
            if (Environment.OSVersion.Version.Major >= 6)
            {
                SetProcessDPIAware();
            }
            HideWindow();
            try
            {
                if (Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location))
                    .Count() > 1)
                {
                    return;
                }
                if (!Directory.Exists(AppEnvironment.DataPath))
                {
                    Directory.CreateDirectory(AppEnvironment.DataPath);
                }
                if (!Debugger.IsAttached)
                {
                    ExceptionHandler.AddGlobalHandlers();
                    Console.WriteLine("Exception Handlers Attached");
                }
                ProfileOptimization.SetProfileRoot(AppEnvironment.DataPath);
                ProfileOptimization.StartProfile("Startup.Profile");
                var ulterius = new Ulterius();
                ulterius.Start();
                Console.ReadKey();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Something unexpected occured");
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
            }
        }
Example #8
0
        private static void Main(string[] args)

        {
            //Fix screensize issues for Screen Share
            if (Environment.OSVersion.Version.Major >= 6)
            {
                SetProcessDPIAware();
            }
            HideWindow();
            try
            {
                if (
                    Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location))
                    .Count() > 1)
                {
                    return;
                }

                ProfileOptimization.SetProfileRoot(AppEnvironment.DataPath);
                ProfileOptimization.StartProfile("Startup.Profile");

                if (args.Length > 0)
                {
                    HostFactory.Run(x =>                                                     //1
                    {
                        x.Service <UlteriusAgent>(s =>                                       //2
                        {
                            s.ConstructUsing(name => new UlteriusAgent());                   //3
                            s.WhenStarted(tc => tc.Start());                                 //4
                            s.WhenStopped(tc => tc.Stop());
                            s.WhenSessionChanged((se, e, id) => { se.HandleEvent(e, id); }); //5
                        });
                        x.RunAsLocalSystem();                                                //6
                        x.EnableSessionChanged();
                        x.EnableServiceRecovery(r => { r.RestartService(1); });
                        x.SetDescription("The server that powers Ulterius"); //7
                        x.SetDisplayName("Ulterius Server");                 //8
                        x.SetServiceName("UlteriusServer");                  //9
                    });
                }
                else
                {
                    var ulterius = new Ulterius();
                    ulterius.Start();
                    var hardware = new HardwareSurvey();
                    hardware.Setup();
                    if (Tools.RunningPlatform() == Tools.Platform.Windows)
                    {
                        UlteriusTray.ShowTray();
                    }
                    else
                    {
                        Console.ReadKey(true);
                    }
                }
            }
            catch
            {
                Console.WriteLine("Something unexpected occured");
            }
        }