コード例 #1
0
        /// <summary>
        /// First init
        /// </summary>
        private void Init()
        {
            // Set rpogramstate to running
            ProgramState.IsRunning = true;

            // Read the config files on startup
            ConfigFileHelpers.ReadServerConfigFile();

            // Try to connect to the server
            Task.Run(async() =>
            {
                await ProgramState.ServerConnection.ConnectAsync();
                await DatabaseHelpers.Init();
            });

            // Set the current screen
            CurrentScreen = MainPages.WellcomeScreen;

            // The await does not work for some f****** reason!
            while (DatabaseHelpers.AllProducts == null)
            {
                ;
            }

            // Set this VM
            VM = this;
        }
コード例 #2
0
 private async void Init()
 {
     ConfigFileHelpers.ReadServerConfigFile();
     if (!await ProgramState.Server.ConnectAsync())
     {
         MessageBox.Show("Kunde inte etablera anslutning till servern.\nProgrammet körs i offline-läge.");
     }
 }
コード例 #3
0
        public async void Init()
        {
            ProgramState.IsRunning = true;

            ConfigFileHelpers.ReadServerConfigFile();

            if (await ProgramState.ServerConnection.ConnectAsync())
            {
                MessageBox.Show("Terminal is connected to the server");
            }

            else
            {
                MessageBox.Show("Could not connect to the server, RUNNING IN OFFLINE MODE");
            }
        }