private void GenerateResourceFile(AssemblyBuilder assemblyBuilder, IResourceReader reader)
{
string str;
if (this._ns == null)
{
str = UrlPath.GetFileNameWithoutExtension(base.VirtualPath) + ".resources";
}
else if (this._cultureName == null)
{
str = this._ns + "." + this._typeName + ".resources";
}
else
{
str = this._ns + "." + this._typeName + "." + this._cultureName + ".resources";
}
str = str.ToLower(CultureInfo.InvariantCulture);
Stream stream = null;
try
{
try
{
try
{
}
finally
{
stream = assemblyBuilder.CreateEmbeddedResource(this, str);
}
}
catch (ArgumentException)
{
throw new HttpException(System.Web.SR.GetString("Duplicate_Resource_File", new object[] { base.VirtualPath }));
}
using (stream)
{
using (ResourceWriter writer = new ResourceWriter(stream))
{
writer.TypeNameConverter = new Func <Type, string>(TargetFrameworkUtil.TypeNameConverter);
foreach (DictionaryEntry entry in reader)
{
writer.AddResource((string)entry.Key, entry.Value);
}
}
}
}
finally
{
if (stream != null)
{
stream.Close();
}
}
}