Example #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Check if this is the first time setup is run.
            // If so, we'll display the legal notice.
            if (IsFirstRun())
            {
                LegalNotice legalForm = new LegalNotice();
                Application.Run(legalForm);
                if (legalForm.DialogResult == DialogResult.Cancel)
                {
                    return;
                }
            }

            // Check if email is configured
            if (!IsEmailConfigured())
            {
                Setup setupForm = new Setup();
                Application.Run(setupForm);

                // Check the DialogResult for setupForm
                if (setupForm.DialogResult == DialogResult.Cancel)
                {
                    MessageBox.Show("Please come back again when you have an email account ready.");
                    return;
                }

                // Open the email information form
                EmailInfo emailInfoForm = new EmailInfo();
                Application.Run(emailInfoForm);
                if (emailInfoForm.DialogResult == DialogResult.Cancel)
                {
                    // User cancelled setup, exit program
                    return;
                }
            }

            // Check if we need to register user
            if (!IsRegistered())
            {
                Registration regForm = new Registration();
                Application.Run(regForm);

                // Check if regForm returns OK
                if (regForm.DialogResult == DialogResult.Cancel)
                {
                    // Exit program
                    return;
                }
            }

            // Setup complete, set FirstRun to "F" (false)
            FoeClientRegistry.SetEntry("firstrun", "F");

            // Start Foe client
            FoeReader foeReader = new FoeReader();
            Application.Run(foeReader);
        }
Example #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Check if this is the first time setup is run.
            // If so, we'll display the legal notice.
            if (IsFirstRun())
            {
                LegalNotice legalForm = new LegalNotice();
                Application.Run(legalForm);
                if (legalForm.DialogResult == DialogResult.Cancel)
                {
                    return;
                }
            }

            // Check if email is configured
            if (!IsEmailConfigured())
            {
                Setup setupForm = new Setup();
                Application.Run(setupForm);

                // Check the DialogResult for setupForm
                if (setupForm.DialogResult == DialogResult.Cancel)
                {
                    MessageBox.Show("Please come back again when you have an email account ready.");
                    return;
                }

                // Open the email information form
                EmailInfo emailInfoForm = new EmailInfo();
                Application.Run(emailInfoForm);
                if (emailInfoForm.DialogResult == DialogResult.Cancel)
                {
                    // User cancelled setup, exit program
                    return;
                }
            }

            // Check if we need to register user
            if (!IsRegistered())
            {
                Registration regForm = new Registration();
                Application.Run(regForm);

                // Check if regForm returns OK
                if (regForm.DialogResult == DialogResult.Cancel)
                {
                    // Exit program
                    return;
                }
            }

            // Setup complete, set FirstRun to "F" (false)
            FoeClientRegistry.SetEntry("firstrun", "F");

            // Start Foe client
            FoeReader foeReader = new FoeReader();

            Application.Run(foeReader);
        }