예제 #1
0
        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);
        }
예제 #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));
        }
예제 #4
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;
        }
예제 #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);
 }
예제 #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);
 }