Ejemplo n.º 1
0
 private static void Main(String[] args)
 {
     BugSenseHandler.Instance.InitAndStartSession(new ExceptionManager(), BugSenseApiKey);
     CrashHandler.SetUserIdentifier();
     Application.Run(new Program(args));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes the form with the current application settings
        /// </summary>
        public SettingsForm()
        {
            InitializeComponent();

            // DownloadFolder
            downloadFolderBox.Text         = Settings.DownloadFolder;
            selectDownloadFolderBtn.Click += (sender, args) =>
            {
                if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
                {
                    downloadFolderBox.Text = folderBrowserDialog1.SelectedPath;
                }
            };

            // Author Folder
            authorFolderSort.Checked         = Settings.AuthorFolder;
            authorFolderSort.CheckedChanged += (sender, args) =>
            {
                Settings.AuthorFolder = authorFolderSort.Checked;
            };

            // iTunes Functionality
            iTunesEnabled.Checked         = Settings.TunesTransfer != Settings.TunesSetting.Nothing;
            iTunesEnabled.CheckedChanged += (sender, args) =>
            {
                iTunesCopy.Enabled = iTunesEnabled.Checked;
            };
            iTunesCopy.Enabled = iTunesEnabled.Checked;
            iTunesCopy.Checked = Settings.TunesTransfer == Settings.TunesSetting.Copy;

            // Use Download Link
            useDownloadLink.Checked = Settings.UseDownloadLink;

            // Confirm Exit
            confirmExitCheckBox.Checked = Settings.ConfirmExit;

            // Check for Updates
            checkForUpdates.Checked = Settings.CheckForUpdates;

            // Beta Updates
            betaCheckBox.Checked = Settings.EnableBetaUpdates;

            // Support email
            enableEmail.Checked         = Settings.IncludeSupportEmail;
            enableEmail.CheckedChanged += (sender, args) =>
            {
                emailTextBox.Enabled = enableEmail.Checked;
            };
            emailTextBox.Text    = Settings.SupportEmail;
            emailTextBox.Enabled = enableEmail.Checked;

            // Save Settings
            saveBtn.Click += (sender, args) =>
            {
                Settings.DownloadFolder = downloadFolderBox.Text;

                if (!iTunesEnabled.Checked)
                {
                    Settings.TunesTransfer = Settings.TunesSetting.Nothing;
                }
                else
                {
                    Settings.TunesTransfer = iTunesCopy.Checked
                                                                      ? Settings.TunesSetting.Copy
                                                                      : Settings.TunesSetting.Move;
                }

                Settings.UseDownloadLink   = useDownloadLink.Checked;
                Settings.ConfirmExit       = confirmExitCheckBox.Checked;
                Settings.CheckForUpdates   = checkForUpdates.Checked;
                Settings.EnableBetaUpdates = betaCheckBox.Checked;

                Settings.IncludeSupportEmail = enableEmail.Checked;
                Settings.SupportEmail        = emailTextBox.Text;
                CrashHandler.SetUserIdentifier();

                Close();
            };
        }