public ReferencedExtensionLoader(IDependenciesFolder dependenciesFolder, IVirtualPathProvider virtualPathProvider, IBuildManager buildManager)
     : base(dependenciesFolder)
 {
     _virtualPathProvider = virtualPathProvider;
     _buildManager = buildManager;
     Logger = NullLogger.Instance;
 }
Exemple #2
0
        public DefaultBuildManager(
            IVirtualPathProvider virtualPathProvider, 
            IAssemblyLoader assemblyLoader) {

            _virtualPathProvider = virtualPathProvider;
            _assemblyLoader = assemblyLoader;
        }
Exemple #3
0
        public WebSiteFolder(IVirtualPathMonitor virtualPathMonitor, IVirtualPathProvider virtualPathProvider)
        {
            _virtualPathMonitor = virtualPathMonitor;
            _virtualPathProvider = virtualPathProvider;

            Logger = NullLogger.Instance;
        }
 public DefaultVirtualPathMonitor(IClock clock, IVirtualPathProvider virtualPathProvider)
 {
     _clock = clock;
     _virtualPathProvider = virtualPathProvider;
     _thunk = new Thunk(this);
     Logger = NullLogger.Instance;
 }
Exemple #5
0
        public static Stack<string> TokenizeVirtualPath(this string str, IVirtualPathProvider pathProvider)
        {
            if (pathProvider == null)
                throw new ArgumentNullException("pathProvider");

            return TokenizeVirtualPath(str, pathProvider.VirtualPathSeparator);
        }
        public ResourceFileService(
            IVirtualPathProvider virtualPathProvider)
        {
            _virtualPathProvider = virtualPathProvider;

            T = NullLocalizer.Instance;
        }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WebAssetHttpHandler"/> class.
 /// </summary>
 /// <param name="assetRegistry">The asset registry.</param>
 /// <param name="httpResponseCompressor">The HTTP response compressor.</param>
 /// <param name="httpResponseCacher">The HTTP response cacher.</param>
 public JsHttpHandler(IHttpResponseCompressor httpResponseCompressor, IHttpResponseCacher httpResponseCacher,
     IVirtualPathProvider virtualPathProvider)
 {
     _httpResponseCompressor = httpResponseCompressor;
     _httpResponseCacher = httpResponseCacher;
     _virtualPathProvider = virtualPathProvider;
 }
        public ImportedExtensionsProvider(
            IDependenciesFolder dependenciesFolder,
            IEnumerable<Assembly> extensions,
            IVirtualPathProvider virtualPathProvider)
            : base(dependenciesFolder)
        {
            // It's not nice to do this in the ctor but this way we spare to implement locking that would be needed with lazy-loading
            // and this class will be instantiated once anyway.
            _extensionsByName = extensions
                .ToDictionary
                (
                    assembly => assembly.ShortName(),
                    assembly => new Extension
                        {
                            Assembly = assembly,
                            Features = assembly
                                .GetExportedTypes()
                                .Where(type => type.GetCustomAttribute(typeof(OrchardFeatureAttribute)) != null)
                                .Select(type => ((OrchardFeatureAttribute)type.GetCustomAttribute(typeof(OrchardFeatureAttribute))).FeatureName)
                                .Union(new[] { assembly.ShortName() })
                                .Distinct()
                        }
                );

            _virtualPathProvider = virtualPathProvider;
        }
        /// <summary>
        /// 初始化一个新的扩展装载机。
        /// </summary>
        /// <param name="dependenciesFolder">依赖文件夹。</param>
        /// <param name="virtualPathProvider">虚拟路提供程序。</param>
        public RawThemeExtensionLoader(IDependenciesFolder dependenciesFolder, IVirtualPathProvider virtualPathProvider)
            : base(dependenciesFolder)
        {
            _virtualPathProvider = virtualPathProvider;

            Logger = NullLogger.Instance;
        }
 public InMemoryVirtualDirectory(IVirtualPathProvider owningProvider) 
     : base(owningProvider)
 {
     this.files = new List<InMemoryVirtualFile>();
     this.dirs = new List<InMemoryVirtualDirectory>();
     this.DirLastModified = DateTime.MinValue;
 }
