protected override async Task RefreshAsync() { InitBranchselectors(); Changesets.Clear(); var changesetProvider = new MyChangesetChangesetProvider(ServiceProvider, Settings.Instance.ChangesetCount); //var userLogin = VersionControlNavigationHelper.GetAuthorizedUser(ServiceProvider); //var source = "$/Bookhus husudlejning/Bookhus husudlejning/Feature-Newdesign"; //var target = "$/Bookhus husudlejning/Bookhus husudlejning/Main_Version7.1"; var source = SourceBranch; var target = TargetBranch; Logger.Info("Getting changesets ..."); var changesets = await changesetProvider.GetChangesets(source, target); Logger.Info("Getting changesets end"); Changesets = new ObservableCollection <ChangesetViewModel>(changesets); UpdateTitle(); if (Changesets.Count > 0) { if (SelectedChangeset == null || SelectedChangeset.ChangesetId != Changesets[0].ChangesetId) { SelectedChangeset = Changesets[0]; } } }
/// <summary> /// Refresh the changeset data asynchronously. /// </summary> private async Task RefreshAsync() { if (!IsEnabled) { IsBusy = false; return; } try { IsBusy = true; Changesets.Clear(); ObservableCollection <ChangesetInfo> changesets = new ObservableCollection <ChangesetInfo>(); await Task.Run(() => { ITeamFoundationContext context = CurrentContext; if (context != null && context.HasCollection && context.HasTeamProject) { VersionControlServer vcs = context.TeamProjectCollection.GetService <VersionControlServer>(); if (vcs != null) { // Ask the derived section for the history parameters string user; int maxCount; GetHistoryParameters(vcs, out user, out maxCount); string path = GetPath(); foreach (Changeset changeset in vcs.QueryHistory(path, VersionSpec.Latest, 0, RecursionType.Full, user, null, null, maxCount, false, true)) { changesets.Add(new ChangesetInfo(changeset, IsUserNameVisible ? null : string.Empty)); } } } }); Changesets = changesets; SectionTitle = Changesets.Count > 0 ? String.Format("{0} ({1})", BaseTitle, Changesets.Count) : BaseTitle; } catch (Exception ex) { Output.Exception(ex); } finally { IsBusy = false; } }
private async Task FetchChangesetsAsync() { await _setBusyWhileExecutingAsync(async() => { Changesets.Clear(); var changesets = await _teamService.GetChangesetsAsync(SelectedSourceBranch, SelectedTargetBranch); Changesets = new ObservableCollection <Changeset>(changesets); if (_configManager.GetValue <bool>(ConfigKeys.ENABLE_AUTO_SELECT_ALL_CHANGESETS)) { SelectedChangesets.AddRange(Changesets.Except(SelectedChangesets)); RaisePropertyChanged(nameof(SelectedChangesets)); } }); MergeCommand.RaiseCanExecuteChanged(); }
protected async Task GetChangesetAndUpdateTitleAsync() { Changesets.Clear(); Logger.Info("Getting changesets ..."); var changesets = await GetChangesetsAsync(); Logger.Info("Getting changesets end"); Changesets = new ObservableCollection <ChangesetViewModel>(changesets); UpdateTitle(); if (Changesets.Count > 0) { if (SelectedChangeset == null || SelectedChangeset.ChangesetId != Changesets[0].ChangesetId) { SelectedChangeset = Changesets[0]; } } }
protected override async Task RefreshAsync() { Changesets.Clear(); var changesetProvider = new MyChangesetChangesetProvider(ServiceProvider, Settings.Instance.ChangesetCount); var userLogin = VersionControlNavigationHelper.GetAuthorizedUser(ServiceProvider); Logger.Info("Getting changesets ..."); var changesets = await changesetProvider.GetChangesets(userLogin); Logger.Info("Getting changesets end"); Changesets = new ObservableCollection <ChangesetViewModel>(changesets); UpdateTitle(); if (Changesets.Count > 0) { if (SelectedChangeset == null || SelectedChangeset.ChangesetId != Changesets[0].ChangesetId) { SelectedChangeset = Changesets[0]; } } }
private void ResetChangesets() { Changesets.Clear(); FilteredChangesets.Clear(); }