Пример #1
0
        public async Task Update()
        {
            await Evergreen.Update(Release);

            var notification = new Notification {
                Message  = "Restart to update.",
                ImageUrl = "",
                Title    = "Evergreen: Upate Complete"
            };

            FrameworkApplication.AddNotification(notification);
        }
Пример #2
0
        public void ShowVersion()
        {
            var versionInformation = Evergreen.GetCurrentAddInVersion();

            var version = new Notification {
                Message  = versionInformation.ToString(),
                ImageUrl = "",
                Title    = "Evergreen"
            };

            FrameworkApplication.AddNotification(version);
        }
Пример #3
0
 /// <summary>
 /// Called when the addin initializes to check for updates and download the latest
 /// </summary>
 /// <returns>Task</returns>
 public static Task RunAsyncUpdateCheck()
 {
     return(QueuedTask.Run(async() => {
         // check current release and update it if there's a newer version
         var evergreen = new Evergreen("roemhildtg", "arcgis-pro-addins");
         VersionInformation currentVersion = evergreen.GetCurrentAddInVersion();
         Release latestVersion = await evergreen.GetLatestReleaseFromGithub();
         if (!evergreen.IsCurrent(currentVersion.AddInVersion, latestVersion))
         {
             await evergreen.Update(latestVersion);
             var notify = new ArcGIS.Desktop.Framework.Notification();
             notify.Title = "Addin Update";
             notify.Message = string.Format("Your pro-addins have been updated to version {0}. Please restart Pro to complete the update.", latestVersion.TagName);
             FrameworkApplication.AddNotification(notify);
         }
     }));
 }
Пример #4
0
        public async Task CheckForUpdate()
        {
            Release = await Evergreen.GetLatestReleaseFromGithub();

            var version = Evergreen.GetCurrentAddInVersion();

            var notification = new Notification {
                Message  = "You are up to date.",
                ImageUrl = "",
                Title    = "Evergreen: Version Check"
            };

            if (Evergreen.IsCurrent(version.AddInVersion, Release))
            {
                FrameworkApplication.AddNotification(notification);

                return;
            }

            notification.Message = $"Release version {Release.TagName} is available";

            FrameworkApplication.AddNotification(notification);
        }