Exemple #11
0
        public PlacementService(
            IContentManager contentManager,
            ISiteThemeService siteThemeService,
            IExtensionManager extensionManager,
            IShapeFactory shapeFactory,
            IShapeTableLocator shapeTableLocator,
            RequestContext requestContext,
            IEnumerable<IContentPartDriver> contentPartDrivers,
            IEnumerable<IContentFieldDriver> contentFieldDrivers,
            IVirtualPathProvider virtualPathProvider,
            IWorkContextAccessor workContextAccessor
            )
        {
            _contentManager = contentManager;
            _siteThemeService = siteThemeService;
            _extensionManager = extensionManager;
            _shapeFactory = shapeFactory;
            _shapeTableLocator = shapeTableLocator;
            _requestContext = requestContext;
            _contentPartDrivers = contentPartDrivers;
            _contentFieldDrivers = contentFieldDrivers;
            _virtualPathProvider = virtualPathProvider;
            _workContextAccessor = workContextAccessor;

            Logger = NullLogger.Instance;
        }
Exemple #12
0
        public ThemeService(
            IOrchardServices orchardServices,
            IExtensionManager extensionManager,
            IFeatureManager featureManager,
            IEnumerable<IThemeSelector> themeSelectors,
            IVirtualPathProvider virtualPathProvider,
            ICacheManager cacheManager,
            ISiteThemeService siteThemeService) {

            Services = orchardServices;

            _extensionManager = extensionManager;
            _featureManager = featureManager;
            _themeSelectors = themeSelectors;
            _virtualPathProvider = virtualPathProvider;
            _cacheManager = cacheManager;
            _siteThemeService = siteThemeService;

            if (_featureManager.FeatureDependencyNotification == null) {
                _featureManager.FeatureDependencyNotification = GenerateWarning;
            }

            Logger = NullLogger.Instance;
            T = NullLocalizer.Instance;
        }
        public FileSystemVirtualDirectory(IVirtualPathProvider owningProvider, IVirtualDirectory parentDirectory, DirectoryInfo dInfo)
            : base(owningProvider, parentDirectory)
        {
            if (dInfo == null)
                throw new ArgumentNullException("dInfo");

            this.BackingDirInfo = dInfo;
        }
        protected AbstractVirtualDirectoryBase(IVirtualPathProvider owningProvider, IVirtualDirectory parentDirectory)
        {
            if (owningProvider == null)
                throw new ArgumentNullException("owningProvider");

            this.VirtualPathProvider = owningProvider;
            this.ParentDirectory = parentDirectory;
        }
 protected EditorImageBrowserController(IDirectoryBrowser directoryBrowser,
     IDirectoryPermission permission,
     IVirtualPathProvider pathProvider,
     IThumbnailCreator thumbnailCreator)
     : base(directoryBrowser, permission, pathProvider)
 {
     this.thumbnailCreator = thumbnailCreator;
 }
