예제 #1
0
        private void CompareVersions()
        {
            if (newVersion > currentVersion)
            {
                DialogResult updateDialog = MessageBox.Show(string.Format("A new version is available! Would you like to update now?\nYou will update from version {0} to {1}", Application.ProductVersion, newVersion.ToString()), "New Version", MessageBoxButtons.YesNo);
                if (updateDialog == DialogResult.Yes)
                {
                    ProgressBar pBar = VisualHelper.CreateNewProgressBar(this, "Updating...");
                    UpdateHelper.DownloadFileToTempPath(pBar, updateUrl);
                }
            }
            else if (!startupUpdateCheck)
            {
                if (newVersion < currentVersion)
                {
                    MessageBox.Show(string.Format("You are using the beta version: {0}", Application.ProductVersion));
                }
                else
                {
                    MessageBox.Show(string.Format("You are using the latest version: {0}", Application.ProductVersion));
                }
            }

            newVersion         = null;
            startupUpdateCheck = false;
        }
예제 #2
0
        private void CheckForNewAccountsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try {
                ProgressBar pBar        = VisualHelper.CreateNewProgressBar(this, "Looking for new accounts...");
                int         newAccounts = Config.CheckForNewAccounts((DataSet)DataGrid.DataSource, pBar);
                pBar.Dispose();
                LoadDataGrid();
                LoadLayout();
                VisualizeInactiveAccounts();
                VisualizeLoggedInAccount();

                MessageBox.Show(string.Format("{0} account(s) added", newAccounts));
            }
            catch (Exception ex) {
                MessageBox.Show("Error checking for new accounts: " + ex.Message);
            }
        }
예제 #3
0
 private void ReloadConfigToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try {
         DialogResult reloadConfig = MessageBox.Show("Are you sure you want to reload the config?\nSettings like level, rank, prime and drop will be lost.", "Reload config", MessageBoxButtons.YesNo);
         if (reloadConfig == DialogResult.Yes)
         {
             ProgressBar pBar = VisualHelper.CreateNewProgressBar(this, "Reloading config...");
             Config.Create(pBar);
             pBar.Dispose();
             LoadDataGrid();
             LoadLayout();
             DataSetHelper.CheckDropDate((DataSet)DataGrid.DataSource);
             VisualizeInactiveAccounts();
             VisualizeLoggedInAccount();
         }
     }
     catch (Exception ex) {
         MessageBox.Show("Error reloading config: " + ex.Message);
     }
 }
예제 #4
0
 private void MainForm_Shown(object sender, EventArgs e)
 {
     try {
         if (!Config.DoesExists())
         {
             ProgressBar pBar = VisualHelper.CreateNewProgressBar(this, "Creating config...");
             Config.Create(pBar);
             pBar.Dispose();
         }
         LoadDataGrid();
         LoadLayout();
         CheckDropDate();
         VisualizeInactiveAccounts();
         VisualizeLoggedInAccount();
         CheckForUpdates();
         CleanUpAfterUpdate();
     }
     catch (Exception ex) {
         MessageBox.Show("Error showing Kwikly: " + ex.Message);
     }
 }