/// <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)
              {
            LegacyDb.eventlog_create(null, _taskName, "Exception In {1}: {0}".FormatWith(x, _taskName));
              }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the latest version information.
        /// </summary>
        /// <returns>Returns the LatestVersionInformation</returns>
        public LatestVersionInformation GetLatestVersionInformation()
        {
            var latestInfo =
                this.Get<HttpApplicationStateBase>()["YafRegistrationLatestInformation"] as LatestVersionInformation;

            if (latestInfo != null)
            {
                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;
        }
Ejemplo n.º 3
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
      }
    }
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();
        }