Exemple #16
0
        public PackageBuilder(IWebSiteFolder webSiteFolder,
            IVirtualPathProvider virtualPathProvider,
            IOrchardFrameworkAssemblies frameworkAssemblies) {

            _webSiteFolder = webSiteFolder;
            _virtualPathProvider = virtualPathProvider;
            _frameworkAssemblies = frameworkAssemblies;
        }
        public EditorSnippetBuilder(IList<DropDownItem> items)
        {
            Guard.IsNotNull(items, "items");

            pathProvider = ServiceLocator.Current.Resolve<IVirtualPathProvider>();

            this.items = items;
        }
        public FileSystemVirtualFile(IVirtualPathProvider owningProvider, IVirtualDirectory directory, FileInfo fInfo) 
            : base(owningProvider, directory)
        {
            if (fInfo == null)
                throw new ArgumentNullException("fInfo");

            this.BackingFile = fInfo;
        }
 public AppHostRawThemeExtensionLoader(
     IDependenciesFolder dependenciesFolder,
     IVirtualPathProvider virtualPathProvider,
     IExtensionPathsProvider extensionPathsProvider)
     : base(dependenciesFolder, virtualPathProvider)
 {
     _virtualPathProvider = virtualPathProvider;
     _extensionPathsProvider = extensionPathsProvider;
 }
 public DynamicExtensionLoader(
     IVirtualPathProvider virtualPathProvider,
     IServiceProvider serviceProvider,
     IAssemblyLoaderContainer container)
 {
     _virtualPathProvider = virtualPathProvider;
     _serviceProvider = serviceProvider;
     _loaderContainer = container;
 }
 public ExtensionAssemblyLoader(string path, IServiceProvider serviceProvider) {
     _path = path;
     _serviceProvider = serviceProvider;
     _applicationEnvironment = serviceProvider.GetService<IApplicationEnvironment>();
     _fileWatcher = serviceProvider.GetService<IFileWatcher>();
     _orchardLibraryManager = serviceProvider.GetService<IOrchardLibraryManager>();
     _assemblyLoadContextAccessor = serviceProvider.GetService<IAssemblyLoadContextAccessor>();
     _virtualPathProvider = serviceProvider.GetService<IVirtualPathProvider>();
 }
        public DefaultBuildManager(
            IVirtualPathProvider virtualPathProvider, 
            IAssemblyLoader assemblyLoader)
        {
            _virtualPathProvider = virtualPathProvider;
            _assemblyLoader = assemblyLoader;

            Logger = NullLogger.Instance;
        }
 public DefaultContentDisplay(Lazy<IEnumerable<IContentHandler>> handlers, RequestContext requestContext,
     IVirtualPathProvider virtualPathProvider, IWorkContextAccessor workContextAccessor)
 {
     _handlers = handlers;
     _requestContext = requestContext;
     _virtualPathProvider = virtualPathProvider;
     _workContextAccessor = workContextAccessor;
     Logger = NullLogger.Instance;
 }
 public DynamicExtensionLoader(
     IVirtualPathProvider virtualPathProvider,
     IAssemblyLoaderContainer container,
     IExtensionAssemblyLoader extensionAssemblyLoader)
 {
     _virtualPathProvider = virtualPathProvider;
     _loaderContainer = container;
     _extensionAssemblyLoader = extensionAssemblyLoader;
 }
        private static void GetViewDirectories(IVirtualPathProvider vpp, string directory, IEnumerable<string> extensions, ICollection<string> files)
        {
            if (vpp.ListFiles(directory).Where(f => extensions.Any(e => f.EndsWith(e, StringComparison.OrdinalIgnoreCase))).Any()) {
                files.Add(directory);
            }

            foreach (var childDirectory in vpp.ListDirectories(directory).OrderBy(d => d, StringComparer.OrdinalIgnoreCase)) {
                GetViewDirectories(vpp, childDirectory, extensions, files);
            }
        }
 public DefaultConfigProvider(
     IOrchardServices orchardServices,
     ISiteThemeService siteThemeService,
     IVirtualPathProvider virtualPathProvider
     )
 {
     _siteThemeService = siteThemeService;
     _virtualPathProvider = virtualPathProvider;
     Services = orchardServices;
 }
		public PackageCreator(string rootPath, string outputPath)
		{
			_rootPath = rootPath;
			_outputPath = outputPath;

			_vpp = new RootedVirtualPathProvider(rootPath);
			var wsf = new WebSiteFolder(_vpp);

			_packageBuilder = new PackageBuilder(wsf, _vpp);
		}
 public ResourceVirtualDirectory(IVirtualPathProvider owningProvider, 
     IVirtualDirectory parentDir, 
     Assembly backingAsm, 
     string rootNamespace)
 : this(owningProvider, 
     parentDir, 
     backingAsm, 
     rootNamespace,
     rootNamespace, 
     GetResourceNames(backingAsm, rootNamespace)) { }
 protected EditorFileBrowserController(IDirectoryBrowser directoryBrowser,
     IDirectoryPermission permission,
     IVirtualPathProvider pathProvider,
     IThumbnailCreator thumbnailCreator)
 {
     this.directoryBrowser = directoryBrowser;
     this.permission = permission;
     this.pathProvider = pathProvider;
     this.thumbnailCreator = thumbnailCreator;
 }
 public TinyMceShapeDisplayEvent(
     ICacheManager cacheManager,
     IVirtualPathProvider virtualPathProvider,
     IWorkContextAccessor workContextAccessor,
     ISignals signals) {
     _signals = signals;
     _cacheManager = cacheManager;
     _virtualPathProvider = virtualPathProvider;
     _workContext = workContextAccessor.GetContext();
 }
        public AdminController(
            ITomeltServices services,
            IWidgetsService widgetsService,
            IShapeFactory shapeFactory,
            ISiteThemeService siteThemeService,
            IVirtualPathProvider virtualPathProvider,
            ICultureManager cultureManager)
        {
            Services             = services;
            _widgetsService      = widgetsService;
            _siteThemeService    = siteThemeService;
            _virtualPathProvider = virtualPathProvider;
            _cultureManager      = cultureManager;

            T      = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
            Shape  = shapeFactory;
        }
