コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();

            lastBackup  = DateTime.Now;
            jsonHandler = new JSONHandler(Directory.GetCurrentDirectory());

            jsonHandler.SQLBackupUpdate();
            jsonHandler.RestartDataUpdate();
            jsonHandler.NodeCMDUpdate();

            sqlBackup          = jsonHandler.SQLBackup;
            restartInformation = jsonHandler.RestartInformation;
            nodeCMDInformation = jsonHandler.NodeCMDInformation;

            mySQLHandler = new MySQLHandler(sqlBackup.Host, sqlBackup.DatabaseName, sqlBackup.User, sqlBackup.Password);

            if ((jsonHandler.GetServerDirectory() == null || jsonHandler.GetServerDirectory() == "") || (jsonHandler.GetServerConfigDirectory() == null || jsonHandler.GetServerConfigDirectory() == ""))
            {
                ServerDirConfig serverDirConfig = new ServerDirConfig(this, jsonHandler);
                serverDirConfig.ShowDialog();
            }

            CreateSQLBackupControl();
            CreateRestartControls();
            CreateNodeCMDControls();

            Scheduler.Interval = TimeSpan.FromSeconds(60);
            Scheduler.Tick    += Scheduler_Tick;
            Scheduler.Start();

            startServer.Visibility = Visibility.Visible;

            stopServer.Visibility    = Visibility.Collapsed;
            restartServer.Visibility = Visibility.Collapsed;
            inputText.Visibility     = Visibility.Collapsed;
            submitInput.Visibility   = Visibility.Collapsed;
            labelConsole.Visibility  = Visibility.Collapsed;

            //Stop();

            versionLabel.Content = "Version " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
        }
コード例 #2
0
        private void ButtonSettings_Click(object sender, RoutedEventArgs e)
        {
            ServerDirConfig serverDirConfig = new ServerDirConfig(this, jsonHandler);

            serverDirConfig.ShowDialog();
        }