Skip to content

Commit 171723b

Browse files
committed
Applied cleanup for IDE0090 to the solution.
1 parent bb86103 commit 171723b

File tree

385 files changed

+1065
-1061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

385 files changed

+1065
-1061
lines changed

src/BuiltInTools/BrowserRefresh/BrowserRefreshMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Watch.BrowserRefresh
1111
{
1212
public class BrowserRefreshMiddleware
1313
{
14-
private static readonly MediaTypeHeaderValue _textHtmlMediaType = new MediaTypeHeaderValue("text/html");
14+
private static readonly MediaTypeHeaderValue _textHtmlMediaType = new("text/html");
1515
private readonly RequestDelegate _next;
1616
private readonly ILogger _logger;
1717

src/BuiltInTools/BrowserRefresh/ResponseStreamWrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Watch.BrowserRefresh
1515
/// </summary>
1616
public class ResponseStreamWrapper : Stream
1717
{
18-
private static readonly MediaTypeHeaderValue _textHtmlMediaType = new MediaTypeHeaderValue("text/html");
18+
private static readonly MediaTypeHeaderValue _textHtmlMediaType = new("text/html");
1919
private readonly Stream _baseStream;
2020
private readonly HttpContext _context;
2121
private readonly ILogger _logger;

src/BuiltInTools/dotnet-watch/Filters/LaunchBrowserFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Microsoft.DotNet.Watcher.Tools
1010
{
1111
internal sealed class LaunchBrowserFilter : IWatchFilter, IAsyncDisposable
1212
{
13-
private static readonly Regex NowListeningRegex = new Regex(@"Now listening on: (?<url>.*)\s*$", RegexOptions.None | RegexOptions.Compiled, TimeSpan.FromSeconds(10));
13+
private static readonly Regex NowListeningRegex = new(@"Now listening on: (?<url>.*)\s*$", RegexOptions.None | RegexOptions.Compiled, TimeSpan.FromSeconds(10));
1414
private readonly DotNetWatchOptions _options;
1515
private readonly string? _browserPath;
1616
private bool _attemptedBrowserLaunch;

src/BuiltInTools/dotnet-watch/HotReload/HotReloadEventSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ internal sealed class Keywords
2828
[Event(2, Message = "Hot reload finished for {0}", Level = EventLevel.Informational, Keywords = Keywords.Perf)]
2929
public void HotReloadEnd(StartType handlerType) { WriteEvent(2, handlerType); }
3030

31-
public static readonly HotReloadEventSource Log = new HotReloadEventSource();
31+
public static readonly HotReloadEventSource Log = new();
3232
}
3333
}

src/BuiltInTools/dotnet-watch/Internal/ConsoleReporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.Extensions.Tools.Internal
1212
/// </summary>
1313
internal sealed class ConsoleReporter : IReporter
1414
{
15-
private readonly object _writeLock = new object();
15+
private readonly object _writeLock = new();
1616

1717
public ConsoleReporter(IConsole console)
1818
: this(console, verbose: false, quiet: false, suppressEmojis: false)

src/BuiltInTools/dotnet-watch/Internal/ConsoleRequester.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.Extensions.Tools.Internal
1212
/// </summary>
1313
internal sealed class ConsoleRequester : IRequester
1414
{
15-
private readonly object _writeLock = new object();
15+
private readonly object _writeLock = new();
1616

1717
public ConsoleRequester(IConsole console, bool quiet, bool suppressEmojis)
1818
{

src/BuiltInTools/dotnet-watch/Internal/FileWatcher/DotnetFileWatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class DotnetFileWatcher : IFileSystemWatcher
1616

1717
private FileSystemWatcher _fileSystemWatcher;
1818

19-
private readonly object _createLock = new object();
19+
private readonly object _createLock = new();
2020

2121
public DotnetFileWatcher(string watchedDirectory)
2222
: this(watchedDirectory, DefaultWatcherFactory)

src/BuiltInTools/dotnet-watch/Internal/FileWatcher/PollingFileWatcher.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ internal class PollingFileWatcher : IFileSystemWatcher
1515

1616
private readonly DirectoryInfo _watchedDirectory;
1717

18-
private Dictionary<string, FileMeta> _knownEntities = new Dictionary<string, FileMeta>();
19-
private Dictionary<string, FileMeta> _tempDictionary = new Dictionary<string, FileMeta>();
20-
private HashSet<string> _changes = new HashSet<string>();
18+
private Dictionary<string, FileMeta> _knownEntities = new();
19+
private Dictionary<string, FileMeta> _tempDictionary = new();
20+
private HashSet<string> _changes = new();
2121

2222
private Thread _pollingThread;
2323
private bool _raiseEvents;

src/BuiltInTools/dotnet-watch/Internal/OutputCapture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.DotNet.Watcher.Internal
88
{
99
internal sealed class OutputCapture
1010
{
11-
private readonly List<string> _lines = new List<string>();
11+
private readonly List<string> _lines = new();
1212
public IEnumerable<string> Lines => _lines;
1313
public void AddLine(string line) => _lines.Add(line);
1414
}

src/BuiltInTools/dotnet-watch/Internal/ProcessRunner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private class ProcessState : IDisposable
165165
{
166166
private readonly IReporter _reporter;
167167
private readonly Process _process;
168-
private readonly TaskCompletionSource _tcs = new TaskCompletionSource();
168+
private readonly TaskCompletionSource _tcs = new();
169169
private volatile bool _disposed;
170170

171171
public ProcessState(Process process, IReporter reporter)

0 commit comments

Comments
 (0)