CalDavSynchronizer.AutomaticUpdates.AvailableVersionService.GetWhatsNewNoThrow C# (CSharp) Метод

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

public GetWhatsNewNoThrow ( System.Version oldVersion, System.Version newVersion ) : string
oldVersion System.Version
newVersion System.Version
Результат string
    public string GetWhatsNewNoThrow (Version oldVersion, Version newVersion)
    {
      try
      {
        string readme;

        using (var client = HttpUtility.CreateWebClient())
        {
          readme = client
              .DownloadString (WebResourceUrls.ReadMeFile)
              .Replace ("\n", Environment.NewLine).Replace ("\t", "   ");
        }

        var start = Find (readme, newVersion);
        var end = Find (readme, oldVersion);

        if (start == -1 || end == -1)
        {
          if (start == -1)
            s_logger.ErrorFormat ("Did not find Version '{0}' in readme.md", newVersion);

          if (end == -1)
            s_logger.ErrorFormat ("Did not find Version '{0}' in readme.md", oldVersion);

          return "Did not find any news.";
        }

        return readme.Substring (start, end - start);
      }
      catch (Exception x)
      {
        s_logger.Error (null, x);
        return ("Error while trying to fetch the news.\r\nPlease see logfile for details.");
      }
    }