public static void Register() { if(HttpContextHandler.Instance.Current == null || registered || DisableEmbeddedResources) { return; } lock(padLock) { if(!registered) { var resource = new VirtualResourceFile(ScriptPath, ScriptResourceName, typeof(ResourceRegistrator).Assembly); var pathProvider = new VirtualResourcePathProvider(new[] { resource }); HostingEnvironment.RegisterVirtualPathProvider(pathProvider); registered = true; } } }
public static void Register() { if(HttpContextHandler.Instance.Current == null || registered || DisableEmbeddedResources) { return; } lock(padLock) { if(!registered) { var resources = GetResources(); var pathProvider = new VirtualResourcePathProvider(resources); HostingEnvironment.RegisterVirtualPathProvider(pathProvider); registered = true; } } }