示例#1
0
        /// <summary>
        /// 创建 PartialRenderAdapter 实例
        /// </summary>
        /// <param name="view">需要渲染部分视图的宿主视图</param>
        public PartialRenderAdapter(ViewContext viewContext, JumonyUrlHelper urlHelper, IViewHandler viewHandler)
        {
            if (viewContext == null)
            {
                throw new ArgumentNullException("viewContext");
            }

            if (urlHelper == null)
            {
                throw new ArgumentNullException("urlHelper");
            }

            if (viewHandler == null)
            {
                throw new ArgumentNullException("viewHandler");
            }

            ViewContext = viewContext;
            ViewHandler = viewHandler;
            Url         = urlHelper;


            var wrapper = viewHandler as IHandlerWrapper;

            if (wrapper != null)
            {
                _partialExecutors = GetPartialExecutors(wrapper.Handler.GetType());
            }
            else
            {
                _partialExecutors = GetPartialExecutors(viewHandler.GetType());
            }
        }
示例#2
0
        /// <summary>
        /// 处理指定文档范畴
        /// </summary>
        /// <param name="viewContext">视图上下文</param>
        /// <param name="scope">要处理的范围</param>
        /// <param name="urlHelper">适用于当前文档的虚拟路径帮助器</param>
        void IViewHandler.ProcessScope(ViewContext viewContext, IHtmlContainer scope, JumonyUrlHelper urlHelper)
        {
            ViewContext = viewContext;
            ViewData    = viewContext.ViewData;
            Scope       = scope;
            Url         = urlHelper;

            ProcessScope();
        }
示例#3
0
    /// <summary>
    /// 创建 ActionUrlBinder 对象
    /// </summary>
    /// <param name="urlHelper">协助生成 ASP.NET MVC URL 的帮助器</param>
    /// <param name="specification">要处理的文档所遵循的 HTML 规范</param>
    public ActionUrlBinder( JumonyUrlHelper urlHelper, HtmlSpecificationBase specification )
    {

      if ( urlHelper == null )
        throw new ArgumentNullException( "urlHelper" );

      UrlHelper = urlHelper;

      Specification = specification;
      DocumentPath = VirtualPathUtility.ToAbsolute( UrlHelper.VirtualPath );
    }
示例#4
0
        /// <summary>
        /// 创建 ActionUrlBinder 对象
        /// </summary>
        /// <param name="urlHelper">协助生成 ASP.NET MVC URL 的帮助器</param>
        /// <param name="specification">要处理的文档所遵循的 HTML 规范</param>
        public ActionUrlBinder(JumonyUrlHelper urlHelper, HtmlSpecificationBase specification)
        {
            if (urlHelper == null)
            {
                throw new ArgumentNullException("urlHelper");
            }

            UrlHelper = urlHelper;

            Specification = specification;
            DocumentPath  = VirtualPathUtility.ToAbsolute(UrlHelper.VirtualPath);
        }
示例#5
0
    /// <summary>
    /// 创建 PartialRenderAdapter 实例
    /// </summary>
    /// <param name="urlHelper">用于产生 URL 的 URL 帮助器</param>
    /// <param name="viewContext">当前视图上下文</param>
    /// <param name="viewHandler">当前视图处理程序</param>
    public PartialViewAdapter( ViewContext viewContext, JumonyUrlHelper urlHelper, IViewHandler viewHandler )
      : base( viewContext.HttpContext, viewHandler )
    {
      if ( viewContext == null )
        throw new ArgumentNullException( "viewContext" );

      if ( urlHelper == null )
        throw new ArgumentNullException( "urlHelper" );

      if ( viewHandler == null )
        throw new ArgumentNullException( "viewHandler" );

      ViewContext = viewContext;
      ViewHandler = viewHandler;
      Url = urlHelper;

    }
示例#6
0
        /// <summary>
        /// 创建 PartialRenderAdapter 实例
        /// </summary>
        /// <param name="view">需要渲染部分视图的宿主视图</param>
        public PartialRenderAdapter( ViewContext viewContext, JumonyUrlHelper urlHelper, IViewHandler viewHandler )
        {
            if ( viewContext == null )
            throw new ArgumentNullException( "viewContext" );

              if ( urlHelper == null )
            throw new ArgumentNullException( "urlHelper" );

              if ( viewHandler == null )
            throw new ArgumentNullException( "viewHandler" );

              ViewContext = viewContext;
              ViewHandler = viewHandler;
              Url = urlHelper;

              var wrapper = viewHandler as IHandlerWrapper;
              if ( wrapper != null )
            _partialExecutors = GetPartialExecutors( wrapper.Handler.GetType() );
              else
            _partialExecutors = GetPartialExecutors( viewHandler.GetType() );
        }
示例#7
0
        /// <summary>
        /// 创建 PartialRenderAdapter 实例
        /// </summary>
        /// <param name="urlHelper">用于产生 URL 的 URL 帮助器</param>
        /// <param name="viewContext">当前视图上下文</param>
        /// <param name="viewHandler">当前视图处理程序</param>
        public PartialViewAdapter(ViewContext viewContext, JumonyUrlHelper urlHelper, IViewHandler viewHandler)
            : base(viewContext.HttpContext, viewHandler)
        {
            if (viewContext == null)
            {
                throw new ArgumentNullException("viewContext");
            }

            if (urlHelper == null)
            {
                throw new ArgumentNullException("urlHelper");
            }

            if (viewHandler == null)
            {
                throw new ArgumentNullException("viewHandler");
            }

            ViewContext = viewContext;
            ViewHandler = viewHandler;
            Url         = urlHelper;
        }
示例#8
0
 /// <summary>
 /// Jumony 视图初始化
 /// </summary>
 /// <param name="viewContext">视图上下文</param>
 protected virtual void InitailizeJumonyView( ViewContext viewContext )
 {
   Url = new JumonyUrlHelper( viewContext.RequestContext, VirtualPath );
   Filters = GetFilters( viewContext );
 }
示例#9
0
 /// <summary>
 /// Jumony 视图初始化
 /// </summary>
 /// <param name="viewContext">视图上下文</param>
 protected virtual void InitailizeJumonyView(ViewContext viewContext)
 {
     Url     = new JumonyUrlHelper(viewContext.RequestContext, VirtualPath);
     Filters = GetFilters(viewContext);
 }
示例#10
0
        /// <summary>
        /// 处理指定文档范畴
        /// </summary>
        /// <param name="viewContext">视图上下文</param>
        /// <param name="scope">要处理的范围</param>
        /// <param name="urlHelper">适用于当前文档的虚拟路径帮助器</param>
        void IViewHandler.ProcessScope( ViewContext viewContext, IHtmlContainer scope, JumonyUrlHelper urlHelper )
        {
            ViewContext = viewContext;
              ViewData = viewContext.ViewData;
              _scope = scope;
              Url = urlHelper;

              ProcessScope();

              DataBind();
        }