当前位置: 首页>>代码示例>>C#>>正文


C# IViewEngine类代码示例

本文整理汇总了C#中IViewEngine的典型用法代码示例。如果您正苦于以下问题:C# IViewEngine类的具体用法?C# IViewEngine怎么用?C# IViewEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IViewEngine类属于命名空间,在下文中一共展示了IViewEngine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Add

        /// <summary>
        /// Add a engine.
        /// </summary>
        /// <param name="engine">Engine to add</param>
        /// <exception cref="ArgumentNullException"><c>engine</c> is null.</exception>
        public void Add(IViewEngine engine)
        {
            if (engine == null)
                throw new ArgumentNullException("engine");

            _viewEngines.Add(engine.FileExtension, engine);
        }
开发者ID:davidsiaw,项目名称:bunnyblogger,代码行数:12,代码来源:ViewEngineCollection.cs

示例2: CreateViewEngineStartupContext

 private ViewEngineStartupContext CreateViewEngineStartupContext(IViewEngine viewEngine)
 {
     return new ViewEngineStartupContext(
         this.viewCache,
         this.viewLocationCache,
         viewEngine.Extensions);
 }
开发者ID:RobertTheGrey,项目名称:Nancy,代码行数:7,代码来源:ViewEngineStartup.cs

示例3: NVelocityViewContextAdapter

		/// <summary>
		/// Initializes a new instance of the <see cref="NVelocityViewContextAdapter"/> class.
		/// </summary>
		/// <param name="componentName">Name of the component.</param>
		/// <param name="parentNode">The parent node.</param>
		/// <param name="viewEngine">The view engine.</param>
		/// <param name="renderer">The view renderer.</param>
		public NVelocityViewContextAdapter(String componentName, INode parentNode, IViewEngine viewEngine, IViewRenderer renderer)
		{
			this.componentName = componentName;
			this.parentNode = parentNode;
			this.viewEngine = viewEngine;
			this.renderer = renderer;
		}
开发者ID:candland,项目名称:Castle.MonoRail,代码行数:14,代码来源:NVelocityViewContextAdapter.cs

示例4: ViewViewComponentResult

 public ViewViewComponentResult([NotNull] IViewEngine viewEngine, string viewName,
     ViewDataDictionary viewData)
 {
     _viewEngine = viewEngine;
     ViewName = viewName;
     ViewData = viewData;
 }
开发者ID:Nakro,项目名称:Mvc,代码行数:7,代码来源:ViewViewComponentResult.cs

示例5: CreateContent

 public StreamContent CreateContent(IViewEngine viewEngine)
 {
     var memoryStream = new MemoryStream();
     WriteToStream(memoryStream, viewEngine);
     memoryStream.Position = 0;
     return new StreamContent(memoryStream);
 }
开发者ID:rmueller,项目名称:WebAPIContrib,代码行数:7,代码来源:View.cs

示例6: TemplateRenderer

        public TemplateRenderer(
            IViewEngine viewEngine,
            ViewContext viewContext,
            ViewDataDictionary viewData,
            string templateName,
            bool readOnly)
        {
            if (viewEngine == null)
            {
                throw new ArgumentNullException(nameof(viewEngine));
            }

            if (viewContext == null)
            {
                throw new ArgumentNullException(nameof(viewContext));
            }

            if (viewData == null)
            {
                throw new ArgumentNullException(nameof(viewData));
            }

            _viewEngine = viewEngine;
            _viewContext = viewContext;
            _viewData = viewData;
            _templateName = templateName;
            _readOnly = readOnly;
        }
开发者ID:4myBenefits,项目名称:Mvc,代码行数:28,代码来源:TemplateRenderer.cs

示例7: ConfigureRegistrar

        void ConfigureRegistrar(IViewEngine engine, IViewProcessor processor)
        {
            var r = new ViewRegistrar(processor, engine);
            r.Add(new ReflectionViewRegistrar());

            _registrar = r;
        }
开发者ID:RookieOne,项目名称:Chimera,代码行数:7,代码来源:ViewConfig.cs

示例8: WriteToStream

 private async Task WriteToStream(Stream outputStream, IViewEngine viewEngine, IPageViewDefinition viewDefinition)
 {
     using (var writer = new StreamWriter(outputStream))
     {
         SourceLocation errorLocation = null;
         Exception error = null;
         try
         {
             viewDefinition.Render(viewEngine, writer);
         }
         catch (VeilParserException ex)
         {
             error = ex;
             errorLocation = ex.Location;
         }
         catch (VeilCompilerException ex)
         {
             error = ex;
             errorLocation = ex.Node.Location;
         }
         catch (Exception ex)
         {
             error = ex;
         }
         
         if (error != null)
             await GetErrorPage(writer, error, errorLocation).ConfigureAwait(false);
     }
 }
