C# Класс Castle.MonoRail.Views.Brail.BrailBase

Base class for all the view scripts, this is the class that is responsible for support all the behind the scenes magic such as variable to PropertyBag trasnlation, resources usage, etc.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
__controller Castle.MonoRail.Framework.Controller
childOutput System.IO.TextWriter
context IRailsEngineContext
parent BrailBase
viewEngine BooViewEngine

Открытые методы

Метод Описание
AddProperty ( string name, object item ) : void

Note that this will overwrite any existing property.

AddViewComponentProperties ( IDictionary newProperties ) : void

Adds the view component newProperties. This will be included in the parameters searching, note that this override the current parameters if there are clashing. The search order is LIFO

BrailBase ( BooViewEngine viewEngine, TextWriter output, IRailsEngineContext context, Controller __controller ) : System.Diagnostics

Initializes a new instance of the BrailBase class.

GetParameter ( string name ) : object

this is called by ReplaceUnknownWithParameters step to create a more dynamic experiance any uknown identifier will be translate into a call for GetParameter('identifier name'). This mean that when an uknonwn identifier is in the script, it will only be found on runtime.

GetSubViewFilename ( string subviewName ) : string

Get the sub view file name, if the subview starts with a '/' then the filename is considered relative to ViewDirRoot otherwise, it's relative to the current script directory

IsDefined ( string name ) : bool

Allows to check that a parameter was defined

OutputSubView ( string subviewName ) : string

Output the subview to the client, this is either a relative path "SubView" which is relative to the current /script/ or an "absolute" path "/home/menu" which is actually relative to ViewDirRoot

OutputSubView ( string subviewName, IDictionary parameters ) : string

Similiar to the OutputSubView(string) function, but with a bunch of parameters that are used just for this subview. This parameters are /not/ inheritable.

OutputSubView ( string subviewName, TextWriter writer, IDictionary parameters ) : void

Outputs the sub view to the writer

RemoveViewComponentProperties ( IDictionary propertiesToRemove ) : void

Removes the view component properties, so they will no longer be visible to the views.

RenderComponent ( string componentName ) : void
RenderComponent ( string componentName, IDictionary parameters ) : void
Run ( ) : void

Runs this instance, this is generated by the script

SetOutputStream ( TextWriter newOutputStream ) : IDisposable

This is required because we may want to replace the output stream and get the correct behavior from components call RenderText() or RenderSection()

SetParent ( BrailBase myParent ) : void

Sets the parent.

TryGetParameter ( string name ) : object

this is called by ReplaceUnknownWithParameters step to create a more dynamic experiance any uknown identifier with the prefix of ? will be translated into a call for TryGetParameter('identifier name without the ? prefix'). This method will return null if the value it not found.

Приватные методы

Метод Описание
GetParameterInternal ( string name ) : ParameterSearch

Gets the parameter - implements the logic for searching parameters.

InitProperties ( IRailsEngineContext myContext, Controller myController ) : void

Initialize all the properties that a script may need One thing to note here is that resources are wrapped in ResourceToDuck wrapper to enable easy use by the script

Описание методов

AddProperty() публичный Метод

Note that this will overwrite any existing property.
public AddProperty ( string name, object item ) : void
name string
item object
Результат void

AddViewComponentProperties() публичный Метод

Adds the view component newProperties. This will be included in the parameters searching, note that this override the current parameters if there are clashing. The search order is LIFO
public AddViewComponentProperties ( IDictionary newProperties ) : void
newProperties IDictionary The newProperties.
Результат void

BrailBase() публичный Метод

Initializes a new instance of the BrailBase class.
public BrailBase ( BooViewEngine viewEngine, TextWriter output, IRailsEngineContext context, Controller __controller ) : System.Diagnostics
viewEngine BooViewEngine The view engine.
output System.IO.TextWriter The output.
context IRailsEngineContext The context.
__controller Castle.MonoRail.Framework.Controller The controller.
Результат System.Diagnostics

GetParameter() публичный Метод

this is called by ReplaceUnknownWithParameters step to create a more dynamic experiance any uknown identifier will be translate into a call for GetParameter('identifier name'). This mean that when an uknonwn identifier is in the script, it will only be found on runtime.
public GetParameter ( string name ) : object
name string
Результат object

GetSubViewFilename() публичный Метод

Get the sub view file name, if the subview starts with a '/' then the filename is considered relative to ViewDirRoot otherwise, it's relative to the current script directory
public GetSubViewFilename ( string subviewName ) : string
subviewName string
Результат string

IsDefined() публичный Метод

Allows to check that a parameter was defined
public IsDefined ( string name ) : bool
name string
Результат bool

OutputSubView() публичный Метод

Output the subview to the client, this is either a relative path "SubView" which is relative to the current /script/ or an "absolute" path "/home/menu" which is actually relative to ViewDirRoot
public OutputSubView ( string subviewName ) : string
subviewName string
Результат string

OutputSubView() публичный Метод

Similiar to the OutputSubView(string) function, but with a bunch of parameters that are used just for this subview. This parameters are /not/ inheritable.
public OutputSubView ( string subviewName, IDictionary parameters ) : string
subviewName string
parameters IDictionary
Результат string

OutputSubView() публичный Метод

Outputs the sub view to the writer
public OutputSubView ( string subviewName, TextWriter writer, IDictionary parameters ) : void
subviewName string Name of the subview.
writer System.IO.TextWriter The writer.
parameters IDictionary The parameters.
Результат void

RemoveViewComponentProperties() публичный Метод

Removes the view component properties, so they will no longer be visible to the views.
public RemoveViewComponentProperties ( IDictionary propertiesToRemove ) : void
propertiesToRemove IDictionary The properties to remove.
Результат void

RenderComponent() публичный Метод

public RenderComponent ( string componentName ) : void
componentName string
Результат void

RenderComponent() публичный Метод

public RenderComponent ( string componentName, IDictionary parameters ) : void
componentName string
parameters IDictionary
Результат void

Run() публичный абстрактный Метод

Runs this instance, this is generated by the script
public abstract Run ( ) : void
Результат void

SetOutputStream() публичный Метод

This is required because we may want to replace the output stream and get the correct behavior from components call RenderText() or RenderSection()
public SetOutputStream ( TextWriter newOutputStream ) : IDisposable
newOutputStream System.IO.TextWriter
Результат IDisposable

SetParent() публичный Метод

Sets the parent.
public SetParent ( BrailBase myParent ) : void
myParent BrailBase My parent.
Результат void

TryGetParameter() публичный Метод

this is called by ReplaceUnknownWithParameters step to create a more dynamic experiance any uknown identifier with the prefix of ? will be translated into a call for TryGetParameter('identifier name without the ? prefix'). This method will return null if the value it not found.
public TryGetParameter ( string name ) : object
name string
Результат object

Описание свойств

__controller защищенное свойство

protected Controller,Castle.MonoRail.Framework __controller
Результат Castle.MonoRail.Framework.Controller

childOutput защищенное свойство

This is used by layout scripts only, for outputing the child's content
protected TextWriter,System.IO childOutput
Результат System.IO.TextWriter

context защищенное свойство

protected IRailsEngineContext context
Результат IRailsEngineContext

parent защищенное свойство

usually used by the layout to refer to its view, or a subview to its parent
protected BrailBase,Castle.MonoRail.Views.Brail parent
Результат BrailBase

viewEngine защищенное свойство

protected BooViewEngine,Castle.MonoRail.Views.Brail viewEngine
Результат BooViewEngine