public EmbeddedViewVirtualPathProvider(EmbeddedViewTable embeddedViews)
        {
            if (embeddedViews == null)
                throw new ArgumentNullException("embeddedViews");

            this._embeddedViews = embeddedViews;
        }
Пример #2
0
        public EmbeddedViewTable GetEmbeddedViews()
        {
            var assemblies = _typeFinder.GetAssemblies();

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

            var table = new EmbeddedViewTable();

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

                foreach (var name in names)
                {
                    var key = name.ToLowerInvariant();
                    if (!key.Contains(".views."))
                    {
                        continue;
                    }

                    table.AddView(name, assembly.FullName);
                }
            }

            return(table);
        }
Пример #3
0
        public EmbeddedViewVirtualPathProvider(EmbeddedViewTable embeddedViews)
        {
            if (embeddedViews == null)
            {
                throw new ArgumentNullException("embeddedViews");
            }

            this._embeddedViews = embeddedViews;
        }
Пример #4
0
        public EmbeddedViewTable GetEmbeddedViews()
        {
            var assemblies = _typeFinder.GetAssemblies();
            if (assemblies == null || assemblies.Count == 0) return null;

            var table = new EmbeddedViewTable();

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

                foreach (var name in names)
                {
                    var key = name.ToLowerInvariant();
                    if (!key.Contains(".views.")) continue;

                    table.AddView(name, assembly.FullName);
                }
            }

            return table;
        }