add fonts directory for folders.
Add mapping for IDocumentPathProvider Add implementation for IDocumentPathProvider
This commit is contained in:
parent
6268922ab0
commit
675479d2cf
@ -31,6 +31,7 @@ namespace RaceLapTimer
|
|||||||
container.Bind<IContainerHelper>().To<ContainerHelper>();
|
container.Bind<IContainerHelper>().To<ContainerHelper>();
|
||||||
container.Bind<IPluginPathProvider>().To<PluginPathProvider>();
|
container.Bind<IPluginPathProvider>().To<PluginPathProvider>();
|
||||||
container.Bind<IConfigFilePathProvider>().To<ConfigFilePathProvider>();
|
container.Bind<IConfigFilePathProvider>().To<ConfigFilePathProvider>();
|
||||||
|
container.Bind<IDocumentPathProvider>().To<DocumentPathProvider>();
|
||||||
container.Bind<IPluginLocator>().To<PluginLocator>();
|
container.Bind<IPluginLocator>().To<PluginLocator>();
|
||||||
container.Bind<IDbProvider>().To<TestProvider>().InSingletonScope();
|
container.Bind<IDbProvider>().To<TestProvider>().InSingletonScope();
|
||||||
//load dynamic plugins..:
|
//load dynamic plugins..:
|
||||||
@ -59,7 +60,7 @@ namespace RaceLapTimer
|
|||||||
// fs.Close(); //this still isnt saving the file.. :(
|
// fs.Close(); //this still isnt saving the file.. :(
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ConfigureRequestContainer(IKernel container, NancyContext context)
|
protected override void ConfigureRequestContainer(IKernel container, NancyContext context)
|
||||||
{
|
{
|
||||||
base.ConfigureRequestContainer(container, context);
|
base.ConfigureRequestContainer(container, context);
|
||||||
@ -83,7 +84,7 @@ namespace RaceLapTimer
|
|||||||
new FormsAuthenticationConfiguration()
|
new FormsAuthenticationConfiguration()
|
||||||
{
|
{
|
||||||
RedirectUrl = "~/login",
|
RedirectUrl = "~/login",
|
||||||
UserMapper = requestContainer.Get<IUserMapper>(),
|
UserMapper = requestContainer.Get<IUserMapper>(),
|
||||||
};
|
};
|
||||||
|
|
||||||
FormsAuthentication.Enable(pipelines, formsAuthConfiguration);
|
FormsAuthentication.Enable(pipelines, formsAuthConfiguration);
|
||||||
@ -97,19 +98,22 @@ namespace RaceLapTimer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IRootPathProvider RootPathProvider { get {return new NancyRootPathProvider();} }
|
protected override IRootPathProvider RootPathProvider { get { return new NancyRootPathProvider(); } }
|
||||||
|
|
||||||
protected override void ConfigureConventions(NancyConventions conventions)
|
protected override void ConfigureConventions(NancyConventions conventions)
|
||||||
{
|
{
|
||||||
base.ConfigureConventions(conventions);
|
base.ConfigureConventions(conventions);
|
||||||
conventions.StaticContentsConventions.Add(
|
conventions.StaticContentsConventions.Add(
|
||||||
StaticContentConventionBuilder.AddDirectory("images","images")
|
StaticContentConventionBuilder.AddDirectory("images", "images")
|
||||||
);
|
);
|
||||||
conventions.StaticContentsConventions.Add(
|
conventions.StaticContentsConventions.Add(
|
||||||
StaticContentConventionBuilder.AddDirectory("js", "js")
|
StaticContentConventionBuilder.AddDirectory("js", "js")
|
||||||
);
|
);
|
||||||
conventions.StaticContentsConventions.Add(
|
conventions.StaticContentsConventions.Add(
|
||||||
StaticContentConventionBuilder.AddDirectory("css","css")
|
StaticContentConventionBuilder.AddDirectory("css", "css")
|
||||||
|
);
|
||||||
|
conventions.StaticContentsConventions.Add(
|
||||||
|
StaticContentConventionBuilder.AddDirectory("fonts", "fonts")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
20
RaceLapTimer/RaceLapTimer/DocumentPathProvider.cs
Normal file
20
RaceLapTimer/RaceLapTimer/DocumentPathProvider.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using System.IO;
|
||||||
|
using Interfaces;
|
||||||
|
using Nancy;
|
||||||
|
|
||||||
|
namespace RaceLapTimer
|
||||||
|
{
|
||||||
|
class DocumentPathProvider : IDocumentPathProvider
|
||||||
|
{
|
||||||
|
private IRootPathProvider _rootPathProvider;
|
||||||
|
|
||||||
|
public DocumentPathProvider(IRootPathProvider rootPathProvider)
|
||||||
|
{
|
||||||
|
_rootPathProvider = rootPathProvider;
|
||||||
|
}
|
||||||
|
public string GetPath()
|
||||||
|
{
|
||||||
|
return Path.Combine(_rootPathProvider.GetRootPath(), "documents");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -114,6 +114,8 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="ApiControllers\OldRaceSessionApiModule.cs" />
|
||||||
|
<Compile Include="DocumentPathProvider.cs" />
|
||||||
<Compile Include="Extensions\FileExport\FileExportManager.cs" />
|
<Compile Include="Extensions\FileExport\FileExportManager.cs" />
|
||||||
<Compile Include="Extensions\PluginLocator.cs" />
|
<Compile Include="Extensions\PluginLocator.cs" />
|
||||||
<Compile Include="Extensions\SystemControl\SystemControlManager.cs" />
|
<Compile Include="Extensions\SystemControl\SystemControlManager.cs" />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user