async
should have their names suffixed with Async
CS-R1073Task
does not follow the naming convention366 /// <exception cref="PureManApplicationDeployment.ClickOnceDeploymentException">Version info is empty!</exception>
367 /// <inheritdoc cref="CancellationToken.ThrowIfCancellationRequested"/>
368 /// <inheritdoc cref="Version.Version(string)"/>
369 private async Task<Version> ReadServerManifest(Stream stream, CancellationToken? token)370 {
371 var cToken = token ?? new CancellationTokenSource(DefaultCancellationTime).Token;
372 var xmlDoc = await XDocument.LoadAsync(stream, LoadOptions.None, cToken);
Task
does not follow the naming convention332 /// <returns>Task<Version>.</returns>
333 /// <exception cref="PureManApplicationDeployment.ClickOnceDeploymentException">No network install was set</exception>
334 /// <inheritdoc cref="ReadServerManifest(Stream, CancellationToken?)"/>
335 public async Task<Version> RefreshServerVersion(CancellationToken? token = default)336 {
337 if (_From == InstallFrom.Web)
338 {
Task
does not follow the naming convention288 /// <exception cref="PureManApplicationDeployment.ClickOnceDeploymentException">Can't find manifest file at path {path}</exception>
289 /// <exception cref="PureManApplicationDeployment.ClickOnceDeploymentException">Invalid manifest document for {path}</exception>
290 /// <exception cref="PureManApplicationDeployment.ClickOnceDeploymentException">Version info is empty!</exception>
291 public async Task<Version> RefreshCurrentVersion()292 {
293 if (!IsNetworkDeployment)
294 {
The consensus in .NET is to have names of methods dealing with async
hronous operations suffixed with Async
. One such example is Stream.ReadAsync
from System.IO
. Doing so improves readability and provides crucial information at a glance.
public virtual System.Threading.Tasks.ValueTask<int> Read (Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.ValueTask<int> ReadAsync (Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default);