本文整理汇总了C#中Castle.MonoRail.Framework.Controller.PreSendView方法的典型用法代码示例。如果您正苦于以下问题:C# Controller.PreSendView方法的具体用法?C# Controller.PreSendView怎么用?C# Controller.PreSendView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Castle.MonoRail.Framework.Controller
的用法示例。
在下文中一共展示了Controller.PreSendView方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PreSendView
/// <summary>
/// Invokes the <see cref="Controller.PreSendView"/>
/// </summary>
/// <param name="controller">The controller.</param>
/// <param name="view">The view argument.</param>
protected virtual void PreSendView(Controller controller, object view)
{
controller.PreSendView(view);
}
示例2: Process
public override void Process(TextWriter output, IRailsEngineContext context, Controller controller, string templateName)
{
string fileName = GetFileName(templateName);
AspViewBase view = null;
TextWriter viewOutput = output;
AspViewBase layout = null;
if (controller.LayoutName != null)
{
layout = GetLayout(output, context, controller);
viewOutput = layout.ViewOutput;
}
view = GetView(fileName, viewOutput, context, controller);
if (view == null)
throw new RailsException(string.Format(
"Cannot find view '{0}'", fileName));
controller.PreSendView(view);
view.Render();
if (layout != null)
{
layout.SetParent(view);
layout.Render();
}
controller.PostSendView(view);
}
示例3: Process
public override void Process(TextWriter output, IRailsEngineContext context, Controller controller,
string templateName)
{
Log("Starting to process request for {0}", templateName);
string file = templateName.ToUpper() + ViewFileExtension;
BrailBase view;
// Output may be the layout's child output if a layout exists
// or the context.Response.Output if the layout is null
LayoutViewOutput layoutViewOutput = GetOutput(output, context, controller);
// Will compile on first time, then save the assembly on the cache.
view = GetCompiledScriptInstance(file, layoutViewOutput.Output, context, controller);
controller.PreSendView(view);
Log("Executing view {0}", templateName);
view.Run();
if (layoutViewOutput.Layout != null)
{
layoutViewOutput.Layout.SetParent(view);
layoutViewOutput.Layout.Run();
}
Log("Finished executing view {0}", templateName);
controller.PostSendView(view);
}