Browse Source

Shift cache plugin to proper namespace.

Former-commit-id: 2c67033c07f6935497ac1ee9a9ec402440aa460c
Former-commit-id: 4f9e13319e4d04f8a01819d8f68d1b32fefcf58f
pull/17/head
James South 11 years ago
parent
commit
bc68a50fd6
  1. 8
      build/NuSpecs/ImageProcessor.Web.Plugins.AzureBlobCache.nuspec
  2. 10
      build/build.xml
  3. 0
      build/content/ImageProcessor.Web.Plugins.AzureBlobCache/config/imageprocessor/cache.config.transform
  4. BIN
      build/content/imageprocessor.128.png
  5. 4
      src/ImageProcessor.Playground/ImageProcessor.Playground.csproj
  6. 7
      src/ImageProcessor.Web/Caching/CacheIndexer.cs
  7. 14
      src/ImageProcessor.sln
  8. 3
      src/Plugins/ImageProcessor.Web/ImageProcessor.Web.Plugins.AzureBlobCache/AzureBlobCache.cs
  9. 31
      src/Plugins/ImageProcessor.Web/ImageProcessor.Web.Plugins.AzureBlobCache/ImageProcessor.Web.Plugins.AzureBlobCache.csproj
  10. 0
      src/Plugins/ImageProcessor.Web/ImageProcessor.Web.Plugins.AzureBlobCache/Properties/AssemblyInfo.cs
  11. 0
      src/Plugins/ImageProcessor.Web/ImageProcessor.Web.Plugins.AzureBlobCache/packages.config
  12. 4
      src/TestWebsites/MVC/Test_Website_MVC.csproj
  13. 2
      src/packages/repositories.config

8
build/NuSpecs/ImageProcessor.Web.AzureBlobCache.nuspec → build/NuSpecs/ImageProcessor.Web.Plugins.AzureBlobCache.nuspec

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata> <metadata>
<id>ImageProcessor.Web.AzureBlobCache</id> <id>ImageProcessor.Web.Plugins.AzureBlobCache</id>
<version>1.0.0.0</version> <version>1.0.0.0</version>
<title>ImageProcessor.Web.AzureBlobCache</title> <title>ImageProcessor.Web.Plugins.AzureBlobCache</title>
<authors>James South</authors> <authors>James South</authors>
<owners>James South</owners> <owners>James South</owners>
<projectUrl>http://imageprocessor.org</projectUrl> <projectUrl>http://imageprocessor.org</projectUrl>
@ -34,7 +34,7 @@ Feedback is always welcome</description>
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>
<file src="..\content\ImageProcessor.Web.AzureBlobCache\config\imageprocessor\cache.config.transform" target="content\config\imageprocessor\cache.config.transform" /> <file src="..\content\ImageProcessor.Web.Plugins.AzureBlobCache\config\imageprocessor\cache.config.transform" target="content\config\imageprocessor\cache.config.transform" />
<file src="..\_BuildOutput\ImageProcessor.Web.AzureBlobCache\lib\net45\ImageProcessor.Web.Caching.AzureBlobCache.dll" target="lib\net45\ImageProcessor.Web.Caching.AzureBlobCache.dll" /> <file src="..\_BuildOutput\ImageProcessor.Web.Plugins.AzureBlobCache\lib\net45\ImageProcessor.Web.Plugins.AzureBlobCache.dll" target="lib\net45\ImageProcessor.Web.Plugins.AzureBlobCache.dll" />
</files> </files>
</package> </package>

10
build/build.xml

