public EmbeddedResourceTable GetEmbeddedResources()
        {
            var assemblies = GetAssemblies();

            if (assemblies == null || assemblies.Length == 0)
            {
                return(null);
            }

            var table = new EmbeddedResourceTable();

            foreach (var assembly in assemblies)
            {
                var names = GetNamesOfAssemblyResources(assembly);
                if (names == null || names.Length == 0)
                {
                    continue;
                }

                var validNames = from name in names
                                 let key = name.ToLowerInvariant()
                                           where key.Contains(".content.") || key.Contains(".scripts.")
                                           select name;

                foreach (var name in validNames)
                {
                    table.AddResource(name, assembly.FullName);
                }
            }

            return(table);
        }
		public EmbeddedResourceVirtualPathProvider(EmbeddedResourceTable table)
		{
			if (table == null)
				throw new ArgumentNullException("table", "EmbeddedResourceTable cannot be null.");

			embeddedResources = table;
		}
Ejemplo n.º 3
0
        public EmbeddedResourceVirtualPathProvider(EmbeddedResourceTable table)
        {
            if (table == null)
            {
                throw new ArgumentNullException("table", "EmbeddedResourceTable cannot be null.");
            }

            embeddedResources = table;
        }
        public EmbeddedResourceTable GetEmbeddedResources()
        {
            var assemblies = GetAssemblies();
            if(assemblies == null || assemblies.Length == 0) return null;

            var table = new EmbeddedResourceTable();

            foreach(var assembly in assemblies)
            {
                var names = GetNamesOfAssemblyResources(assembly);
                if(names == null || names.Length == 0) continue;

                var validNames = from name in names
                                 let key = name.ToLowerInvariant()
                                 where key.Contains(".content.") || key.Contains(".scripts.")
                                 select name;

                foreach(var name in validNames)
                    table.AddResource(name, assembly.FullName);
            }

            return table;
        }