Ejemplo n.º 1
0
        private void OnStartClient(object sender, RoutedEventArgs e)
        {
            string check_client_file = laucherSettings.GetClientLocation() + @"\" + laucherSettings.GetClientFilename() + ".exe";

            if (!File.Exists(check_client_file))
            {
                ErrorHandler.AddError(ErrorType.error_Client_noLocation);
            }
            else
            {
                ErrorHandler.RemoveError(ErrorType.error_Client_noLocation);
                // allow only one instance to run
                if (clientWatcher.IsProcessAlive())
                {
                    ErrorHandler.AddError(ErrorType.error_ClientAlreadyRunning);
                }
                else
                {
                    ErrorHandler.RemoveError(ErrorType.error_ClientAlreadyRunning);
                    ClientStarter starter = new ClientStarter(laucherSettings.GetClientLocation(), laucherSettings.PrepareBackendURL(), laucherSettings.GetEmail(), laucherSettings.GetPassword(), laucherSettings.GetClientFilename(), CreateArguments());
                }
            }
            DisplayErrors();
        }