Esempio n. 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            StopAllThreads = false;

            LogDevice = new Logger();

            this.ParseCommandLineArgs();

            if (OperatingMode == OperationMode.Server)
            {
                ServerWindow window = new ServerWindow();
                window.Show();
                window.Closed += (sender, ea) =>
                {
                    Environment.Exit(0);
                };
            }
            else if (OperatingMode == OperationMode.Client)
            {
                ClientWindow window = new ClientWindow();
                window.Show();
                window.Closed += (sender, ea) =>
                {
                    Environment.Exit(0);
                };
            }
        }
Esempio n. 2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            StopAllThreads = false;

            LogDevice = new Logger();

            this.ParseCommandLineArgs();
            BannedUsers = this.LoadData("banned_users.dta");
            PrivilegedUsers = this.LoadData("privileged_users.dta");

            if (OperatingMode == OperationMode.Server)
            {
                string[] args = Environment.GetCommandLineArgs();
                ServerWindow window = new ServerWindow(args.Contains("-c") || args.Contains("--crash-recovery"));
                ActiveWindow = window;
                window.Show();
                window.Closed += (sender, ea) =>
                {
                    Environment.Exit(0);
                };
            }
            else if (OperatingMode == OperationMode.Client)
            {
                ClientWindow window = new ClientWindow();
                ActiveWindow = window;
                window.Show();
                window.Closed += (sender, ea) =>
                {
                    Environment.Exit(0);
                };
            }
        }