• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IViewEngine类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: View

 protected HttpResponseMessage View(IViewEngine viewEngine, IPageViewDefinition siteDefinition)
 {
     var message = new HttpResponseMessage(HttpStatusCode.OK)
     {
         Content =
             new PushStreamContent((o, c, t) => WriteToStream(o, viewEngine, siteDefinition),
                 new MediaTypeHeaderValue("text/html"))
     };
     return message;
 }
开发者ID:namics,项目名称:TerrificNet,代码行数:10,代码来源:TemplateControllerBase.cs


示例17: Init

 public void Init(IViewEngine viewEngine, IRequest httpReq, IResponse httpRes, IRazorView razorPage, 
     Dictionary<string, object> scopeArgs = null, ViewDataDictionary viewData = null)
 {
     ViewEngine = viewEngine;
     HttpRequest = httpReq as IHttpRequest;
     HttpResponse = httpRes as IHttpResponse;
     RazorPage = razorPage;
     //ScopeArgs = scopeArgs;
     this.viewData = viewData;
 }
开发者ID:jin29neci,项目名称:ServiceStack,代码行数:10,代码来源:HtmlHelper.cs


示例18: Setup

		public void Setup()
		{
			_model = new GridModel<Person>();
			_people = new List<Person> {new Person {Id = 1, Name = "Jeremy", DateOfBirth = new DateTime(1987, 4, 19)}};
			_viewEngine = MockRepository.GenerateMock<IViewEngine>();
			_engines = new ViewEngineCollection(new List<IViewEngine> { _viewEngine });
			_writer = new StringWriter();
			_querystring= new NameValueCollection();
			RouteTable.Routes.MapRoute("default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional });
		}
开发者ID:haithemaraissia,项目名称:MVCContribute,代码行数:10,代码来源:GridRendererTester.cs


示例19: ThemedViewFactory

        // end-workaround
        public ThemedViewFactory()
        {
            var container = SparkEngineStarter.CreateContainer();
            _defaultViewFolder = container.GetService<IViewFolder>();
            _defaultEngine = container.GetService<IViewEngine>();

            // workaround
            _defaultViews = CompiledViewHolder.Current;
            // end-workaround
        }
开发者ID:brunomlopes,项目名称:netponto-fluentnhibernate,代码行数:11,代码来源:ThemedViewFactory.cs


示例20: SafeInvokeViewEngine

 private static Action<Stream> SafeInvokeViewEngine(IViewEngine viewEngine, ViewLocationResult locationResult, dynamic model)
 {
     try
     {
         return viewEngine.RenderView(locationResult, model);
     }
     catch (Exception)
     {
         return EmptyView;
     }
 }
开发者ID:justinsoliz,项目名称:Nancy,代码行数:11,代码来源:DefaultViewFactory.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IViewEngineHost类代码示例发布时间:2022-05-24
下一篇:
C# IViewDataContainer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap