25 lines
471 B
C#
25 lines
471 B
C#
namespace Shoko;
|
|
|
|
[Protocol("file")]
|
|
class FileProtoHandler : ProtoHandler
|
|
{
|
|
public FileProtoHandler(Uri url)
|
|
{
|
|
URL = url;
|
|
}
|
|
|
|
public override void Load()
|
|
{
|
|
var file = new UriBuilder(URL).Path;
|
|
|
|
var stream = new FileStream(file, FileMode.Open);
|
|
|
|
Content = stream;
|
|
MediaType = "text/plain"; // TODO: magic numbers
|
|
Status = "OK";
|
|
Loaded = true;
|
|
}
|
|
public override void Render()
|
|
{
|
|
}
|
|
} |