Files
cefsharp/CefSharp/ResourceHandler.cs
T
amaitland 30c8cf9248 Make ToHeaderMap static in SchemeHandlerWrapper (Needs to be moved to a common place in the future)
Get basic CefStreamResourceHandler compiling
Add headers and status codes to ResourceHandler
2014-11-18 12:03:59 +10:00

30 lines
716 B
C#

// Copyright © 2010-2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System.Collections.Specialized;
using System.IO;
namespace CefSharp
{
public class ResourceHandler
{
public string MimeType { get; set; }
public Stream Stream { get; set; }
public int StatusCode { get; set; }
public string StatusText { get; set; }
public NameValueCollection Headers { get; set; }
public ResourceHandler()
{
StatusCode = 200;
StatusText = "OK";
}
public static ResourceHandler FromFileName(string fileName)
{
return new ResourceHandler { Stream = File.OpenRead(fileName) };
}
}
}