@ -23,14 +23,14 @@
</project> </project>
<project> <project>
<name>ImageProcessor Web Azure Blob Cache</name> <name>ImageProcessor Web Azure Blob Cache plugin</name>
<version>1.0.0.0</version> <version>1.0.0.0</version>
<folder>..\src\ImageProcessor.Web.AzureBlobCache</folder> <folder>..\src\Plugins\ImageProcessor.Web\ImageProcessor.Web.Plugins.AzureBlobCache</folder>
<projfile>ImageProcessor.Web.AzureBlobCache.csproj</projfile> <projfile>ImageProcessor.Web.Plugins.AzureBlobCache.csproj</projfile>
<outputs> <outputs>
<output folder="ImageProcessor.Web.AzureBlobCache\lib\net45" /> <output folder="ImageProcessor.Web.Plugins.AzureBlobCache\lib\net45" />
</outputs> </outputs>
<nuspec>ImageProcessor.Web.AzureBlobCache.nuspec</nuspec> <nuspec>ImageProcessor.Web.Plugins.AzureBlobCache.nuspec</nuspec>
</project> </project>
<project> <project>

0
build/content/ImageProcessor.Web.AzureBlobCache/config/imageprocessor/cache.config.transform → build/content/ImageProcessor.Web.Plugins.AzureBlobCache/config/imageprocessor/cache.config.transform

BIN
build/content/imageprocessor.128.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

4
src/ImageProcessor.Playground/ImageProcessor.Playground.csproj

@ -55,9 +55,9 @@
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ImageProcessor.Web.AzureBlobCache\ImageProcessor.Web.AzureBlobCache.csproj"> <ProjectReference Include="..\Plugins\ImageProcessor.Web\ImageProcessor.Web.Plugins.AzureBlobCache\ImageProcessor.Web.Plugins.AzureBlobCache.csproj">
<Project>{3c805e4c-d679-43f8-8c43-8909cdb4d4d7}</Project> <Project>{3c805e4c-d679-43f8-8c43-8909cdb4d4d7}</Project>
<Name>ImageProcessor.Web.AzureBlobCache</Name> <Name>ImageProcessor.Web.Plugins.AzureBlobCache</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\ImageProcessor.Web\ImageProcessor.Web.csproj"> <ProjectReference Include="..\ImageProcessor.Web\ImageProcessor.Web.csproj">
<Project>{d011a778-59c8-4bfa-a770-c350216bf161}</Project> <Project>{d011a778-59c8-4bfa-a770-c350216bf161}</Project>

7
src/ImageProcessor.Web/Caching/CacheIndexer.cs

