mirror of https://github.com/abpframework/abp.git
21 changed files with 149 additions and 110 deletions
Binary file not shown.
@ -1,14 +0,0 @@ |
|||
using System; |
|||
using Volo.Abp.AspNetCore.VirtualFileSystem; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Mvc.VirtualFileSystem |
|||
{ |
|||
public class AspNetCoreVirtualViewFileProvider : AspNetCoreVirtualFileProvider |
|||
{ |
|||
public AspNetCoreVirtualViewFileProvider(IObjectAccessor<IServiceProvider> serviceProviderAccessor) |
|||
: base(serviceProviderAccessor) |
|||
{ |
|||
} |
|||
} |
|||
} |
|||
@ -1,18 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.AspNetCore.VirtualFileSystem |
|||
{ |
|||
internal class AspNetCoreVirtualFileOptions //TODO: and use this!
|
|||
{ |
|||
public HashSet<string> IgnoredFileExtensions { get; } |
|||
|
|||
public AspNetCoreVirtualFileOptions() |
|||
{ |
|||
IgnoredFileExtensions = new HashSet<string> |
|||
{ |
|||
".cshtml", |
|||
".config" |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.VirtualFileSystem |
|||
{ |
|||
public class VirtualFileSetList : List<IVirtualFileSet> |
|||
{ |
|||
public List<string> PhysicalPaths { get; } |
|||
|
|||
public VirtualFileSetList() |
|||
{ |
|||
PhysicalPaths = new List<string>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
using System; |
|||
using System.IO; |
|||
using System.Linq; |
|||
using JetBrains.Annotations; |
|||
using Volo.Abp.VirtualFileSystem.Embedded; |
|||
|
|||
namespace Volo.Abp.VirtualFileSystem |
|||
{ |
|||
public static class VirtualFileSetListExtensions |
|||
{ |
|||
public static void AddEmbedded<T>([NotNull] this VirtualFileSetList list, [CanBeNull] string baseNamespace = null) |
|||
{ |
|||
Check.NotNull(list, nameof(list)); |
|||
|
|||
list.Add( |
|||
new EmbeddedFileSet( |
|||
typeof(T).Assembly, |
|||
baseNamespace |
|||
) |
|||
); |
|||
} |
|||
|
|||
public static void ReplaceEmbeddedByPyhsical<T>([NotNull] this VirtualFileSetList list, [NotNull] string pyhsicalPath) |
|||
{ |
|||
Check.NotNull(list, nameof(list)); |
|||
Check.NotNull(pyhsicalPath, nameof(pyhsicalPath)); |
|||
|
|||
var assembly = typeof(T).Assembly; |
|||
var embeddedFileSets = list.OfType<EmbeddedFileSet>().Where(fs => fs.Assembly == assembly).ToList(); |
|||
|
|||
foreach (var embeddedFileSet in embeddedFileSets) |
|||
{ |
|||
list.Remove(embeddedFileSet); |
|||
|
|||
if (!embeddedFileSet.BaseFolderInProject.IsNullOrEmpty()) |
|||
{ |
|||
pyhsicalPath = Path.Combine(pyhsicalPath, embeddedFileSet.BaseFolderInProject); |
|||
} |
|||
|
|||
list.PhysicalPaths.Add(pyhsicalPath); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -1,14 +1,12 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Volo.Abp.VirtualFileSystem |
|||
namespace Volo.Abp.VirtualFileSystem |
|||
{ |
|||
public class VirtualFileSystemOptions |
|||
{ |
|||
public List<IVirtualFileSet> FileSets { get; } |
|||
public VirtualFileSetList FileSets { get; } |
|||
|
|||
public VirtualFileSystemOptions() |
|||
{ |
|||
FileSets = new List<IVirtualFileSet>(); |
|||
FileSets = new VirtualFileSetList(); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue