protected virtual ResourceVirtualDirectory CreateVirtualDirectory(IGrouping <string, string[]> subResources)
        {
            var remainingResourceNames = subResources.Select(g => g[1]);
            var subDir = new ResourceVirtualDirectory(
                VirtualPathProvider, this, backingAssembly, LastModified, rootNamespace, subResources.Key, remainingResourceNames.ToList());

            return(subDir);
        }
        public void WithAnEmbeddedResource_ShouldBeAbleToFindItInVirtualDirectoryWalk()
        {
            var appHost = new BasicAppHost(GetType().Assembly);
            var directory = new ResourceVirtualDirectory(new InMemoryVirtualPathProvider(appHost), null, GetType().Assembly, GetType().Assembly.GetName().Name);

            var resourceFiles = WalkForFiles(directory).ToList();
            Assert.IsNotEmpty(resourceFiles);
            Assert.Contains("/ResourceFile.txt", resourceFiles);
        }
Esempio n. 3
0
        public ResourceVirtualFile(IVirtualPathProvider owningProvider, ResourceVirtualDirectory directory, string fileName)
            : base(owningProvider, directory)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                throw new ArgumentNullException(nameof(fileName));
            }

            this.FileName        = fileName;
            this.BackingAssembly = directory.BackingAssembly ?? throw new ArgumentNullException(nameof(directory));
        }
        public ResourceVirtualFile(IVirtualPathProvider owningProvider, ResourceVirtualDirectory directory,  string fileName)
            : base(owningProvider, directory)
        {
            if (string.IsNullOrEmpty(fileName))
                throw new ArgumentException("fileName");

            if (directory.BackingAssembly == null)
                throw new ArgumentException("parentDirectory");

            this.FileName = fileName;
            this.BackingAssembly = directory.BackingAssembly;
        }
Esempio n. 5
0
        public ResourceVirtualFile(IVirtualPathProvider owningProvider, ResourceVirtualDirectory directory, string fileName)
            : base(owningProvider, directory)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                throw new ArgumentException("fileName");
            }

            if (directory.BackingAssembly == null)
            {
                throw new ArgumentException("parentDirectory");
            }

            this.FileName        = fileName;
            this.BackingAssembly = directory.BackingAssembly;
        }
        protected sealed override void Initialize()
        {
            var asm = BackingAssembly;

            RootDir = new ResourceVirtualDirectory(this, null, asm, RootNamespace);
        }
        protected virtual ResourceVirtualDirectory CreateVirtualDirectory(IGrouping<string, string[]> subResources)
        {
            var remainingResourceNames = subResources.Select(g => g[1]);
            var subDir = new ResourceVirtualDirectory(
                VirtualPathProvider, this, backingAssembly, rootNamespace, subResources.Key, remainingResourceNames.ToList());

            return subDir;
        }
 protected override sealed void Initialize()
 {
     var asm = BackingAssembly ?? AppHost.GetType().Assembly;
     RootDir = new ResourceVirtualDirectory(this, null, asm);
 }
Esempio n. 9
0
        protected override sealed void Initialize()
        {
            var asm = BackingAssembly ?? AppHost.GetType().Assembly;

            RootDir = new ResourceVirtualDirectory(this, null, asm);
        }
 protected sealed override void Initialize()
 {
     var asm = BackingAssembly ?? AppHost.GetType().GetAssembly();
     RootDir = new ResourceVirtualDirectory(this, null, asm, RootNamespace);
 }