Yaircc.Net.ProgramUpdate.FetchReleaseNotes C# (CSharp) Метод

FetchReleaseNotes() публичный Метод

Fetches and parses the release notes from the user's version up to this version.
public FetchReleaseNotes ( System.Version version ) : bool
version System.Version The version of the current executable.
Результат bool
        public bool FetchReleaseNotes(Version version)
        {
            bool retval = true;

            try
            {
                this.releaseNotes = Net.ReleaseNotes.GetReleaseNotes(version);
            }
            catch
            {
                retval = false;
            }

            return retval;
        }

Usage Example

Пример #1
0
 /// <summary>
 /// Handles the DoWork event of System.ComponentModel.BackgroundWorker.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The event arguments.</param>
 private void UpdateCheckBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     ProgramUpdate update = new ProgramUpdate();
     if (update.Fetch())
     {
         Version executingVersion = Assembly.GetExecutingAssembly().GetName().Version;
         Version updateVersion = new Version(update.Version);
         if (executingVersion < updateVersion)
         {
             update.FetchReleaseNotes(executingVersion);
             e.Result = update;
         }
         else
         {
             e.Result = null;
         }
     }
     else
     {
         e.Result = false;
     }
 }