@ -64,17 +64,18 @@ namespace ImageProcessor.Web.Caching
/// </returns> /// </returns>
public static CachedImage Add(CachedImage cachedImage) public static CachedImage Add(CachedImage cachedImage)
{ {
// Add the CachedImage with a sliding expiration of 10 minutes.
CacheItemPolicy policy = new CacheItemPolicy { SlidingExpiration = new TimeSpan(0, 10, 0) };
if (new Uri(cachedImage.Path).IsFile) if (new Uri(cachedImage.Path).IsFile)
{ {
// Add the CachedImage.
CacheItemPolicy policy = new CacheItemPolicy();
policy.ChangeMonitors.Add(new HostFileChangeMonitor(new List<string> { cachedImage.Path })); policy.ChangeMonitors.Add(new HostFileChangeMonitor(new List<string> { cachedImage.Path }));
MemCache.AddItem(Path.GetFileNameWithoutExtension(cachedImage.Key), cachedImage, policy); MemCache.AddItem(Path.GetFileNameWithoutExtension(cachedImage.Key), cachedImage, policy);
} }
else else
{ {
MemCache.AddItem(Path.GetFileNameWithoutExtension(cachedImage.Key), cachedImage); MemCache.AddItem(Path.GetFileNameWithoutExtension(cachedImage.Key), cachedImage, policy);
} }
return cachedImage; return cachedImage;

14
src/ImageProcessor.sln

@ -28,7 +28,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessor.Playground",
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessor.Web.PostProcessor", "ImageProcessor.Web.PostProcessor\ImageProcessor.Web.PostProcessor.csproj", "{55D08737-7D7E-4995-8892-BD9F944329E6}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessor.Web.PostProcessor", "ImageProcessor.Web.PostProcessor\ImageProcessor.Web.PostProcessor.csproj", "{55D08737-7D7E-4995-8892-BD9F944329E6}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessor.Web.AzureBlobCache", "ImageProcessor.Web.AzureBlobCache\ImageProcessor.Web.AzureBlobCache.csproj", "{3C805E4C-D679-43F8-8C43-8909CDB4D4D7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageProcessor.Web.Plugins.AzureBlobCache", "Plugins\ImageProcessor.Web\ImageProcessor.Web.Plugins.AzureBlobCache\ImageProcessor.Web.Plugins.AzureBlobCache.csproj", "{3C805E4C-D679-43F8-8C43-8909CDB4D4D7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{B5217BED-B0B7-408E-81B7-877DE2BF9036}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{5D12E196-FB7A-4D97-B156-56901EF8084D}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -197,6 +201,14 @@ Global
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2CF69699-959A-44DC-A281-4E2596C25043} = {5D12E196-FB7A-4D97-B156-56901EF8084D}
{961340C8-8C93-401D-A0A2-FF9EC61E5260} = {B5217BED-B0B7-408E-81B7-877DE2BF9036}
{633B1C4C-4823-47BE-9A01-A665F3118C8C} = {B5217BED-B0B7-408E-81B7-877DE2BF9036}
{F6A208E9-C18F-43E9-B051-3C6EED30FDAF} = {B5217BED-B0B7-408E-81B7-877DE2BF9036}
{C7D1F0DD-CBD6-4127-82B4-51949EFF0BF5} = {5D12E196-FB7A-4D97-B156-56901EF8084D}
{3C805E4C-D679-43F8-8C43-8909CDB4D4D7} = {5D12E196-FB7A-4D97-B156-56901EF8084D}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = ImageProcessorConsole\ImageProcessorConsole.csproj StartupItem = ImageProcessorConsole\ImageProcessorConsole.csproj
EndGlobalSection EndGlobalSection

3
src/ImageProcessor.Web.AzureBlobCache/AzureBlobCache.cs → src/Plugins/ImageProcessor.Web/ImageProcessor.Web.Plugins.AzureBlobCache/AzureBlobCache.cs

@ -9,7 +9,7 @@
// </summary> // </summary>
// -------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------
namespace ImageProcessor.Web.Caching namespace ImageProcessor.Web.Plugins.AzureBlobCache
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -21,6 +21,7 @@ namespace ImageProcessor.Web.Caching
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Web; using System.Web;
using ImageProcessor.Web.Caching;
using ImageProcessor.Web.Extensions; using ImageProcessor.Web.Extensions;
using ImageProcessor.Web.Helpers; using ImageProcessor.Web.Helpers;
using ImageProcessor.Web.HttpModules; using ImageProcessor.Web.HttpModules;

31
src/ImageProcessor.Web.AzureBlobCache/ImageProcessor.Web.AzureBlobCache.csproj → src/Plugins/ImageProcessor.Web/ImageProcessor.Web.Plugins.AzureBlobCache/ImageProcessor.Web.Plugins.AzureBlobCache.csproj

@ -7,8 +7,8 @@
<ProjectGuid>{3C805E4C-D679-43F8-8C43-8909CDB4D4D7}</ProjectGuid> <ProjectGuid>{3C805E4C-D679-43F8-8C43-8909CDB4D4D7}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ImageProcessor.Web.Caching</RootNamespace> <RootNamespace>ImageProcessor.Web.Plugins.AzureBlobCache</RootNamespace>
<AssemblyName>ImageProcessor.Web.Caching.AzureBlobCache</AssemblyName> <AssemblyName>ImageProcessor.Web.Plugins.AzureBlobCache</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
@ -32,34 +32,33 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.Data.Edm"> <Reference Include="Microsoft.Data.Edm, Version=5.6.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Edm.5.6.2\lib\net40\Microsoft.Data.Edm.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<Private>True</Private> <HintPath>..\..\..\packages\Microsoft.Data.Edm.5.6.2\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Data.OData"> <Reference Include="Microsoft.Data.OData, Version=5.6.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.OData.5.6.2\lib\net40\Microsoft.Data.OData.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<Private>True</Private> <HintPath>..\..\..\packages\Microsoft.Data.OData.5.6.2\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.Data.Services.Client, Version=5.6.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Data.Services.Client.5.6.2\lib\net40\Microsoft.Data.Services.Client.dll</HintPath> <HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.6.2\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration"> <Reference Include="Microsoft.WindowsAzure.Configuration">
<HintPath>..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll</HintPath> <HintPath>..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.WindowsAzure.Storage"> <Reference Include="Microsoft.WindowsAzure.Storage">
<HintPath>..\packages\WindowsAzure.Storage.4.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath> <HintPath>..\..\..\packages\WindowsAzure.Storage.4.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json"> <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\..\..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Spatial, Version=5.6.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="System.Spatial, Version=5.6.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\System.Spatial.5.6.2\lib\net40\System.Spatial.dll</HintPath> <HintPath>..\..\..\packages\System.Spatial.5.6.2\lib\net40\System.Spatial.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
@ -73,7 +72,7 @@
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ImageProcessor.Web\ImageProcessor.Web.csproj"> <ProjectReference Include="..\..\..\ImageProcessor.Web\ImageProcessor.Web.csproj">
<Project>{d011a778-59c8-4bfa-a770-c350216bf161}</Project> <Project>{d011a778-59c8-4bfa-a770-c350216bf161}</Project>
<Name>ImageProcessor.Web</Name> <Name>ImageProcessor.Web</Name>
</ProjectReference> </ProjectReference>

0
src/ImageProcessor.Web.AzureBlobCache/Properties/AssemblyInfo.cs → src/Plugins/ImageProcessor.Web/ImageProcessor.Web.Plugins.AzureBlobCache/Properties/AssemblyInfo.cs

0
src/ImageProcessor.Web.AzureBlobCache/packages.config → src/Plugins/ImageProcessor.Web/ImageProcessor.Web.Plugins.AzureBlobCache/packages.config

4
src/TestWebsites/MVC/Test_Website_MVC.csproj

@ -152,9 +152,9 @@
<Content Include="Views\Home\Index.cshtml" /> <Content Include="Views\Home\Index.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\ImageProcessor.Web.AzureBlobCache\ImageProcessor.Web.AzureBlobCache.csproj"> <ProjectReference Include="..\..\Plugins\ImageProcessor.Web\ImageProcessor.Web.Plugins.AzureBlobCache\ImageProcessor.Web.Plugins.AzureBlobCache.csproj">
<Project>{3c805e4c-d679-43f8-8c43-8909cdb4d4d7}</Project> <Project>{3c805e4c-d679-43f8-8c43-8909cdb4d4d7}</Project>
<Name>ImageProcessor.Web.AzureBlobCache</Name> <Name>ImageProcessor.Web.Plugins.AzureBlobCache</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\ImageProcessor.Web.PostProcessor\ImageProcessor.Web.PostProcessor.csproj"> <ProjectReference Include="..\..\ImageProcessor.Web.PostProcessor\ImageProcessor.Web.PostProcessor.csproj">
<Project>{55d08737-7d7e-4995-8892-bd9f944329e6}</Project> <Project>{55d08737-7d7e-4995-8892-bd9f944329e6}</Project>

2
src/packages/repositories.config

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<repositories> <repositories>
<repository path="..\ImageProcessor.UnitTests\packages.config" /> <repository path="..\ImageProcessor.UnitTests\packages.config" />
<repository path="..\ImageProcessor.Web.AzureBlobCache\packages.config" />
<repository path="..\ImageProcessor.Web.UnitTests\packages.config" /> <repository path="..\ImageProcessor.Web.UnitTests\packages.config" />
<repository path="..\Plugins\ImageProcessor.Web\ImageProcessor.Web.Plugins.AzureBlobCache\packages.config" />
<repository path="..\TestWebsites\MVC\packages.config" /> <repository path="..\TestWebsites\MVC\packages.config" />
</repositories> </repositories>
Loading…
Cancel
Save