Rename Microsoft.AspNet.* packages folders to Microsoft.AspNetCore.*

This commit is contained in:
SteveSandersonMS
2016-04-08 16:41:07 +01:00
parent 5a705f6dd6
commit 4a0e4bdf1a
99 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using System;
using System.IO;
using System.Reflection;
namespace Microsoft.AspNet.NodeServices {
public static class EmbeddedResourceReader {
public static string Read(Type assemblyContainingType, string path) {
var asm = assemblyContainingType.GetTypeInfo().Assembly;
var embeddedResourceName = asm.GetName().Name + path.Replace("/", ".");
using (var stream = asm.GetManifestResourceStream(embeddedResourceName))
using (var sr = new StreamReader(stream)) {
return sr.ReadToEnd();
}
}
}
}

View File

@@ -0,0 +1,39 @@
using System;
using System.IO;
namespace Microsoft.AspNet.NodeServices {
// Makes it easier to pass script files to Node in a way that's sure to clean up after the process exits
public sealed class StringAsTempFile : IDisposable {
public string FileName { get; private set; }
private bool _disposedValue;
public StringAsTempFile(string content) {
this.FileName = Path.GetTempFileName();
File.WriteAllText(this.FileName, content);
}
private void DisposeImpl(bool disposing)
{
if (!_disposedValue) {
if (disposing) {
// TODO: dispose managed state (managed objects).
}
File.Delete(this.FileName);
_disposedValue = true;
}
}
public void Dispose()
{
DisposeImpl(true);
GC.SuppressFinalize(this);
}
~StringAsTempFile() {
DisposeImpl(false);
}
}
}