Exemple #1
0
        /// <summary>
        /// Load all github tags in the background.
        /// </summary>
        private void LoadData()
        {
            var vsList = Support.GetVisualStudioInstances();

            cbVisualStudio.ItemsSource = vsList;
            if (vsList.Count > 0)
            {
                cbVisualStudio.SelectedIndex = 0;
            }

            UpdateState();
        }
        /// <summary>
        /// Load all github tags in the background.
        /// </summary>
        private async void LoadData()
        {
            var client         = new GitHubClient(new ProductHeaderValue("RockDevBooster"));
            var tags           = client.Repository.GetAllTags("SparkDevNetwork", "Rock");
            var minimumVersion = new Version(1, 1, 0);

            var vsList = Support.GetVisualStudioInstances();

            List <GitHubTag> list;

            try
            {
                list = ( await tags )
                       .Select(t => new GitHubTag(t))
                       .Where(t => t.Version >= minimumVersion)
                       .OrderByDescending(t => t.Version)
                       .ToList();
            }
            catch
            {
                list = new List <GitHubTag>();
            }
            list.Insert(0, new GitHubTag());

            Dispatcher.Invoke(() =>
            {
                cbTags.ItemsSource   = list;
                txtStatus.Text       = string.Empty;
                cbTags.SelectedIndex = 0;

                cbVisualStudio.ItemsSource = vsList;
                if (vsList.Count > 0)
                {
                    cbVisualStudio.SelectedIndex = 0;
                }
            });
        }