示例#1
0
 public RubyView(ScriptRuntime scriptRuntime, string viewContents, RubyView master)
 {
     ScriptRuntime = scriptRuntime;
     Contents = viewContents;
     MasterView = master;
 }
示例#2
0
        /// <summary>
        /// Gets the view.
        /// </summary>
        /// <param name="controllerContext">The controller context.</param>
        /// <param name="virtualPath">The virtual path.</param>
        /// <param name="masterView">The master view.</param>
        /// <returns></returns>
        IView GetView(ControllerContext controllerContext, string virtualPath, RubyView masterView)
        {
            if (String.IsNullOrEmpty(virtualPath))
                return null;

            string viewContents = GetContents(controllerContext, virtualPath);
            if (String.Equals(controllerContext.HttpContext.Request.QueryString["editView"], "true", StringComparison.OrdinalIgnoreCase)) {
                return new WebFormView(controllerContext, "~/Views/Shared/ViewCreate.aspx");
            }
            return new RubyView(ScriptRuntime, viewContents, masterView);
        }