mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 10:08:57 +00:00
Add XML docs to core packages
This commit is contained in:
@@ -3,19 +3,31 @@ using System.IO;
|
||||
|
||||
namespace Microsoft.AspNetCore.NodeServices
|
||||
{
|
||||
// Makes it easier to pass script files to Node in a way that's sure to clean up after the process exits
|
||||
/// <summary>
|
||||
/// Makes it easier to pass script files to Node in a way that's sure to clean up after the process exits.
|
||||
/// </summary>
|
||||
public sealed class StringAsTempFile : IDisposable
|
||||
{
|
||||
private bool _disposedValue;
|
||||
|
||||
/// <summary>
|
||||
/// Create a new instance of <see cref="StringAsTempFile"/>.
|
||||
/// </summary>
|
||||
/// <param name="content">The contents of the temporary file to be created.</param>
|
||||
public StringAsTempFile(string content)
|
||||
{
|
||||
FileName = Path.GetTempFileName();
|
||||
File.WriteAllText(FileName, content);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the filename of the temporary file.
|
||||
/// </summary>
|
||||
public string FileName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Disposes the instance and deletes the associated temporary file.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
DisposeImpl(true);
|
||||
@@ -37,6 +49,9 @@ namespace Microsoft.AspNetCore.NodeServices
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Implements the finalization part of the IDisposable pattern by calling Dispose(false).
|
||||
/// </summary>
|
||||
~StringAsTempFile()
|
||||
{
|
||||
DisposeImpl(false);
|
||||
|
||||
Reference in New Issue
Block a user