-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #367 from ds5678/use-error-listener-while-building…
…-assemblies Use IErrorListener while building managed assemblies
- Loading branch information
Showing
12 changed files
with
308 additions
and
133 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
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 |
---|---|---|
@@ -1,35 +1,50 @@ | ||
using System; | ||
|
||
namespace AsmResolver.DotNet.Builder | ||
{ | ||
/// <summary> | ||
/// Provides a context in which a PE image construction takes place in. | ||
/// </summary> | ||
public class PEImageBuildContext | ||
{ | ||
/// <summary> | ||
/// Creates a new empty build context. | ||
/// </summary> | ||
public PEImageBuildContext() | ||
{ | ||
DiagnosticBag = new DiagnosticBag(); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new build context. | ||
/// </summary> | ||
/// <param name="diagnosticBag">The diagnostic bag to use.</param> | ||
public PEImageBuildContext(DiagnosticBag diagnosticBag) | ||
{ | ||
DiagnosticBag = diagnosticBag ?? throw new ArgumentNullException(nameof(diagnosticBag)); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the bag that collects all diagnostic information during the building process. | ||
/// </summary> | ||
public DiagnosticBag DiagnosticBag | ||
{ | ||
get; | ||
} | ||
} | ||
} | ||
using System; | ||
|
||
namespace AsmResolver.DotNet.Builder | ||
{ | ||
/// <summary> | ||
/// Provides a context in which a PE image construction takes place in. | ||
/// </summary> | ||
public class PEImageBuildContext | ||
{ | ||
/// <summary> | ||
/// Creates a new empty build context. | ||
/// </summary> | ||
public PEImageBuildContext() | ||
{ | ||
ErrorListener = new DiagnosticBag(); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new build context. | ||
/// </summary> | ||
/// <param name="diagnosticBag">The diagnostic bag to use.</param> | ||
public PEImageBuildContext(DiagnosticBag diagnosticBag) | ||
{ | ||
ErrorListener = diagnosticBag ?? throw new ArgumentNullException(nameof(diagnosticBag)); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new build context. | ||
/// </summary> | ||
/// <param name="errorListener">The diagnostic bag to use.</param> | ||
public PEImageBuildContext(IErrorListener errorListener) | ||
{ | ||
ErrorListener = errorListener ?? throw new ArgumentNullException(nameof(errorListener)); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the bag that collects all diagnostic information during the building process. | ||
/// </summary> | ||
[Obsolete("Use ErrorListener instead.")] | ||
public DiagnosticBag? DiagnosticBag => ErrorListener as DiagnosticBag; | ||
|
||
/// <summary> | ||
/// Gets the error listener that handles all diagnostic information during the building process. | ||
/// </summary> | ||
public IErrorListener ErrorListener | ||
{ | ||
get; | ||
} | ||
} | ||
} |
Oops, something went wrong.