コード例 #1
0
		public void CanHandleBundleResource()
		{
			IResource resource = new AssemblyBundleResource(new CustomUri("assembly://" + AssemblyName + "/Castle.Core.Tests.Resources.MoreRes.TestRes/content1"));

			Assert.IsNotNull(resource);
			String line = resource.GetStreamReader().ReadLine();
			Assert.AreEqual("Content content", line);
		}
コード例 #2
0
		public void RegisterAssemblyResource( string name, string location, string version, string assemblyName, string resourceName, string resourceEntry, string mimeType )
		{
			AssertParams( name, assemblyName, resourceName, resourceEntry, mimeType );
			
			CultureInfo invariantCulture = CultureInfo.InvariantCulture;

			if ( ( location != null ) && ( location != "neutral" ) )
			{
				invariantCulture = CultureInfo.CreateSpecificCulture( location );
			}

			IResource resource = new AssemblyBundleResource( new CustomUri( "assembly://" + assemblyName + "/" + resourceName + "/" + resourceEntry ), invariantCulture );
			
			_KeysToResources[ new ResourceKey( name, location, version ) ] = new ResourceHolder( resource, mimeType );
		}