コード例 #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();
        }
コード例 #2
0
ファイル: UlteriusAgent.cs プロジェクト: Ulterius/server
 public void Start()
 {
     _ulterius = new Ulterius();
     _ulterius.Start(true);
     HandleMonitor();
     var hardware = new HardwareSurvey();
     hardware.Setup(true);
     Console.ReadLine();
 }
コード例 #3
0
        public void Start()
        {
            _ulterius = new Ulterius();
            _ulterius.Start(true);
            HandleMonitor();
            var hardware = new HardwareSurvey();

            hardware.Setup(true);
            Console.ReadLine();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: Ulterius/server
        //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);
                }
            }
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: billyprice1old/server
        //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);
                }
            }
        }
コード例 #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);
            }
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: wade1990/server-2
        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);
            }
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: tiagojferreira/server
        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");
            }
        }