public StartView CreateStartView()
{
// Compile the start view
if (!start_view_prepared)
{
start_view_prepared = true;
// Load the start view
string start_view_file = Service.Application.MapPath("/Views/_ViewStart.cshtml");
if (System.IO.File.Exists(start_view_file))
{
var compiler = new RazorViewCompiler();
compiler.BaseClass = typeof(StartView);
compiler.ViewFile = start_view_file;
start_view_type = compiler.CompileView();
}
}
// Do we have a start view?
if (start_view_type == null)
return null;
// Create it
return (StartView)Activator.CreateInstance(start_view_type);
}