Exemple #32
0
        public ResourceVirtualDirectory(IVirtualPathProvider owningProvider, IVirtualDirectory parentDir, Assembly backingAsm, String directoryName, IEnumerable <String> manifestResourceNames)
            : base(owningProvider, parentDir)
        {
            if (backingAsm == null)
            {
                throw new ArgumentNullException("backingAsm");
            }

            if (string.IsNullOrEmpty(directoryName))
            {
                throw new ArgumentException("directoryName");
            }

            this.backingAssembly = backingAsm;
            this.DirectoryName   = directoryName;

            InitializeDirectoryStructure(manifestResourceNames);
        }
Exemple #33
0
        public DefaultExtensionCompiler(
            IVirtualPathProvider virtualPathProvider,
            IProjectFileParser projectFileParser,
            IDependenciesFolder dependenciesFolder,
            IEnumerable <IExtensionLoader> loaders,
            IAssemblyLoader assemblyLoader,
            ICriticalErrorProvider criticalErrorProvider)
        {
            _virtualPathProvider   = virtualPathProvider;
            _projectFileParser     = projectFileParser;
            _dependenciesFolder    = dependenciesFolder;
            _loaders               = loaders;
            _assemblyLoader        = assemblyLoader;
            _criticalErrorProvider = criticalErrorProvider;

            T      = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
        }
        public ProfilingContentDisplay(
            Lazy <IEnumerable <IContentHandler> > handlers,
            IShapeFactory shapeFactory,
            Lazy <IShapeTableLocator> shapeTableLocator,
            RequestContext requestContext,
            IVirtualPathProvider virtualPathProvider,
            IWorkContextAccessor workContextAccessor,
            IProfilerService profiler)
        {
            _innerContentDisplay = new DefaultContentDisplay(
                handlers,
                shapeFactory,
                shapeTableLocator,
                requestContext,
                virtualPathProvider,
                workContextAccessor);

            _profiler = profiler;
        }
 public ContentHandlerModelDriver(
     IShapeTableManager shapeTableManager,
     Lazy <IEnumerable <IContentHandler> > handlers,
     Lazy <IThemeManager> themeService,
     RequestContext requestContext,
     IVirtualPathProvider virtualPathProvider,
     Lazy <IShapeTableLocator> shapeTableLocator,
     IWorkContextAccessor workContextAccessor
     )
 {
     _shapeTableManager   = shapeTableManager;
     _handlers            = handlers;
     _themeService        = themeService;
     _requestContext      = requestContext;
     _virtualPathProvider = virtualPathProvider;
     _shapeTableLocator   = shapeTableLocator;
     _workContextAccessor = workContextAccessor;
     Logger = NullLogger.Instance;
 }
        public SiteResetTaskExecutor(
            IThemeService themeService,
            ISiteThemeService siteThemeService,
            ISessionFactoryHolder sessionFactoryHolder,
            IVirtualPathProvider virtualPathProvider,
            ShellSettings shellSettings,
            ISessionLocator sessionLocator,
            IEnumerable <ICommandInterpreter> commandInterpreters,
            IReportsCoordinator reportsCoordinator)
        {
            _themeService         = themeService;
            _siteThemeService     = siteThemeService;
            _virtualPathProvider  = virtualPathProvider;
            _sessionFactoryHolder = sessionFactoryHolder;
            var interpreter = new Coevery.Core.Services.DefaultDataMigrationInterpreter(shellSettings, sessionLocator, commandInterpreters, sessionFactoryHolder, reportsCoordinator);

            _schemaBuilder = new SchemaBuilder(interpreter, "", s => s.Replace(".", "_"));
            Logger         = NullLogger.Instance;
        }
