/// <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);
        }
Beispiel #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();
        }
Beispiel #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();
        }
        /// <summary>
        /// Gets the latest version information.
        /// </summary>
        /// <returns>Returns the LatestVersionInformation</returns>
        public LatestVersionInformation GetLatestVersionInformation()
        {
            if (this.Get <HttpApplicationStateBase>()["YafRegistrationLatestInformation"] is LatestVersionInformation latestInfo)
            {
                return(latestInfo);
            }

            try
            {
                using (var reg = new RegisterV2())
                {
                    reg.Timeout = 30000;

                    // load the latest info -- but only provide the current version information and the user's two-letter language information. Nothing trackable.))
                    latestInfo = reg.LatestInfo(YafForumInfo.AppVersionCode, "US");

                    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);
        }
Beispiel #5
0
        /// <summary>
        /// The run once.
        /// </summary>
        public override void RunOnce()
        {
            try
            {
                using (var reg = new RegisterV2())
                {
                    reg.Timeout = 30000;

                    // load the latest info -- but only provide the current version information and the user's two-letter language information. Nothing trackable.))
                    var latestInfo = reg.LatestInfo(YafForumInfo.AppVersionCode, this.Culture);

                    if (latestInfo != null)
                    {
                        this.Get <HttpApplicationStateBase>().Set("YafRegistrationLatestInformation", latestInfo);
                    }
                }
            }
            catch (Exception x)
            {
#if DEBUG
                this.Logger.Error(x, "Exception In {0}", _taskName);
#endif
            }
        }
Beispiel #6
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();
    }