-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
184 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0"?> | ||
<package > | ||
<metadata> | ||
<id>Sitemapify.CastleWindsor</id> | ||
<title>Sitemapify Castle Windsor Adapter</title> | ||
<description>Provides a castle windsor adapter for the sitemapify ASP.NET sitemap handler</description> | ||
<authors>Phil Oyston</authors> | ||
<owners>Phil Oyston</owners> | ||
<licenseUrl>https://raw.githubusercontent.com/stormid/sitemapify/master/LICENSE</licenseUrl> | ||
<projectUrl>https://github.com/stormid/sitemapify</projectUrl> | ||
<iconUrl>https://raw.githubusercontent.com/stormid/sitemapify/master/docs/img/sitemap.png</iconUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<tags>sitemap seo webforms mvc castle windsor</tags> | ||
<frameworkAssemblies> | ||
<frameworkAssembly assemblyName="System.Web" targetFramework="net40" /> | ||
</frameworkAssemblies> | ||
</metadata> | ||
<files> | ||
<file src="**/*" target="" /> | ||
</files> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/Sitemapify.CastleWindsor/CastleWindsorSitemapifyContainerAdapter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Castle.Core.Configuration; | ||
using Castle.MicroKernel; | ||
using Sitemapify.Config; | ||
|
||
namespace Sitemapify.CastleWindsor | ||
{ | ||
public class CastleWindsorSitemapifyContainerAdapter : ISitemapContainerAdapter | ||
{ | ||
private readonly IKernel _kernel; | ||
public CastleWindsorSitemapifyContainerAdapter(IKernel kernel) | ||
{ | ||
_kernel = kernel; | ||
} | ||
|
||
public T Resolve<T>() where T : class | ||
{ | ||
if (_kernel.HasComponent(typeof (T))) return _kernel.Resolve<T>(); | ||
return null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using System.Reflection; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("Sitemapify.CastleWindsor")] |
75 changes: 75 additions & 0 deletions
75
src/Sitemapify.CastleWindsor/Sitemapify.CastleWindsor.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{D8A6AE48-A51D-4CF4-BCD1-47036A7443D4}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Sitemapify.CastleWindsor</RootNamespace> | ||
<AssemblyName>Sitemapify.CastleWindsor</AssemblyName> | ||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> | ||
<HintPath>..\..\packages\Castle.Core.3.3.0\lib\net45\Castle.Core.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Castle.Windsor, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL"> | ||
<HintPath>..\..\packages\Castle.Windsor.3.3.0\lib\net45\Castle.Windsor.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="..\..\VersionAssemblyInfo.cs"> | ||
<Link>Properties\VersionAssemblyInfo.cs</Link> | ||
</Compile> | ||
<Compile Include="CastleWindsorSitemapifyContainerAdapter.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="SitemapifyWindsorInstaller.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Sitemapify\Sitemapify.csproj"> | ||
<Project>{16ed145c-cd29-4063-95c0-bd7c46d86d18}</Project> | ||
<Name>Sitemapify</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
24 changes: 24 additions & 0 deletions
24
src/Sitemapify.CastleWindsor/SitemapifyWindsorInstaller.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Castle.MicroKernel.Registration; | ||
using Castle.MicroKernel.SubSystems.Configuration; | ||
using Castle.Windsor; | ||
using Sitemapify.Builders; | ||
using Sitemapify.Builders.Impl; | ||
using Sitemapify.Providers; | ||
using Sitemapify.Providers.Impl; | ||
|
||
namespace Sitemapify.CastleWindsor | ||
{ | ||
public class SitemapifyWindsorInstaller : IWindsorInstaller | ||
{ | ||
public void Install(IWindsorContainer container, IConfigurationStore store) | ||
{ | ||
container.Register( | ||
Component.For<ISitemapContentProvider>().ImplementedBy<EmptySitemapContentProvider>().IsFallback().LifestylePerWebRequest(), | ||
Component.For<ISitemapCacheProvider>().ImplementedBy<DefaultSitemapCacheProvider>().IsFallback().LifestylePerWebRequest(), | ||
Component.For<ISitemapDocumentBuilder>().ImplementedBy<DefaultSitemapDocumentBuilder>().IsFallback().LifestylePerWebRequest() | ||
); | ||
|
||
Configure.With(new CastleWindsorSitemapifyContainerAdapter(container.Kernel)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Castle.Core" version="3.3.0" targetFramework="net45" /> | ||
<package id="Castle.Windsor" version="3.3.0" targetFramework="net45" /> | ||
</packages> |