-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fba62c
commit a65fc48
Showing
21 changed files
with
1,068 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace Durian.Analysis; | ||
|
||
/// <summary> | ||
/// <see cref="IHintNameProvider"/> implementation that always returns the same hint name. | ||
/// </summary> | ||
public sealed class StaticHintNameProvider : IHintNameProvider | ||
{ | ||
private readonly string _hintName; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="StaticHintNameProvider"/> class. | ||
/// </summary> | ||
/// <param name="hintName">Hint name to always return.</param> | ||
public StaticHintNameProvider(string hintName) | ||
{ | ||
if (string.IsNullOrWhiteSpace(hintName)) | ||
{ | ||
throw new ArgumentException("Value cannot be null or empty", nameof(hintName)); | ||
} | ||
|
||
_hintName = hintName; | ||
} | ||
|
||
/// <summary> | ||
/// Returns the current hint name. | ||
/// </summary> | ||
public string GetHintName() | ||
{ | ||
return _hintName; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void Initialize() | ||
{ | ||
// Do nothing. | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void Reset() | ||
{ | ||
// Do nothing. | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void Success() | ||
{ | ||
// Do nothing. | ||
} | ||
|
||
string IHintNameProvider.GetHintName(ISymbol symbol) | ||
{ | ||
return GetHintName(); | ||
} | ||
|
||
string IHintNameProvider.GetHintName(string symbolName) | ||
{ | ||
return GetHintName(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 15 additions & 3 deletions
18
...rvices/Logging/_intf/IHintNameProvider.cs → ...alysisServices/_intf/IHintNameProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.