C# Класс DotNetify.Routing.RoutableExtension

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
GetRoute ( this routable, string templateId, string path = null ) : DotNetify.Routing.Route

Defines a route from a route template that belongs to the view model.

InitArgs ( this routable, object viewData ) : string

Returns HTML data attribute markup that contains routing initialization arguments. This needs to be placed in the same DOM element that has the "data-vm" attribute.

OnActivated ( this iRoutable, EventHandler eventHandler ) : void

Handles the activate event, which occurs when a route is being activated.

OnRouted ( this routable, EventHandler eventHandler ) : void

Handles the routed event, which occurs when this view model is being routed to.

Redirect ( this routable, string redirectRoot, string path ) : DotNetify.Routing.Route

Defines a route that belongs to another view model.

RegisterRoutes ( this routable, string root, List routeTemplates ) : void

Registers route templates.

Route ( RoutingViewData &viewData, IRoutable &oModel ) : string

Call this method from the controller to perform routing.

RouteUrl ( this routable, RoutingViewData &viewData ) : void

Performs routing. The URL path is given inside the view data, along with the initial route template to start from. This is a recursive method that will be called again by the nested views until the route is resolved.

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

Метод Описание
Match ( string urlPath, string root, string urlPattern, string &oPath ) : bool

Matches the URL path with the given URL pattern.

MatchTemplate ( List templates, string urlPath, string rootPath ) : string>?.KeyValuePair

Matches a URL path to any of the route templates.

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

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

Defines a route from a route template that belongs to the view model.
public static GetRoute ( this routable, string templateId, string path = null ) : DotNetify.Routing.Route
routable this Routable view model.
templateId string Identifies a template that belongs to this view model.
path string Optional path, to be used to replace parameterized template's URL pattern.
Результат DotNetify.Routing.Route

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

Returns HTML data attribute markup that contains routing initialization arguments. This needs to be placed in the same DOM element that has the "data-vm" attribute.
public static InitArgs ( this routable, object viewData ) : string
routable this Routable view model.
viewData object Routing view data.
Результат string

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

Handles the activate event, which occurs when a route is being activated.
public static OnActivated ( this iRoutable, EventHandler eventHandler ) : void
iRoutable this Routable view model.
eventHandler EventHandler Activate event handler.
Результат void

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

Handles the routed event, which occurs when this view model is being routed to.
public static OnRouted ( this routable, EventHandler eventHandler ) : void
routable this Routable view model.
eventHandler EventHandler Routed event handler.
Результат void

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

Defines a route that belongs to another view model.
public static Redirect ( this routable, string redirectRoot, string path ) : DotNetify.Routing.Route
routable this Routable view model.
redirectRoot string Root path of the route. If the path partially matches the view model's root path, they will be combined.
path string Route path.
Результат DotNetify.Routing.Route

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

Registers route templates.
public static RegisterRoutes ( this routable, string root, List routeTemplates ) : void
routable this Routable view model.
root string Root path to which all other paths will be evaluated.
routeTemplates List Route templates that belong to the view model.
Результат void

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

Call this method from the controller to perform routing.
public static Route ( RoutingViewData &viewData, IRoutable &oModel ) : string
viewData RoutingViewData Routing view data.
oModel IRoutable Model to be passed to the view.
Результат string

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

Performs routing. The URL path is given inside the view data, along with the initial route template to start from. This is a recursive method that will be called again by the nested views until the route is resolved.
public static RouteUrl ( this routable, RoutingViewData &viewData ) : void
routable this Routable view model.
viewData RoutingViewData Routing view data.
Результат void