Exemple #37
0
 public ShapeTemplateBindingStrategy(
     IEnumerable <IShapeTemplateHarvester> harvesters,
     ShellDescriptor shellDescriptor,
     IExtensionManager extensionManager,
     IVirtualPathProvider virtualPathProvider,
     IEnumerable <IShapeTemplateViewEngine> shapeTemplateViewEngines,
     IOptions <MvcViewOptions> options,
     IActionContextAccessor actionContextAccessor,
     ILogger <DefaultShapeTableManager> logger)
 {
     _harvesters               = harvesters;
     _shellDescriptor          = shellDescriptor;
     _extensionManager         = extensionManager;
     _virtualPathProvider      = virtualPathProvider;
     _shapeTemplateViewEngines = shapeTemplateViewEngines;
     _viewEngine               = options;
     _actionContextAccessor    = actionContextAccessor;
     _logger = logger;
 }
        public DynamicExtensionLoader(
            IBuildManager buildManager,
            IVirtualPathProvider virtualPathProvider,
            IVirtualPathMonitor virtualPathMonitor,
            IHostEnvironment hostEnvironment,
            IAssemblyProbingFolder assemblyProbingFolder,
            IDependenciesFolder dependenciesFolder,
            IProjectFileParser projectFileParser)
            : base(dependenciesFolder)
        {
            _buildManager          = buildManager;
            _virtualPathProvider   = virtualPathProvider;
            _virtualPathMonitor    = virtualPathMonitor;
            _hostEnvironment       = hostEnvironment;
            _assemblyProbingFolder = assemblyProbingFolder;
            _projectFileParser     = projectFileParser;
            _dependenciesFolder    = dependenciesFolder;

            Logger = NullLogger.Instance;
        }
 public ShapeTemplateBindingStrategy(
     IEnumerable <IShapeTemplateHarvester> harvesters,
     ShellDescriptor shellDescriptor,
     IExtensionManager extensionManager,
     ICacheManager cacheManager,
     IVirtualPathMonitor virtualPathMonitor,
     IVirtualPathProvider virtualPathProvider,
     IEnumerable <IShapeTemplateViewEngine> shapeTemplateViewEngines,
     IParallelCacheContext parallelCacheContext)
 {
     _harvesters               = harvesters;
     _shellDescriptor          = shellDescriptor;
     _extensionManager         = extensionManager;
     _cacheManager             = cacheManager;
     _virtualPathMonitor       = virtualPathMonitor;
     _virtualPathProvider      = virtualPathProvider;
     _shapeTemplateViewEngines = shapeTemplateViewEngines;
     _parallelCacheContext     = parallelCacheContext;
     Logger = NullLogger.Instance;
 }
        public LiquidTemplateEngine(
            Work <ICommonServices> services,
            IVirtualPathProvider vpp,
            Work <IThemeContext> themeContext,
            Work <LocalizerEx> localizer)
        {
            _services     = services;
            _vpp          = vpp;
            _localizer    = localizer;
            _themeContext = themeContext;

            // Register tag "zone"
            Template.RegisterTagFactory(new ZoneTagFactory(_services.Value.EventPublisher));

            // Register Filters
            Template.RegisterFilter(typeof(AdditionalFilters));

            Template.NamingConvention = new CSharpNamingConvention();
            Template.FileSystem       = this;
        }
        public ExtensionLoaderCoordinator(
            IDependenciesFolder dependenciesFolder,
            IExtensionDependenciesManager extensionDependenciesManager,
            IExtensionManager extensionManager,
            IVirtualPathProvider virtualPathProvider,
            IEnumerable <IExtensionLoader> loaders,
            IHostEnvironment hostEnvironment,
            IParallelCacheContext parallelCacheContext,
            IBuildManager buildManager)
        {
            _dependenciesFolder           = dependenciesFolder;
            _extensionDependenciesManager = extensionDependenciesManager;
            _extensionManager             = extensionManager;
            _virtualPathProvider          = virtualPathProvider;
            _loaders              = loaders.OrderBy(l => l.Order);
            _hostEnvironment      = hostEnvironment;
            _parallelCacheContext = parallelCacheContext;
            _buildManager         = buildManager;

            Logger = NullLogger.Instance;
        }
        public string fileAppend(IVirtualPathProvider vfs, string virtualPath, object contents)
        {
            if (contents is string s)
            {
                vfs.AppendFile(virtualPath, s);
            }
            else if (contents is byte[] bytes)
            {
                vfs.AppendFile(virtualPath, bytes);
            }
            else if (contents is Stream stream)
            {
                vfs.AppendFile(virtualPath, stream);
            }
            else
            {
                return(null);
            }

            return(virtualPath);
        }
        public ResourceVirtualDirectory(IVirtualPathProvider owningProvider,
                                        IVirtualDirectory parentDir,
                                        Assembly backingAsm,
                                        DateTime lastModified,
                                        string rootNamespace,
                                        string directoryName,
                                        List <string> manifestResourceNames)
            : base(owningProvider, parentDir)
        {
            if (string.IsNullOrEmpty(directoryName))
            {
                throw new ArgumentNullException(nameof(directoryName));
            }

            this.backingAssembly = backingAsm ?? throw new ArgumentNullException(nameof(backingAsm));
            this.LastModified    = lastModified;
            this.rootNamespace   = rootNamespace;
            this.DirectoryName   = directoryName;

            InitializeDirectoryStructure(manifestResourceNames);
        }
Exemple #44
0
        public static string GetReferenceVirtualPath(this IVirtualPathProvider virtualPathProvider, string basePath, string referenceName, string hintPath)
        {
            // Check if hint path is valid
            if (!string.IsNullOrEmpty(hintPath))
            {
                if (virtualPathProvider.TryFileExists(virtualPathProvider.Combine(basePath, hintPath)))
                {
                    return(hintPath);
                }
            }

            // Fall back to bin directory
            string relativePath = virtualPathProvider.Combine("bin", referenceName + ".dll");

            if (virtualPathProvider.TryFileExists(virtualPathProvider.Combine(basePath, relativePath)))
            {
                return(relativePath);
            }

            return(null);
        }
Exemple #45
0
        public ModuleService(
            IFeatureManager featureManager,
            IOrchardServices OrchardServices,
            IVirtualPathProvider virtualPathProvider,
            IExtensionManager extensionManager,
            IShellDescriptorManager shellDescriptorManager,
            ICacheManager cacheManager)
        {
            Services = OrchardServices;

            _featureManager         = featureManager;
            _virtualPathProvider    = virtualPathProvider;
            _extensionManager       = extensionManager;
            _shellDescriptorManager = shellDescriptorManager;
            _cacheManager           = cacheManager;

            if (_featureManager.FeatureDependencyNotification == null)
            {
                _featureManager.FeatureDependencyNotification = GenerateWarning;
            }
        }
Exemple #46
0
        public MdameerContentDisplay(
            Lazy <IEnumerable <IContentHandler> > handlers,
            IShapeFactory shapeFactory,
            Lazy <IShapeTableLocator> shapeTableLocator,
            RequestContext requestContext,
            IVirtualPathProvider virtualPathProvider,
            IWorkContextAccessor workContextAccessor,
            IOrchardServices orchardServices,
            IShapeDisplay shapeDisplay,
            IThemeManager themeManager,
            ShellSettings shellSettings,
            ICacheManager cacheManager,
            IOutputCacheStorageProvider cacheStorageProvider,
            ITagCache tagCache,
            IClock clock,
            ISignals signals,
            IResourceManager resourceManager,
            IJsonConverter jsonConverter) :
            base(handlers, shapeFactory, shapeTableLocator, requestContext, virtualPathProvider, workContextAccessor)
        {
            _handlers             = handlers;
            _shapeFactory         = shapeFactory;
            _shapeTableLocator    = shapeTableLocator;
            _requestContext       = requestContext;
            _virtualPathProvider  = virtualPathProvider;
            _workContextAccessor  = workContextAccessor;
            _orchardServices      = orchardServices;
            _shapeDisplay         = shapeDisplay;
            _themeManager         = themeManager;
            _shellSettings        = shellSettings;
            _cacheManager         = cacheManager;
            _cacheStorageProvider = cacheStorageProvider;
            _tagCache             = tagCache;
            _clock           = clock;
            _signals         = signals;
            _resourceManager = resourceManager;
            _jsonConverter   = jsonConverter;

            Logger = NullLogger.Instance;
        }
Exemple #47
0
        public ModuleService(
            IFeatureManager featureManager,
            IBoyingServices BoyingServices,
            IVirtualPathProvider virtualPathProvider,
            IExtensionManager extensionManager,
            IShellDescriptorManager shellDescriptorManager,
            ICacheManager cacheManager)
        {
            Services = BoyingServices;

            _featureManager         = featureManager;
            _virtualPathProvider    = virtualPathProvider;
            _extensionManager       = extensionManager;
            _shellDescriptorManager = shellDescriptorManager;
            _cacheManager           = cacheManager;

            if (_featureManager.FeatureDependencyNotification == null)
            {
                _featureManager.FeatureDependencyNotification = GenerateWarning;
            }

            T = NullLocalizer.Instance;
        }
        public static IVirtualFile ResolveFile(IVirtualPathProvider virtualFiles, string fromVirtualPath, string virtualPath)
        {
            IVirtualFile file          = null;
            var          tryExactMatch = virtualPath.IndexOf('/') >= 0; //if nested path specified, look for an exact match first

            if (tryExactMatch)
            {
                file = virtualFiles.GetFile(virtualPath);
            }

            if (file == null)
            {
                var parentPath = fromVirtualPath.IndexOf('/') >= 0
                    ? fromVirtualPath.LastLeftPart('/')
                    : "";

                do
                {
                    var seekPath = parentPath.CombineWith(virtualPath);
                    file = virtualFiles.GetFile(seekPath);
                    if (file != null)
                    {
                        break;
                    }

                    if (parentPath == "")
                    {
                        break;
                    }

                    parentPath = parentPath.IndexOf('/') >= 0
                        ? parentPath.LastLeftPart('/')
                        : "";
                } while (true);
            }
            return(file);
        }
Exemple #49
0
        public ThemeService(
            IOrchardServices orchardServices,
            IExtensionManager extensionManager,
            IFeatureManager featureManager,
            IEnumerable <IThemeSelector> themeSelectors,
            IVirtualPathProvider virtualPathProvider,
            ICacheManager cacheManager)
        {
            Services = orchardServices;

            _extensionManager    = extensionManager;
            _featureManager      = featureManager;
            _themeSelectors      = themeSelectors;
            _virtualPathProvider = virtualPathProvider;
            _cacheManager        = cacheManager;

            if (_featureManager.FeatureDependencyNotification == null)
            {
                _featureManager.FeatureDependencyNotification = GenerateWarning;
            }

            Logger = NullLogger.Instance;
            T      = NullLocalizer.Instance;
        }
Exemple #50
0
 public static IVirtualDirectory[] GetAllRootDirectories(this IVirtualPathProvider vfs) => vfs is MultiVirtualFiles mvfs
Exemple #51
0
 public CommandHostVirtualPathMonitor(IVirtualPathProvider virtualPathProvider)
 {
     _virtualPathProvider = virtualPathProvider;
 }
 protected AbstractVirtualDirectoryBase(IVirtualPathProvider owningProvider)
     : this(owningProvider, null)
 {
 }
Exemple #53
0
 public FileSystemVirtualFile(IVirtualPathProvider owningProvider, IVirtualDirectory directory, FileInfo fInfo)
     : base(owningProvider, directory)
 {
     this.BackingFile = fInfo ?? throw new ArgumentNullException(nameof(fInfo));
 }
Exemple #54
0
        public ViewsBackgroundCompilation(IVirtualPathProvider virtualPathProvider)
        {
            _virtualPathProvider = virtualPathProvider;

            Logger = NullLogger.Instance;
        }
Exemple #55
0
 public EditorSnippetBuilder(IList <DropDownItem> items, IVirtualPathProvider provider)
 {
     Guard.IsNotNull(items, "items");
     this.provider = provider;
     this.items    = items;
 }
 public static void DeleteFile(this IVirtualPathProvider pathProvider, IVirtualFile file)
 {
     pathProvider.DeleteFile(file.VirtualPath);
 }
 public static void AddFile(this IVirtualPathProvider pathProvider, string filePath, string textContents)
 {
     pathProvider.WriteFile(filePath, textContents);
 }
Exemple #58
0
 protected AbstractVirtualFileBase(IVirtualPathProvider owningProvider, IVirtualDirectory directory)
 {
     this.VirtualPathProvider = owningProvider ?? throw new ArgumentNullException(nameof(owningProvider));
     this.Directory           = directory ?? throw new ArgumentNullException(nameof(directory));
 }
Exemple #59
0
 public RazorViewManager(IRazorConfig viewConfig, IVirtualPathProvider virtualPathProvider)
 {
     this.Config       = viewConfig;
     this.PathProvider = virtualPathProvider;
 }
 public static bool IsDirectory(this IVirtualPathProvider pathProvider, string filePath)
 {
     return(pathProvider.DirectoryExists(filePath));
 }