|
5 | 5 |
|
6 | 6 | namespace Microsoft.DevProxy.Abstractions;
|
7 | 7 |
|
8 |
| -public abstract class BaseProxyPlugin: IProxyPlugin { |
9 |
| - protected ISet<UrlToWatch>? _urlsToWatch; |
10 |
| - protected ILogger? _logger; |
11 |
| - |
12 |
| - public virtual string Name => throw new NotImplementedException(); |
13 |
| - public virtual void Register(IPluginEvents pluginEvents, |
14 |
| - IProxyContext context, |
15 |
| - ISet<UrlToWatch> urlsToWatch, |
16 |
| - IConfigurationSection? configSection = null) { |
17 |
| - if (pluginEvents is null) { |
18 |
| - throw new ArgumentNullException(nameof(pluginEvents)); |
19 |
| - } |
| 8 | +public abstract class BaseProxyPlugin : IProxyPlugin |
| 9 | +{ |
| 10 | + protected ISet<UrlToWatch>? _urlsToWatch; |
| 11 | + protected ILogger? _logger; |
20 | 12 |
|
21 |
| - if (context is null || context.Logger is null) { |
22 |
| - throw new ArgumentException($"{nameof(context)} must not be null and must supply a non-null Logger", nameof(context)); |
23 |
| - |
24 |
| - } |
| 13 | + public virtual string Name => throw new NotImplementedException(); |
| 14 | + public virtual void Register(IPluginEvents pluginEvents, |
| 15 | + IProxyContext context, |
| 16 | + ISet<UrlToWatch> urlsToWatch, |
| 17 | + IConfigurationSection? configSection = null) |
| 18 | + { |
| 19 | + if (pluginEvents is null) |
| 20 | + { |
| 21 | + throw new ArgumentNullException(nameof(pluginEvents)); |
| 22 | + } |
25 | 23 |
|
26 |
| - if (urlsToWatch is null || urlsToWatch.Count == 0) { |
27 |
| - throw new ArgumentException($"{nameof(urlsToWatch)} cannot be null or empty", nameof(urlsToWatch)); |
28 |
| - } |
| 24 | + if (context is null || context.Logger is null) |
| 25 | + { |
| 26 | + throw new ArgumentException($"{nameof(context)} must not be null and must supply a non-null Logger", nameof(context)); |
29 | 27 |
|
30 |
| - _urlsToWatch = urlsToWatch; |
31 |
| - _logger = context.Logger; |
32 |
| - } |
| 28 | + } |
| 29 | + |
| 30 | + if (urlsToWatch is null || urlsToWatch.Count == 0) |
| 31 | + { |
| 32 | + throw new ArgumentException($"{nameof(urlsToWatch)} cannot be null or empty", nameof(urlsToWatch)); |
| 33 | + } |
| 34 | + |
| 35 | + _urlsToWatch = urlsToWatch; |
| 36 | + _logger = context.Logger; |
| 37 | + } |
33 | 38 | }
|
0 commit comments