private void FrbUpdaterPluginForm_Load(object sender, EventArgs e)
 {
     BuildMenu();
     _settings = FrbUpdaterSettings.LoadSettings();
     cbSyncTo.Text = _settings.SelectedSource;
     if (!ShowCurrent && cbSyncTo.Text == "Current")
     {
         cbSyncTo.Text = "Daily Build";
     }
     chkAutoUpdate.Checked = _settings.AutoUpdate;
 }
Beispiel #2
0
 private void FrbUpdaterPluginForm_Load(object sender, EventArgs e)
 {
     BuildMenu();
     _settings     = FrbUpdaterSettings.LoadSettings();
     cbSyncTo.Text = _settings.SelectedSource;
     if (!ShowCurrent && cbSyncTo.Text == "Current")
     {
         cbSyncTo.Text = "Daily Build";
     }
     chkAutoUpdate.Checked = _settings.AutoUpdate;
 }
Beispiel #3
0
        public void StartUp()
        {
            var settings = FrbUpdaterSettings.LoadSettings();

            if (settings.AutoUpdate && (settings.SelectedSource == "Daily Build" || settings.SelectedSource == "Current"))
            {
                var window = new UpdateWindow(this);
                GlueCommands.DialogCommands.SetFormOwner(window);
                if (window.Owner == null)
                {
                    window.TopMost = true;
                }
                window.Show();
            }
        }
Beispiel #4
0
        private void FrmMainLoad(object sender, EventArgs e)
        {
            _settings = FrbUpdaterSettings.LoadSettings(_userAppPath);

            switch (_settings.SelectedSource)
            {
            case "Daily Build":
                _url      = DailyBuildRemoteUri;
                _savePath = _userAppPath + @"\FRBDK\DailyBuild\SingleDlls";
                break;

            case "Current":
                var date = DateTime.Now;

                // This seems to cause problems for the user, so we're going to put a limit on this.
                // We don't want to go back more than 10 years, so that woul be 120 months.  I just randomly
                // picked 10 years.
                // Update - this actually hits the web server, so we should probably not do 10 years.  Let's go to 1 year
                int numberOfTries = 0;
                while (!IsMonthValid(date) && numberOfTries < 1 * 12)
                {
                    PluginManager.ReceiveOutput("Attempting to find valid month, but the following date is invalid: " + date);
                    date = date.AddMonths(-1);
                    numberOfTries++;
                }

                _url      = StartRemoteUri + date.ToString("yyyy") + "/" + date.ToString("MMMM") + "/SingleDlls/";
                _savePath = _userAppPath + @"\FRBDK\Current\SingleDlls\";
                break;

            default:
                //Month Year
                //Ex: July 2011
                var regex = new Regex(@"\w*\s\d\d\d\d");

                if (regex.IsMatch(_settings.SelectedSource))
                {
                    var items = _settings.SelectedSource.Trim().Split(' ');

                    var year  = items[1].Trim();
                    var month = items[0].Trim();

                    _url      = StartRemoteUri + year + "/" + month + "/SingleDlls/";
                    _savePath = _userAppPath + @"\FRBDK\" + year + @"\" + month + @"\SingleDlls\";
                }
                else
                {
                    throw new Exception("Unknown Sync Point.");
                }

                break;
            }

            Action action = () =>
            {
                PopulateFiles();

                if (this.mFoundFiles.Count > 0)
                {
                    BeginInvoke((Action)(updateWorkerThread.RunWorkerAsync));
                }
                else
                {
                    BeginInvoke((Action)(Close));
                }
            };

            action.BeginInvoke(null, null);
        }
        private void FrmMainLoad(object sender, EventArgs e)
        {
            _settings = FrbUpdaterSettings.LoadSettings(_userAppPath);

            switch (_settings.SelectedSource)
            {
                case "Daily Build":
                    _url = DailyBuildRemoteUri;
                    _savePath = _userAppPath + @"\FRBDK\DailyBuild\SingleDlls";
                    break;
                case "Current":
                    var date = DateTime.Now;

                    // This seems to cause problems for the user, so we're going to put a limit on this.
                    // We don't want to go back more than 10 years, so that woul be 120 months.  I just randomly
                    // picked 10 years.
                    // Update - this actually hits the web server, so we should probably not do 10 years.  Let's go to 1 year
                    int numberOfTries = 0;
                    while (!IsMonthValid(date) && numberOfTries < 1*12)
                    {
                        PluginManager.ReceiveOutput("Attempting to find valid month, but the following date is invalid: " + date);
                        date = date.AddMonths(-1);
                        numberOfTries++;
                    }

                    _url = StartRemoteUri + date.ToString("yyyy") + "/" + date.ToString("MMMM") + "/SingleDlls/";
                    _savePath = _userAppPath + @"\FRBDK\Current\SingleDlls\";
                    break;
                default:
                    //Month Year
                    //Ex: July 2011
                    var regex = new Regex(@"\w*\s\d\d\d\d");

                    if (regex.IsMatch(_settings.SelectedSource))
                    {
                        var items = _settings.SelectedSource.Trim().Split(' ');

                        var year = items[1].Trim();
                        var month = items[0].Trim();

                        _url = StartRemoteUri + year + "/" + month + "/SingleDlls/";
                        _savePath = _userAppPath + @"\FRBDK\" + year + @"\" + month + @"\SingleDlls\";
                    }
                    else
                    {
                        throw new Exception("Unknown Sync Point.");
                    }

                    break;
            }

            Action action = () =>
                                {
                                    PopulateFiles();

                                    if (this.mFoundFiles.Count > 0)
                                    {
                                        BeginInvoke((Action) (updateWorkerThread.RunWorkerAsync));
                                    }
                                    else
                                    {
                                        BeginInvoke((Action) (Close));
                                    }
                                };

            action.BeginInvoke(null, null);
        }