Ejemplo n.º 1
0
        /// <summary>
        /// Gets the latest version information.
        /// </summary>
        /// <returns>Returns the LatestVersionInformation</returns>
        public byte[] GetLatestVersion()
        {
            if (this.Get <HttpApplicationStateBase>()["YafRegistrationLatestInformation"] is byte[]
                latestInfo)
            {
                return(latestInfo);
            }

            try
            {
                var reg = new RegisterV2 {
                    Timeout = 30000
                };

                // load the latest version
                latestInfo = reg.LatestVersion();

                if (latestInfo != null)
                {
                    this.Get <HttpApplicationStateBase>().Set("YafRegistrationLatestInformation", latestInfo);
                }
            }
#if DEBUG
            catch (Exception x)
            {
                this.Get <ILogger>().Error(x, "Exception In LatestInformationService");
#else
            catch (Exception)
            {
#endif
                return(null);
            }

            return(latestInfo);
        }
Ejemplo n.º 2
0
        /// <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="EventArgs"/> instance containing the event data.</param>
        protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
        {
            if (!this.IsPostBack)
            {
                try
                {
                    using (var reg = new RegisterV2())
                    {
                        this.lastVersion     = reg.LatestVersion();
                        this.lastVersionDate = reg.LatestVersionDate();
                    }

                    this.LatestVersion.Text = this.GetTextFormatted(
                        "LATEST_VERSION",
                        this.LastVersion,
                        this.LastVersionDate);

                    this.UpgradeVersionHolder.Visible = this.lastVersion > YafForumInfo.AppVersionCode;
                }
                catch (Exception)
                {
                    this.LatestVersion.Visible = false;
                }

                this.RunningVersion.Text = this.GetTextFormatted(
                    "RUNNING_VERSION",
                    YafForumInfo.AppVersionName,
                    this.Get <IDateTime>().FormatDateShort(YafForumInfo.AppVersionDate));
            }

            this.DataBind();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// The page_ load.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
        {
            if (!this.IsPostBack)
            {
                using (var reg = new RegisterV2())
                {
                    this._lastVersion     = reg.LatestVersion();
                    this._lastVersionDate = reg.LatestVersionDate();
                }

                this.Upgrade.Visible = this._lastVersion > YafForumInfo.AppVersionCode;


                this.PageLinks.AddLink(this.PageContext.BoardSettings.Name, YafBuildLink.GetLink(ForumPages.forum));
                this.PageLinks.AddLink(this.GetText("ADMIN_ADMIN", "Administration"), YafBuildLink.GetLink(ForumPages.admin_admin));
                this.PageLinks.AddLink(this.GetText("ADMIN_VERSION", "TITLE"), string.Empty);

                this.Page.Header.Title = "{0} - {1}".FormatWith(
                    this.GetText("ADMIN_ADMIN", "Administration"),
                    this.GetText("ADMIN_VERSION", "TITLE"));

                this.RunningVersion.Text = this.GetTextFormatted(
                    "RUNNING_VERSION",
                    YafForumInfo.AppVersionName,
                    this.Get <IDateTime>().FormatDateShort(YafForumInfo.AppVersionDate));

                this.LatestVersion.Text = this.GetTextFormatted(
                    "LATEST_VERSION",
                    this.LastVersion,
                    this.LastVersionDate);
            }

            this.DataBind();
        }
Ejemplo n.º 4
0
    /// <summary>
    /// The page_ load.
    /// </summary>
    /// <param name="sender">
    /// The sender.
    /// </param>
    /// <param name="e">
    /// The e.
    /// </param>
    protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
    {
      if (!this.IsPostBack)
      {
          using (var reg = new RegisterV2())
          {
              this._lastVersion = reg.LatestVersion();
              this._lastVersionDate = reg.LatestVersionDate();
          }

          this.Upgrade.Visible = this._lastVersion > YafForumInfo.AppVersionCode;


        this.PageLinks.AddLink(this.PageContext.BoardSettings.Name, YafBuildLink.GetLink(ForumPages.forum));
        this.PageLinks.AddLink(this.GetText("ADMIN_ADMIN", "Administration"), YafBuildLink.GetLink(ForumPages.admin_admin));
        this.PageLinks.AddLink(this.GetText("ADMIN_VERSION", "TITLE"), string.Empty);

          this.Page.Header.Title = "{0} - {1}".FormatWith(
              this.GetText("ADMIN_ADMIN", "Administration"), 
              this.GetText("ADMIN_VERSION", "TITLE"));

          this.RunningVersion.Text = this.GetTextFormatted(
              "RUNNING_VERSION",
              YafForumInfo.AppVersionName,
              this.Get<IDateTime>().FormatDateShort(YafForumInfo.AppVersionDate));

           this.LatestVersion.Text = this.GetTextFormatted(
             "LATEST_VERSION",
             this.LastVersion, 
             this.LastVersionDate);
      }

      this.DataBind();
    }