private void FormMain_Load(object sender, EventArgs e) { _appUpdate = new AppUpdate(); _startCtl = new StartControl(_appUpdate); _startCtl.NextEventHandler += new EventHandler <StartControl.StartEventArgs>(_startCtl_NextEventHandler); _startCtl.Dock = DockStyle.Fill; panel1.Controls.Clear(); panel1.Controls.Add(_startCtl); }
public UpdateControl(AppUpdate update) { InitializeComponent(); _appUpdate = update; if (_appUpdate == null || _appUpdate.NewVersion == null || _appUpdate.LocalVersion == null || _appUpdate.ServerVersions == null) { return; } lblVersionInfo.Text = string.Format("从旧版本({0})升级到({1}):", _appUpdate.LocalVersion.StrVersion, _appUpdate.NewVersion.StrVersion); //if (CheckMainAppIsRun()) KillMainApp(); int totalverioncount = _appUpdate.ServerVersions.Count; pgBarChild.Minimum = 0; pgBarChild.Value = 0; pgBarChild.Maximum = totalverioncount; Thread downloadVersionThread = new Thread(new ThreadStart(DownloadVersion)); downloadVersionThread.IsBackground = true; downloadVersionThread.Start(); }
public StartControl(AppUpdate update) { InitializeComponent(); _appUpdate = update; }