开发者ID:namics,项目名称:TerrificNet,代码行数:29,代码来源:TemplateControllerBase.cs

示例9: DefaultMvcHandler

        public DefaultMvcHandler(IControllerFactory controllerFactory, IViewEngine viewEngine)
        {
            Requires.NotNull(controllerFactory, "controllerFactory");
            Requires.NotNull(viewEngine, "viewEngine");

            _controllerFactory = controllerFactory;
            ViewEngineManager.Current.Add(viewEngine);
        }
开发者ID:richardhopton,项目名称:Meridian,代码行数:8,代码来源:DefaultMVCHandler.cs

示例10: ViewEngineResult

        public ViewEngineResult(IView view, IViewEngine engine)
        {
            Precondition.Require(view, () => Error.ArgumentNull("view"));
            Precondition.Require(engine, () => Error.ArgumentNull("engine"));

            _view = view;
            _engine = engine;
        }
开发者ID:radischevo,项目名称:Radischevo.Wahha,代码行数:8,代码来源:ViewEngineResult.cs

示例11: ViewEngineFormatter

        public ViewEngineFormatter(IViewEngine viewEngine)
        {
            _viewEngine = viewEngine;

            foreach (var mediaTypeHeaderValue in _viewEngine.SupportedMediaTypes)
            {
                SupportedMediaTypes.Add(mediaTypeHeaderValue);
            }
        }
开发者ID:AlexZeitler,项目名称:HypermediaApiSite,代码行数:9,代码来源:ViewEngineFormatter.cs

示例12: DefaultTerrificTemplateHandler

		public DefaultTerrificTemplateHandler(IViewEngine viewEngine, IModelProvider modelProvider,
			ITemplateRepository templateRepository, ILabelService labelService, IModuleRepository moduleRepository)
		{
			_viewEngine = viewEngine;
			_modelProvider = modelProvider;
			_templateRepository = templateRepository;
			_labelService = labelService;
			_moduleRepository = moduleRepository;
		}
开发者ID:namics,项目名称:TerrificNet,代码行数:9,代码来源:DefaultTerrificTemplateHandler.cs

示例13: Setup

        public void Setup(ViewEngineInspector sut, IInspectorContext context, IViewEngine viewEngine)
        {
            context.ProxyFactory.Setup(pf => pf.IsWrapInterfaceEligible<IViewEngine>(It.IsAny<Type>())).Returns(true);
            context.ProxyFactory.Setup(pf => pf.WrapInterface(It.IsAny<IViewEngine>(), It.IsAny<IEnumerable<IAlternateMethod>>(), Enumerable.Empty<object>())).Returns(viewEngine);

            sut.Setup(context);

            context.ProxyFactory.Verify(pf => pf.WrapInterface(It.IsAny<IViewEngine>(), It.IsAny<IEnumerable<IAlternateMethod>>(), Enumerable.Empty<object>()), Times.AtLeastOnce());
        }
开发者ID:GitObjects,项目名称:Glimpse,代码行数:9,代码来源:ViewEngineShould.cs

示例14: CreateFactory

        private DefaultViewFactory CreateFactory(params IViewEngine[] viewEngines)
        {
            if (viewEngines == null)
            {
                viewEngines = new IViewEngine[] { };
            }

            return new DefaultViewFactory(this.resolver, viewEngines, this.renderContextFactory, this.conventions, this.rootPathProvider);
        }
开发者ID:Borzoo,项目名称:Nancy,代码行数:9,代码来源:DefaultViewFactoryFixture.cs

示例15: Setup

 public void Setup()
 {
     _writer = new StringWriter();
     _context = new ViewContext();
     _viewEngine = MockRepository.GenerateMock<IViewEngine>();
     _engines = new ViewEngineCollection(new List<IViewEngine> { _viewEngine });
     _context.HttpContext = MvcMockHelpers.DynamicHttpContextBase();
     _renderContext = new RenderingContext(_writer, _context, _engines);
 }
开发者ID:EagleFlyHigh,项目名称:MvcContrib,代码行数:9,代码来源:SortableColumnRenderTester.cs


注:本文中的IViewEngine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。