Exemplo n.º 1
0
        /// <summary>
        /// Finds the specified partial view by using the specified controller context.
        /// </summary>
        /// <returns>
        /// The partial view.
        /// </returns>
        /// <param name="controllerContext">The controller context.</param><param name="partialViewName">The name of the partial view.</param><param name="useCache">true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false.</param>
        public ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache)
        {
            Template.FileSystem = _fileSystem.GetFileSystem(this.Extensions);
            var view = _viewLocator.LocatePartialView(partialViewName);

            if (view.SearchedLocations != null)
            {
                return(new ViewEngineResult(view.SearchedLocations));
            }

            return(new ViewEngineResult(new DotLiquidView(controllerContext, _viewLocator, view), this));
        }
Exemplo n.º 2
0
        public void Should_retrieve_filesystem_from_factory_when_engine_is_initialized()
        {
            // Given
            var context = CreateContext();

            // When
            this.engine.Initialize(context);

            // Then
            A.CallTo(() => factory.GetFileSystem(context)).MustHaveHappened();
        }
Exemplo n.º 3
0
        public LogFileArchiver(IFileSystemFactory fileSystemFactory, string archiveLocation, string fileSystemType)
        {
            var ipUser = IPAddress.GetCurrentMachineIp().ReverseMe() + "_" + RuntimeHelper.GetCurrentUserName().ReverseMe();

            _archiveLocation    = Path.Combine(archiveLocation, ipUser);
            _fileSystem         = fileSystemFactory.GetFileSystem(fileSystemType);
            _lastCopyedFileName = string.Empty;
            Init();

            EventContainer.SubscribeEvent(Events.LogFileReachedMaxLimit.ToString(), OnNewLogFileCreated);
        }