public void RefreshPage() { var page = this.ActiveMdiChild as IPage; if (page != null) { page.QueryData(1); pnlSiteMap.Controls.Clear(); var siteMap = new SiteMapCtrl(); siteMap.LoadPageConfig(page.GetSiteModelList()); pnlSiteMap.Controls.Add(siteMap); } if (!bgwApp.IsBusy) { tmApp.Enabled = false; bgwApp.RunWorkerAsync(); } }
private void CurrMenuCtrl(Label currLbl, PictureBox currPic, Form childForm, List<SiteModel> siteMapList) { if (this.MdiChildren.Length > 0 && this.ActiveMdiChild != null && this.ActiveMdiChild.Name == childForm.Name) return; picHomeCurr.Visible = false; lblHome.Font = new Font(lblHome.Font, FontStyle.Regular); picSuperTrend.Visible = false; lblSuperTrend.Font = new Font(lblSuperTrend.Font, FontStyle.Regular); picMovieCurr.Visible = false; lblMovie.Font = new Font(lblMovie.Font, FontStyle.Regular); picEmailCurr.Visible = false; lblMovie.Font = new Font(lblMovie.Font, FontStyle.Regular); picNormalTrendCurr.Visible = false; lblNormalTrend.Font = new Font(lblUser.Font, FontStyle.Regular); picUserCurr.Visible = false; lblUser.Font = new Font(lblUser.Font, FontStyle.Regular); picRemindSetCurr.Visible = false; lblRemindSet.Font = new Font(lblRemindSet.Font, FontStyle.Regular); picEmailCurr.Visible = false; lblEmail.Font = new Font(lblEmail.Font, FontStyle.Regular); currLbl.Font = new Font(lblSuperTrend.Font, FontStyle.Bold); currPic.Visible = true; pnlSiteMap.Controls.Clear(); var siteMap = new SiteMapCtrl(); siteMap.LoadPageConfig(siteMapList); pnlSiteMap.Controls.Add(siteMap); int i; for (i = 0; i < this.MdiChildren.Length; i++) { if (this.MdiChildren[i].Name == childForm.Name) break; } if (i == this.MdiChildren.Length) { childForm.MdiParent = this; childForm.Dock = DockStyle.Fill; childForm.Show(); } else { this.MdiChildren[i].BringToFront(); } }