/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e) { if (this.IsPostBack) { return; } this.PageLinks.AddRoot(); this.PageLinks.AddLink(this.GetText("ADMIN_ADMIN", "Administration"), string.Empty); this.Page.Header.Title = this.GetText("ADMIN_ADMIN", "Administration"); // bind data this.BindBoardsList(); this.BindData(); var latestInfo = new LatestInformationService().GetLatestVersionInformation(); if (latestInfo == null || latestInfo.Version <= YafForumInfo.AppVersionCode) { return; } // updateLink var updateLink = new Action<HyperLink>( link => { link.Text = latestInfo.Message; link.NavigateUrl = latestInfo.Link; }); if (latestInfo.IsWarning) { this.UpdateWarning.Visible = true; updateLink(this.UpdateLinkWarning); } else { this.UpdateHightlight.Visible = true; updateLink(this.UpdateLinkHighlight); } // UpgradeNotice.Visible = install._default.GetCurrentVersion() < Data.AppVersion; }
/// <summary> /// Shows the upgrade message. /// </summary> private void ShowUpgradeMessage() { var latestInfo = new LatestInformationService().GetLatestVersionInformation(); if (latestInfo == null || latestInfo.Version <= YafForumInfo.AppVersionCode) { return; } // updateLink var updateLink = new Action<HyperLink>( link => { link.Text = latestInfo.Message; link.NavigateUrl = latestInfo.Link; }); if (latestInfo.IsWarning) { this.UpdateWarning.Visible = true; updateLink(this.UpdateLinkWarning); } else { this.UpdateHightlight.Visible = true; updateLink(this.UpdateLinkHighlight); } }