Example #1
0
 public UpdaterDialog(VersionDescription vinfo)
 {
   versionInfo = vinfo;
   InitializeComponent();
   releaseNoteBrowser.DocumentText = versionInfo.Description;
   var cur = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location);
   newVersionLabel.Text = String.Format("新しいバージョンがダウンロードできます!(現在は{0})", cur.ProductVersion);
 }
Example #2
0
        public UpdaterDialog(VersionDescription vinfo)
        {
            versionInfo = vinfo;
            InitializeComponent();
            releaseNoteBrowser.DocumentText = versionInfo.Description;
            var cur = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly().Location);

            newVersionLabel.Text = String.Format("新しいバージョンがダウンロードできます!(現在は{0})", cur.ProductVersion);
        }
Example #3
0
 private void OnDownloadDataCompleted(object sender, DownloadDataCompletedEventArgs args)
 {
     if (!args.Cancelled && args.Error == null)
     {
         var data = System.Text.Encoding.UTF8.GetString(args.Result);
         var doc  = XDocument.Parse(data);
         var cur  = currentVersion;
         VersionDescription new_version = null;
         foreach (var item in doc.Descendants("item"))
         {
             var      xtitle = item.Element("title");
             var      xdate  = item.Element("pubDate");
             var      xlink  = item.Element("link");
             var      xdesc  = item.Element("description");
             DateTime date;
             Uri      link  = null;
             string   title = null;
             string   desc  = null;
             if (xtitle != null && xtitle.Value != null)
             {
                 title = xtitle.Value;
             }
             if (xlink != null && xlink.Value != null)
             {
                 Uri.TryCreate(xlink.Value, UriKind.Absolute, out link);
             }
             if (xdesc != null && xdesc.Value != null)
             {
                 desc = xdesc.ToString();
             }
             if (xdate != null && xdate.Value != null && DateTime.TryParse(xdate.Value, out date))
             {
                 if (cur.Date < date.Date)
                 {
                     cur         = date;
                     new_version = new VersionDescription {
                         Title       = title,
                         PublishDate = date,
                         Link        = link,
                         Description = desc,
                     };
                 }
             }
         }
         if (new_version != null && NewVersionFound != null)
         {
             NewVersionFound(this, new NewVersionFoundEventArgs(new_version));
         }
     }
 }
Example #4
0
 private void OnDownloadDataCompleted(object sender, DownloadDataCompletedEventArgs args)
 {
   if (!args.Cancelled && args.Error==null) {
     var data = System.Text.Encoding.UTF8.GetString(args.Result);
     var doc = XDocument.Parse(data);
     var cur = currentVersion;
     VersionDescription new_version = null;
     foreach (var item in doc.Descendants("item")) {
       var xtitle = item.Element("title");
       var xdate  = item.Element("pubDate");
       var xlink  = item.Element("link");
       var xdesc  = item.Element("description");
       DateTime date;
       Uri    link  = null;
       string title = null;
       string desc  = null;
       if (xtitle!=null && xtitle.Value!=null) {
         title = xtitle.Value;
       }
       if (xlink!=null && xlink.Value!=null) {
         Uri.TryCreate(xlink.Value, UriKind.Absolute, out link);
       }
       if (xdesc!=null && xdesc.Value!=null) {
         desc = xdesc.ToString();
       }
       if (xdate!=null && xdate.Value!=null && DateTime.TryParse(xdate.Value, out date)) {
         if (cur.Date<date.Date) {
           cur = date;
           new_version = new VersionDescription {
             Title       = title,
             PublishDate = date,
             Link        = link,
             Description = desc,
           };
         }
       }
     }
     if (new_version!=null && NewVersionFound!=null) {
       NewVersionFound(this, new NewVersionFoundEventArgs(new_version));
     }
   }
 }
Example #5
0
 public NewVersionFoundEventArgs(VersionDescription desc)
 {
   this.VersionDescription = desc;
 }
Example #6
0
 public NewVersionFoundEventArgs(VersionDescription desc)
 {
     this.VersionDescription = desc;
 }
Example #7
0
 private void versionChecker_Found(object sender, NewVersionFoundEventArgs args)
 {
   newVersionInfo = args.VersionDescription;
   notifyIcon.ShowBalloonTip(
     60000,
     "新しいバージョンがあります",
     args.VersionDescription.Title,
     ToolTipIcon.Info);
 }