Beispiel #1
0
        private void changeSettingsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var setupForm = new SetupDialog(Account.FromRegistry());

             // if anything was changed, reload the page
             // TODO Check if anything changed
             if (setupForm.ShowDialog() == DialogResult.OK)
             {
            for (int i = 1; i < tabControl.TabPages.Count; i++)
            {
               tabControl.TabPages.RemoveAt(i);
               i--;
            }
            Startup();
             }
        }
Beispiel #2
0
        private void Startup()
        {
            try
             {
            Account = Account.FromRegistry();

            if (Account == null)
            {
               // Show the modal dialog to fill these details
               var setupForm = new SetupDialog( null );
               setupForm.ShowDialog();

               // Try again to retreive the details from the registry
               Account = Account.FromRegistry();
            }

            // If the Account is still null, the user cancelled the dialog, the expected behaviour here is to quit
            if ( Account == null )
            {
               Application.Exit();
            }
            else
            {
               _fileNotificationsCheckboxMenuItem.Checked = Account.User.ShowMessageNotifications;

               // Does the user use a proxy server?
               IWebProxy proxy = WebRequest.DefaultWebProxy;
               if ( !proxy.IsBypassed( Account.CampfireUri ) )
               {
                  autoUpdater.ProxyEnabled = true;
                  autoUpdater.ProxyURL = proxy.GetProxy( Account.CampfireUri ).AbsoluteUri;
               }

               Text = string.Format( "{0} - Flare", Account.Name );

               // TODO Load the Lobby
            }
             }
             catch (Exception err)
             {
            FlareException.ShowFriendly(err);
             }
        }