Skip to content

Commit

Permalink
Adaption to Silversite
Browse files Browse the repository at this point in the history
  • Loading branch information
David Egli committed Mar 23, 2013
1 parent 86224cd commit 6df47d0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions XamlImageConverter.Web/XamlImageConverter.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Elements.cs" />
<Compile Include="HttpHandler.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="XamlControls.cs" />
<Compile Include="XamlImageConverterLazyHandler.cs" />
<Compile Include="XamlImgeConverterElements.cs" />
</ItemGroup>
<ItemGroup>
<None Include="sgKey.snk" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
using System.IO;
using System.Reflection;
using System.Web;
#if Silversite
using System.Configuration;
#endif


namespace Silversite.Web {

Expand Down Expand Up @@ -367,10 +371,10 @@ public class Hash: Silversite.Services.Hash { }
#endif

#if Silversite
[Configuration.ConfigurationSection(Name = "XamlImageConverter")]
public class Configuration : Silversite.Configuration.Section {
[Configuration.Section(Name = "XamlImageConverter")]
public class XamlImageConverterConfiguration : Silversite.Configuration.Section {
[ConfigurationProperty("UseService", IsRequired = false, DefaultValue = false)]
public bool UseSevice { get { return (bool)(this["UseService"] ?? true); } set { this["UseService"] = value; } }
public bool UseService { get { return (bool)(this["UseService"] ?? true); } set { this["UseService"] = value; } }
[ConfigurationProperty("Log", IsRequired = false, DefaultValue = true)]
public bool Log { get { return (bool)(this["Log"] ?? true); } set { this["Log"] = value; } }
[ConfigurationProperty("cache", IsRequired = false, DefaultValue = null)]
Expand All @@ -389,7 +393,7 @@ public class Configuration : Silversite.Configuration.Section {
public class XamlImageHandler : System.Web.IHttpHandler, System.Web.SessionState.IReadOnlySessionState {

#if Silversite
public static Configuration Configuration = new Configuration();
public static XamlImageConverterConfiguration Configuration = new XamlImageConverterConfiguration();
#endif

public bool IsReusable { get { return true; } }
Expand All @@ -406,7 +410,7 @@ public void ProcessRequest(System.Web.HttpContext context) {
#if Silversite
var handlerInfo = Services.Lazy.Types.Info("XamlImageConverter.XamlImageHandler");
handlerInfo.Load();
handler = handlerInfo.New();
handler = handlerInfo.New<IHttpHandler>();
#else
var a = Assembly.LoadFrom(context.Server.MapPath("~/Bin/Lazy/XamlImageConverter.dll"));
var type = a.GetType("XamlImageConverter.XamlImageHandler");
Expand Down
File renamed without changes.
Binary file modified XamlImageConverter.v11.suo
Binary file not shown.

0 comments on commit 6df47d0

Please sign in to comment.