Пример #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            InitForm initForm = new InitForm("Initialization application...");
            initForm.Show();

            Thread aThread = new Thread(new ThreadStart(initCarExpensesApp));
            aThread.Start();
            aThread.Join();

            initForm.Close();

            if (success)
            {
                try
                {
                    Application.Run(new WelcomeForm(carExpensesApp));
                }
                catch (CarExpensesException ex)
                {
                    CarExpenseMessage.ShowFatalError(ex.Message);
                }
            }
        }
Пример #2
0
        private void btnExportGas_Click(object sender, EventArgs e)
        {
            InitForm initForm = new InitForm("Exporting to XML...");
            initForm.Show();

            Thread aThread = new Thread(new ThreadStart(exportToXmlThread));
            aThread.Start();
            aThread.Join();

            initForm.Close();

            if (exportSuccess)
                CarExpenseMessage.ShowInfo(exportMessage);
            else
                CarExpenseMessage.ShowError(exportMessage);
        }