Skip to content

Commit 7414c01

Browse files
committedMar 9, 2018
Fix violations of VSTHRD200 (Use Async suffix)
1 parent a654a2f commit 7414c01

31 files changed

+74
-71
lines changed
 

‎GitCommands/AsyncLoader.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,27 @@ public static Task<T> DoAsync<T>(Func<T> doMe, Action<T> continueWith, Action<As
5656
{
5757
AsyncLoader loader = new AsyncLoader();
5858
loader.LoadingError += (sender, e) => onError(e);
59-
return loader.Load(doMe, continueWith);
59+
return loader.LoadAsync(doMe, continueWith);
6060
}
6161

6262
public static Task<T> DoAsync<T>(Func<T> doMe, Action<T> continueWith)
6363
{
6464
AsyncLoader loader = new AsyncLoader();
65-
return loader.Load(doMe, continueWith);
65+
return loader.LoadAsync(doMe, continueWith);
6666
}
6767

6868
public static Task DoAsync(Action doMe, Action continueWith)
6969
{
7070
AsyncLoader loader = new AsyncLoader();
71-
return loader.Load(doMe, continueWith);
71+
return loader.LoadAsync(doMe, continueWith);
7272
}
7373

74-
public Task Load(Action loadContent, Action onLoaded)
74+
public Task LoadAsync(Action loadContent, Action onLoaded)
7575
{
76-
return Load((token) => loadContent(), onLoaded);
76+
return LoadAsync((token) => loadContent(), onLoaded);
7777
}
7878

79-
public Task Load(Action<CancellationToken> loadContent, Action onLoaded)
79+
public Task LoadAsync(Action<CancellationToken> loadContent, Action onLoaded)
8080
{
8181
Cancel();
8282
_cancelledTokenSource?.Dispose();
@@ -126,12 +126,12 @@ public Task Load(Action<CancellationToken> loadContent, Action onLoaded)
126126
}, CancellationToken.None, TaskContinuationOptions.NotOnCanceled, _continuationTaskScheduler);
127127
}
128128

129-
public Task<T> Load<T>(Func<T> loadContent, Action<T> onLoaded)
129+
public Task<T> LoadAsync<T>(Func<T> loadContent, Action<T> onLoaded)
130130
{
131-
return Load((token) => loadContent(), onLoaded);
131+
return LoadAsync((token) => loadContent(), onLoaded);
132132
}
133133

134-
public Task<T> Load<T>(Func<CancellationToken, T> loadContent, Action<T> onLoaded)
134+
public Task<T> LoadAsync<T>(Func<CancellationToken, T> loadContent, Action<T> onLoaded)
135135
{
136136
Cancel();
137137
_cancelledTokenSource?.Dispose();

‎GitCommands/RevisionGraph.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private void Dispose(bool disposing)
108108

109109
public void Execute()
110110
{
111-
_backgroundLoader.Load(ProccessGitLog, ProccessGitLogExecuted);
111+
_backgroundLoader.LoadAsync(ProccessGitLog, ProccessGitLogExecuted);
112112
}
113113

114114
private void ProccessGitLog(CancellationToken taskState)

‎GitExtensionsTest.ruleset

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RuleSet Name="Git Extensions Rules for Test Code" Description="This rule set contains all rules. Running this rule set may result in a large number of warnings being reported. Use this rule set to get a comprehensive picture of all issues in your code. This can help you decide which of the more focused rule sets are most appropriate to run for your projects." ToolsVersion="11.0">
33
<Include Path="GitExtensions.ruleset" Action="Default" />
4+
<Rules AnalyzerId="Microsoft.VisualStudio.Threading.Analyzers" RuleNamespace="Microsoft.VisualStudio.Threading.Analyzers">
5+
<Rule Id="VSTHRD200" Action="None" />
6+
</Rules>
47
</RuleSet>

‎GitUI/AutoCompletion/CommitAutoCompleteProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public CommitAutoCompleteProvider(GitModule module)
2020
_module = module;
2121
}
2222

23-
public Task<IEnumerable<AutoCompleteWord>> GetAutoCompleteWords(CancellationTokenSource cts)
23+
public Task<IEnumerable<AutoCompleteWord>> GetAutoCompleteWordsAsync(CancellationTokenSource cts)
2424
{
2525
var cancellationToken = cts.Token;
2626

‎GitUI/AutoCompletion/IAutoCompleteProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ namespace GitUI.AutoCompletion
66
{
77
public interface IAutoCompleteProvider
88
{
9-
Task<IEnumerable<AutoCompleteWord>> GetAutoCompleteWords(CancellationTokenSource cts);
9+
Task<IEnumerable<AutoCompleteWord>> GetAutoCompleteWordsAsync(CancellationTokenSource cts);
1010
}
1111
}

‎GitUI/BuildServerIntegration/BuildServerWatcher.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void LaunchBuildServerInfoFetchOperation()
4949
DisposeBuildServerAdapter();
5050

5151
// Extract the project name from the last part of the directory path. It is assumed that it matches the project name in the CI build server.
52-
GetBuildServerAdapter().ContinueWith((Task<IBuildServerAdapter> task) =>
52+
GetBuildServerAdapterAsync().ContinueWith((Task<IBuildServerAdapter> task) =>
5353
{
5454
if (_revisions.IsDisposed)
5555
{
@@ -284,7 +284,7 @@ private void OnBuildInfoUpdate(BuildInfo buildInfo)
284284
}
285285
}
286286

287-
private Task<IBuildServerAdapter> GetBuildServerAdapter()
287+
private Task<IBuildServerAdapter> GetBuildServerAdapterAsync()
288288
{
289289
return Task<IBuildServerAdapter>.Factory.StartNew(() =>
290290
{

‎GitUI/CommandsDialogs/BrowseDialog/DashboardControl/DashboardItem.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public DashboardItem(Repository repository)
3535
if (AppSettings.DashboardShowCurrentBranch)
3636
{
3737
_branchNameLoader = new AsyncLoader();
38-
_branchNameLoader.Load(() =>
38+
_branchNameLoader.LoadAsync(() =>
3939
{
4040
if (!GitCommands.GitModule.IsBareRepository(repository.Path))
4141
{

‎GitUI/CommandsDialogs/BrowseDialog/FormGoToCommit.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private void linkGitRevParse_LinkClicked(object sender, System.Windows.Forms.Lin
8585
private void LoadTagsAsync()
8686
{
8787
comboBoxTags.Text = Strings.GetLoadingData();
88-
_tagsLoader.Load(
88+
_tagsLoader.LoadAsync(
8989
() => Module.GetTagRefs(GitModule.GetTagRefsSortOrder.ByCommitDateDescending).ToList(),
9090
list =>
9191
{
@@ -99,7 +99,7 @@ private void LoadTagsAsync()
9999
private void LoadBranchesAsync()
100100
{
101101
comboBoxBranches.Text = Strings.GetLoadingData();
102-
_branchesLoader.Load(
102+
_branchesLoader.LoadAsync(
103103
() => Module.GetRefs(false).ToList(),
104104
list =>
105105
{

‎GitUI/CommandsDialogs/FormAddToGitIgnore.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private void FilePattern_TextChanged(object sender, EventArgs e)
120120
_NO_TRANSLATE_Preview.Enabled = false;
121121
}
122122

123-
_ignoredFilesLoader.Load(() => Module.GetIgnoredFiles(GetCurrentPatterns()), UpdatePreviewPanel);
123+
_ignoredFilesLoader.LoadAsync(() => Module.GetIgnoredFiles(GetCurrentPatterns()), UpdatePreviewPanel);
124124
}
125125
}
126126
}

‎GitUI/CommandsDialogs/FormClone.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ private void LoadBranches()
444444
{
445445
string from = _NO_TRANSLATE_From.Text;
446446
Cursor = Cursors.AppStarting;
447-
_branchListLoader.Load(() => Module.GetRemoteServerRefs(from, false, true), UpdateBranches);
447+
_branchListLoader.LoadAsync(() => Module.GetRemoteServerRefs(from, false, true), UpdateBranches);
448448
}
449449

450450
private void Branches_DropDown(object sender, EventArgs e)

‎GitUI/CommandsDialogs/FormCommit.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ private void ComputeUnstagedFiles(Action<IList<GitItemStatus>> onComputed, bool
529529

530530
if (DoAsync)
531531
{
532-
_unstagedLoader.Load(getAllChangedFilesWithSubmodulesStatus, onComputed);
532+
_unstagedLoader.LoadAsync(getAllChangedFilesWithSubmodulesStatus, onComputed);
533533
}
534534
else
535535
{

‎GitUI/CommandsDialogs/FormDiff.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private void ShowSelectedFileDiff()
106106
items.Add(DiffFiles.SelectedItemParent);
107107
}
108108

109-
DiffText.ViewChanges(items, DiffFiles.SelectedItem, String.Empty);
109+
DiffText.ViewChangesAsync(items, DiffFiles.SelectedItem, String.Empty);
110110
}
111111

112112
private void btnSwap_Click(object sender, EventArgs e)

‎GitUI/CommandsDialogs/FormFileHistory.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private void LoadFileHistory()
145145
{
146146
FileChanges.Visible = true;
147147

148-
_asyncLoader.Load(() => BuildFilter(FileName), (filter) =>
148+
_asyncLoader.LoadAsync(() => BuildFilter(FileName), (filter) =>
149149
{
150150
if (filter == null)
151151
{
@@ -331,7 +331,7 @@ private void UpdateSelectedFileViewers(bool force = false)
331331
file.IsTracked = true;
332332
file.Name = fileName;
333333
file.IsSubmodule = GitModule.IsValidGitWorkingDir(_fullPathResolver.Resolve(fileName));
334-
Diff.ViewChanges(FileChanges.GetSelectedRevisions(), file, "You need to select at least one revision to view diff.");
334+
Diff.ViewChangesAsync(FileChanges.GetSelectedRevisions(), file, "You need to select at least one revision to view diff.");
335335
}
336336

337337
if (_buildReportTabPageExtension == null)

‎GitUI/CommandsDialogs/FormLog.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private void ViewSelectedFileDiff()
4545
}
4646

4747
Cursor.Current = Cursors.WaitCursor;
48-
diffViewer.ViewChanges(RevisionGrid.GetSelectedRevisions(), DiffFiles.SelectedItem, String.Empty);
48+
diffViewer.ViewChangesAsync(RevisionGrid.GetSelectedRevisions(), DiffFiles.SelectedItem, String.Empty);
4949
Cursor.Current = Cursors.Default;
5050
}
5151

‎GitUI/CommandsDialogs/FormStash.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ private void InitializeSoft()
106106
if (gitStash == _currentWorkingDirStashItem)
107107
{
108108
toolStripButton_customMessage.Enabled = true;
109-
_asyncLoader.Load(() => Module.GetAllChangedFiles(), LoadGitItemStatuses);
109+
_asyncLoader.LoadAsync(() => Module.GetAllChangedFiles(), LoadGitItemStatuses);
110110
Clear.Enabled = false; // disallow Drop (of current working directory)
111111
Apply.Enabled = false; // disallow Apply (of current working directory)
112112
}
113113
else if (gitStash != null)
114114
{
115-
_asyncLoader.Load(() => Module.GetStashDiffFiles(gitStash.Name), LoadGitItemStatuses);
115+
_asyncLoader.LoadAsync(() => Module.GetStashDiffFiles(gitStash.Name), LoadGitItemStatuses);
116116
Clear.Enabled = true; // allow Drop
117117
Apply.Enabled = true; // allow Apply
118118
}
@@ -163,7 +163,7 @@ private void StashedSelectedIndexChanged(object sender, EventArgs e)
163163
{
164164
string extraDiffArguments = View.GetExtraDiffArguments();
165165
Encoding encoding = View.Encoding;
166-
View.ViewPatch(() =>
166+
View.ViewPatchAsync(() =>
167167
{
168168
Patch patch = Module.GetSingleDiff(gitStash.Name + "^", gitStash.Name, stashedItem.Name, stashedItem.OldName, extraDiffArguments, encoding, true, stashedItem.IsTracked);
169169
if (patch == null)

‎GitUI/CommandsDialogs/RepoHosting/CreatePullRequestForm.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private void Init()
5050
_yourBranchesCB.Text = _strLoading.Text;
5151
_hostedRemotes = _repoHost.GetHostedRemotesForModule(Module);
5252
this.Mask();
53-
_remoteLoader.Load(
53+
_remoteLoader.LoadAsync(
5454
() => _hostedRemotes.Where(r => !r.IsOwnedByMe).ToArray(),
5555
(IHostedRemote[] foreignHostedRemotes) =>
5656
{

‎GitUI/CommandsDialogs/RepoHosting/ViewPullRequestsForm.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private void Init()
6969
_isFirstLoad = true;
7070

7171
this.Mask();
72-
_loader.Load(
72+
_loader.LoadAsync(
7373
() =>
7474
{
7575
var t = _gitHoster.GetHostedRemotesForModule(Module).ToList();

‎GitUI/CommandsDialogs/RevisionDiff.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ private bool GetNextPatchFile(bool searchBackward, bool loop, out int fileIndex,
202202
DiffFiles.SetSelectedIndex(fileIndex, notify: false);
203203
}
204204

205-
loadFileContent = ShowSelectedFileDiff();
205+
loadFileContent = ShowSelectedFileDiffAsync();
206206
return true;
207207
}
208208

@@ -244,7 +244,7 @@ private void ResetSelectedItemsTo(string revision, bool actsAsChild)
244244
RefreshArtificial();
245245
}
246246

247-
private async Task ShowSelectedFileDiff()
247+
private async Task ShowSelectedFileDiffAsync()
248248
{
249249
var items = _revisionGrid.GetSelectedRevisions();
250250
if (DiffFiles.SelectedItem == null || items.Count() == 0)
@@ -273,14 +273,14 @@ private async Task ShowSelectedFileDiff()
273273
}
274274
}
275275

276-
await DiffText.ViewChanges(items, DiffFiles.SelectedItem, String.Empty);
276+
await DiffText.ViewChangesAsync(items, DiffFiles.SelectedItem, String.Empty);
277277
}
278278

279279
private async void DiffFiles_SelectedIndexChanged(object sender, EventArgs e)
280280
{
281281
try
282282
{
283-
await ShowSelectedFileDiff();
283+
await ShowSelectedFileDiffAsync();
284284
}
285285
catch (OperationCanceledException)
286286
{
@@ -325,7 +325,7 @@ private async void DiffText_ExtraDiffArgumentsChanged(object sender, EventArgs e
325325
{
326326
try
327327
{
328-
await ShowSelectedFileDiff();
328+
await ShowSelectedFileDiffAsync();
329329
}
330330
catch (OperationCanceledException)
331331
{

‎GitUI/CommandsDialogs/SearchWindow.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private void textBox1_TextChanged(object sender, EventArgs e)
9191
{
9292
string _selectedText = textBox1.Text;
9393

94-
_backgroundLoader.Load(() => _getCandidates(_selectedText), SearchForCandidates);
94+
_backgroundLoader.LoadAsync(() => _getCandidates(_selectedText), SearchForCandidates);
9595
}
9696

9797
private void textBox1_KeyUp(object sender, KeyEventArgs e)

‎GitUI/CommandsDialogs/WorktreeDialog/FormCreateWorktree.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private void LoadBranchesAsync()
4444
var selectedBranch = UICommands.GitModule.GetSelectedBranch();
4545
ExistingBranches = Module.GetRefs(false);
4646
comboBoxBranches.Text = Strings.GetLoadingData();
47-
_branchesLoader.Load(
47+
_branchesLoader.LoadAsync(
4848
() => ExistingBranches.Where(r => r.Name != selectedBranch).ToList(),
4949
list =>
5050
{

‎GitUI/Editor/FileViewer.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,12 @@ public void ViewCurrentChanges(string fileName, string oldFileName, bool staged,
435435
{
436436
if (!isSubmodule)
437437
{
438-
_async.Load(() => Module.GetCurrentChanges(fileName, oldFileName, staged, GetExtraDiffArguments(), Encoding),
438+
_async.LoadAsync(() => Module.GetCurrentChanges(fileName, oldFileName, staged, GetExtraDiffArguments(), Encoding),
439439
ViewStagingPatch);
440440
}
441441
else if (status != null)
442442
{
443-
_async.Load(() =>
443+
_async.LoadAsync(() =>
444444
{
445445
if (status.Result == null)
446446
{
@@ -452,7 +452,7 @@ public void ViewCurrentChanges(string fileName, string oldFileName, bool staged,
452452
}
453453
else
454454
{
455-
_async.Load(() => LocalizationHelpers.ProcessSubmodulePatch(Module, fileName,
455+
_async.LoadAsync(() => LocalizationHelpers.ProcessSubmodulePatch(Module, fileName,
456456
Module.GetCurrentChanges(fileName, oldFileName, staged, GetExtraDiffArguments(), Encoding)), ViewPatch);
457457
}
458458
}
@@ -479,13 +479,13 @@ public void ViewPatch(string text)
479479

480480
public void ViewStagingPatch(Func<string> loadPatchText)
481481
{
482-
ViewPatch(loadPatchText);
482+
ViewPatchAsync(loadPatchText);
483483
Reset(true, true, true);
484484
}
485485

486-
public Task ViewPatch(Func<string> loadPatchText)
486+
public Task ViewPatchAsync(Func<string> loadPatchText)
487487
{
488-
return _async.Load(loadPatchText, ViewPatch);
488+
return _async.LoadAsync(loadPatchText, ViewPatch);
489489
}
490490

491491
public void ViewText(string fileName, string text)
@@ -549,7 +549,7 @@ private void ViewItem(string fileName, Func<Image> getImage, Func<string> getFil
549549
{
550550
if (GitModule.IsValidGitWorkingDir(fullPath))
551551
{
552-
_async.Load(getSubmoduleText, text => ViewText(fileName, text));
552+
_async.LoadAsync(getSubmoduleText, text => ViewText(fileName, text));
553553
}
554554
else
555555
{
@@ -558,7 +558,7 @@ private void ViewItem(string fileName, Func<Image> getImage, Func<string> getFil
558558
}
559559
else if (IsImage(fileName))
560560
{
561-
_async.Load(getImage,
561+
_async.LoadAsync(getImage,
562562
image =>
563563
{
564564
ResetForImage();
@@ -586,7 +586,7 @@ private void ViewItem(string fileName, Func<Image> getImage, Func<string> getFil
586586
}
587587
else
588588
{
589-
_async.Load(getFileText, text => ViewText(fileName, text));
589+
_async.LoadAsync(getFileText, text => ViewText(fileName, text));
590590
}
591591
}
592592

‎GitUI/Editor/FileViewerInternal.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ private async void BlameFileKeyUp(object sender, KeyEventArgs e)
7777

7878
if (e.Modifiers == Keys.Shift && e.KeyCode == Keys.F3)
7979
{
80-
await _findAndReplaceForm.FindNext(true, true, "Text not found");
80+
await _findAndReplaceForm.FindNextAsync(true, true, "Text not found");
8181
}
8282
else if (e.KeyCode == Keys.F3)
8383
{
84-
await _findAndReplaceForm.FindNext(true, false, "Text not found");
84+
await _findAndReplaceForm.FindNextAsync(true, false, "Text not found");
8585
}
8686

8787
VScrollBar_ValueChanged(this, e);

‎GitUI/Editor/FindAndReplaceForm.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,15 @@ public void ShowFor(TextEditorControl editor, bool replaceMode)
133133

134134
private async void btnFindPrevious_Click(object sender, EventArgs e)
135135
{
136-
await FindNext(false, true, _textNotFoundString.Text);
136+
await FindNextAsync(false, true, _textNotFoundString.Text);
137137
}
138138

139139
private async void btnFindNext_Click(object sender, EventArgs e)
140140
{
141-
await FindNext(false, false, _textNotFoundString.Text);
141+
await FindNextAsync(false, false, _textNotFoundString.Text);
142142
}
143143

144-
public async Task<TextRange> FindNext(bool viaF3, bool searchBackward, string messageIfNotFound)
144+
public async Task<TextRange> FindNextAsync(bool viaF3, bool searchBackward, string messageIfNotFound)
145145
{
146146
if (string.IsNullOrEmpty(txtLookFor.Text))
147147
{
@@ -306,7 +306,7 @@ private async void btnReplace_Click(object sender, EventArgs e)
306306
InsertText(txtReplaceWith.Text);
307307
}
308308

309-
await FindNext(false, _lastSearchWasBackward, _textNotFoundString.Text);
309+
await FindNextAsync(false, _lastSearchWasBackward, _textNotFoundString.Text);
310310
}
311311

312312
private void btnReplaceAll_Click(object sender, EventArgs e)
@@ -323,7 +323,7 @@ private void btnReplaceAll_Click(object sender, EventArgs e)
323323
_editor.Document.UndoStack.StartUndoGroup();
324324
try
325325
{
326-
while (FindNext(false, false, null) != null)
326+
while (FindNextAsync(false, false, null) != null)
327327
{
328328
if (_lastSearchLoopedAround)
329329
{

‎GitUI/GitUIExtensions.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static string GetSelectedPatch(this FileViewer diffViewer, string firstRe
7979
return patch.Text;
8080
}
8181

82-
public static Task ViewChanges(this FileViewer diffViewer, IList<GitRevision> revisions, GitItemStatus file, string defaultText)
82+
public static Task ViewChangesAsync(this FileViewer diffViewer, IList<GitRevision> revisions, GitItemStatus file, string defaultText)
8383
{
8484
if (revisions.Count == 0)
8585
{
@@ -94,12 +94,12 @@ public static Task ViewChanges(this FileViewer diffViewer, IList<GitRevision> re
9494
firstRevision = selectedRevision.FirstParentGuid;
9595
}
9696

97-
return ViewChanges(diffViewer, firstRevision, secondRevision, file, defaultText);
97+
return ViewChangesAsync(diffViewer, firstRevision, secondRevision, file, defaultText);
9898
}
9999

100-
public static Task ViewChanges(this FileViewer diffViewer, string firstRevision, string secondRevision, GitItemStatus file, string defaultText)
100+
public static Task ViewChangesAsync(this FileViewer diffViewer, string firstRevision, string secondRevision, GitItemStatus file, string defaultText)
101101
{
102-
return diffViewer.ViewPatch(() =>
102+
return diffViewer.ViewPatchAsync(() =>
103103
{
104104
string selectedPatch = diffViewer.GetSelectedPatch(firstRevision, secondRevision, file);
105105
return selectedPatch ?? defaultText;

‎GitUI/HelperDialogs/FormCommitDiff.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private void ViewSelectedDiff()
4949
if (DiffFiles.SelectedItem != null && DiffFiles.Revision != null)
5050
{
5151
Cursor.Current = Cursors.WaitCursor;
52-
DiffText.ViewChanges(DiffFiles.SelectedItemParent?.Guid, DiffFiles.Revision?.Guid, DiffFiles.SelectedItem, String.Empty);
52+
DiffText.ViewChangesAsync(DiffFiles.SelectedItemParent?.Guid, DiffFiles.Revision?.Guid, DiffFiles.SelectedItem, String.Empty);
5353
Cursor.Current = Cursors.Default;
5454
}
5555
}

‎GitUI/SpellChecker/EditNetSpell.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ private void InitializeAutoCompleteWordsTask()
858858
_autoCompleteListTask = new Task<IEnumerable<AutoCompleteWord>>(
859859
() =>
860860
{
861-
var subTasks = _autoCompleteProviders.Select(p => p.GetAutoCompleteWords(_autoCompleteCancellationTokenSource)).ToArray();
861+
var subTasks = _autoCompleteProviders.Select(p => p.GetAutoCompleteWordsAsync(_autoCompleteCancellationTokenSource)).ToArray();
862862
try
863863
{
864864
Task.WaitAll(subTasks, _autoCompleteCancellationTokenSource.Token);

‎GitUI/UserControls/BlameControl.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public void LoadBlame(GitRevision revision, List<string> children, string fileNa
235235
_fileName = fileName;
236236
_encoding = encoding;
237237

238-
_blameLoader.Load(() => _blame = Module.Blame(fileName, guid, encoding),
238+
_blameLoader.LoadAsync(() => _blame = Module.Blame(fileName, guid, encoding),
239239
() => ProcessBlame(revision, children, controlToMask, line, scrollpos));
240240
}
241241

‎Gravatar/GravatarService.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,16 @@ private async Task<Image> LoadFromGitHubAsync(string imageFileName, string email
175175
return null;
176176
}
177177

178-
return await DownloadImage(new Uri(imageUrl), imageFileName);
178+
return await DownloadImageAsync(new Uri(imageUrl), imageFileName);
179179
}
180180

181181
private Task<Image> LoadFromGravatarAsync(string imageFileName, string email, int imageSize, DefaultImageType defaultImageType)
182182
{
183183
var imageUrl = BuildGravatarUrl(email, imageSize, false, Rating.G, defaultImageType);
184-
return DownloadImage(imageUrl, imageFileName);
184+
return DownloadImageAsync(imageUrl, imageFileName);
185185
}
186186

187-
private async Task<Image> DownloadImage(Uri imageUrl, string imageFileName)
187+
private async Task<Image> DownloadImageAsync(Uri imageUrl, string imageFileName)
188188
{
189189
try
190190
{

‎Plugins/BuildServerIntegration/JenkinsIntegration/JenkinsAdapter.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public class JenkinsCacheInfo
115115
public long Timestamp = -1;
116116
}
117117

118-
private Task<ResponseInfo> GetBuildInfoTask(string projectUrl, bool fullInfo, CancellationToken cancellationToken)
118+
private Task<ResponseInfo> GetBuildInfoTaskAsync(string projectUrl, bool fullInfo, CancellationToken cancellationToken)
119119
{
120120
return GetResponseAsync(FormatToGetJson(projectUrl, fullInfo), cancellationToken)
121121
.ContinueWith(
@@ -198,11 +198,11 @@ private void ObserveBuilds(DateTime? sinceDate, bool? running, IObserver<BuildIn
198198
if (_LastBuildCache[projectUrl].Timestamp <= 0)
199199
{
200200
// This job must be updated, no need to to check the latest builds
201-
allBuildInfos.Add(GetBuildInfoTask(projectUrl, true, cancellationToken));
201+
allBuildInfos.Add(GetBuildInfoTaskAsync(projectUrl, true, cancellationToken));
202202
}
203203
else
204204
{
205-
latestBuildInfos.Add(GetBuildInfoTask(projectUrl, false, cancellationToken));
205+
latestBuildInfos.Add(GetBuildInfoTaskAsync(projectUrl, false, cancellationToken));
206206
}
207207
}
208208

@@ -217,7 +217,7 @@ private void ObserveBuilds(DateTime? sinceDate, bool? running, IObserver<BuildIn
217217
if (info.Result.Timestamp > _LastBuildCache[info.Result.Url].Timestamp)
218218
{
219219
// The cache has at least one newer job, query the status
220-
allBuildInfos.Add(GetBuildInfoTask(info.Result.Url, true, cancellationToken));
220+
allBuildInfos.Add(GetBuildInfoTaskAsync(info.Result.Url, true, cancellationToken));
221221
}
222222
}
223223
}

‎Plugins/GitFlow/GitFlowForm.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private void LoadBranches(string branchType)
116116
cbBranches.DataSource = new List<string> { _loading.Text };
117117
if (!Branches.ContainsKey(branchType))
118118
{
119-
_task.Load(() => GetBranches(branchType), (branches) => { Branches.Add(branchType, branches); DisplayBranchDatas(); });
119+
_task.LoadAsync(() => GetBranches(branchType), (branches) => { Branches.Add(branchType, branches); DisplayBranchDatas(); });
120120
}
121121
else
122122
{

‎Plugins/JiraCommitHintPlugin/JiraCommitHintPlugin.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public override bool Execute(GitUIBaseEventArgs gitUiCommands)
6363
return false;
6464
}
6565

66-
GetMessageToCommit(_jira, _query, _stringTemplate).ContinueWith(t =>
66+
GetMessageToCommitAsync(_jira, _query, _stringTemplate).ContinueWith(t =>
6767
{
6868
MessageBox.Show(string.Join(Environment.NewLine, t.Result.Select(jt => jt.Text).ToArray()));
6969
});
@@ -129,7 +129,7 @@ private void btnPreviewClick(object sender, EventArgs eventArgs)
129129
var localJira = Jira.CreateRestClient(_urlSettings.CustomControl.Text, _userSettings.CustomControl.Text, _passwordSettings.CustomControl.Text);
130130
var localQuery = _jqlQuerySettings.CustomControl.Text;
131131
var localStringTemplate = _stringTemplateSetting.CustomControl.Text;
132-
GetMessageToCommit(localJira, localQuery, localStringTemplate).ContinueWith(t =>
132+
GetMessageToCommitAsync(localJira, localQuery, localStringTemplate).ContinueWith(t =>
133133
{
134134
var preview = t.Result.FirstOrDefault();
135135
MessageBox.Show(null, preview == null ? EmptyQueryResultMessage : preview.Text, EmptyQueryResultCaption);
@@ -205,7 +205,7 @@ private void gitUiCommands_PreCommit(object sender, GitUIBaseEventArgs e)
205205
return;
206206
}
207207

208-
GetMessageToCommit(_jira, _query, _stringTemplate).ContinueWith(t =>
208+
GetMessageToCommitAsync(_jira, _query, _stringTemplate).ContinueWith(t =>
209209
{
210210
_currentMessages = t.Result;
211211
foreach (var message in _currentMessages)
@@ -235,7 +235,7 @@ private void gitUiCommands_PostRepositoryChanged(object sender, GitUIBaseEventAr
235235
_currentMessages = null;
236236
}
237237

238-
private static async Task<JiraTaskDTO[]> GetMessageToCommit(Jira jira, string query, string stringTemplate)
238+
private static async Task<JiraTaskDTO[]> GetMessageToCommitAsync(Jira jira, string query, string stringTemplate)
239239
{
240240
try
241241
{

0 commit comments

Comments
 (0)
Please sign in to comment.