internal ApplicationPart(IResourceAssembly assembly, string rootVirtualPath) { if (String.IsNullOrEmpty(rootVirtualPath)) { throw new ArgumentException( CommonResources.Argument_Cannot_Be_Null_Or_Empty, "rootVirtualPath" ); } // Make sure the root path ends with a slash if (!rootVirtualPath.EndsWith("/", StringComparison.Ordinal)) { rootVirtualPath += "/"; } Assembly = assembly; RootVirtualPath = rootVirtualPath; _applicationPartResources = new Lazy <IDictionary <string, string> >( () => Assembly .GetManifestResourceNames() .ToDictionary(key => key, key => key, StringComparer.OrdinalIgnoreCase) ); _applicationPartName = new Lazy <string>(() => Assembly.Name); }
public ApplicationPart this[IResourceAssembly assembly] { get { ApplicationPart part; if (!_applicationParts.TryGetValue(assembly, out part)) { part = null; } return part; } }
public ApplicationPart this[IResourceAssembly assembly] { get { ApplicationPart part; if (!_applicationParts.TryGetValue(assembly, out part)) { part = null; } return(part); } }
internal ApplicationPart(IResourceAssembly assembly, string rootVirtualPath) { if (String.IsNullOrEmpty(rootVirtualPath)) { throw new ArgumentException(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "rootVirtualPath"); } // Make sure the root path ends with a slash if (!rootVirtualPath.EndsWith("/", StringComparison.Ordinal)) { rootVirtualPath += "/"; } Assembly = assembly; RootVirtualPath = rootVirtualPath; _applicationPartResources = new Lazy<IDictionary<string, string>>(() => Assembly.GetManifestResourceNames().ToDictionary(key => key, key => key, StringComparer.OrdinalIgnoreCase)); _applicationPartName = new Lazy<string>(() => Assembly.Name); }