本文整理汇总了C#中System.Web.Mvc.AreaRegistrationContext.MapTranslatedRoute方法的典型用法代码示例。如果您正苦于以下问题:C# AreaRegistrationContext.MapTranslatedRoute方法的具体用法?C# AreaRegistrationContext.MapTranslatedRoute怎么用?C# AreaRegistrationContext.MapTranslatedRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Mvc.AreaRegistrationContext
的用法示例。
在下文中一共展示了AreaRegistrationContext.MapTranslatedRoute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterArea
public override void RegisterArea(AreaRegistrationContext context)
{
// TRANSLATION ROUTING
CultureInfo cultureEN = CultureInfo.GetCultureInfo("en-US");
CultureInfo cultureIT = CultureInfo.GetCultureInfo("it-IT");
DictionaryRouteValueTranslationProvider translationProvider = new DictionaryRouteValueTranslationProvider(
new List<RouteValueTranslation> {
//new RouteValueTranslation(cultureIT, "Login", "login"),
//new RouteValueTranslation(cultureIT, "RecoveryPassword", "recupera-la-password"),
//new RouteValueTranslation(cultureIT, "Register", "registrazione-di-un-nuovo-utente"),
//new RouteValueTranslation(cultureIT, "registerLink", "link-per-registrarsi"),
//new RouteValueTranslation(cultureIT, "loginLink", "link-per-loggarsi"),
//new RouteValueTranslation(cultureIT, "EmailSent", "password-per-il-gestionale-inviata"),
}
);
context.MapTranslatedRoute(
"Account_default",
"account/{action}/{id}",
new { controller = "Account", action = "Index", id = UrlParameter.Optional },
new { controller = translationProvider, action = translationProvider },
true);
}
示例2: RegisterArea
public override void RegisterArea(AreaRegistrationContext context)
{
// TRANSLATION ROUTING
CultureInfo cultureEN = CultureInfo.GetCultureInfo("en-US");
CultureInfo cultureIT = CultureInfo.GetCultureInfo("it-IT");
DictionaryRouteValueTranslationProvider translationProvider = new DictionaryRouteValueTranslationProvider(
new List<RouteValueTranslation> {
//new RouteValueTranslation(cultureIT, "Document", "preventivi-commesse-tipografia"),
//new RouteValueTranslation(cultureIT, "ListEstimate", "elenco-documenti-centro-stampa"),
//new RouteValueTranslation(cultureIT, "CreateProduct", "inserimento-di-uno-stampato"),
//new RouteValueTranslation(cultureIT, "Error", "errore"),
//new RouteValueTranslation(cultureIT, "NoTaskEstimatedOnException", "manca-definizione-costo")
}
);
context.MapTranslatedRoute(
"Working_default",
"working-area/{controller}/{action}/{id}",
new { controller = "Working", action = "Index", id = UrlParameter.Optional },
new { controller = translationProvider, action = translationProvider },
true);
//context.MapRoute(
// "Working_default",
// "Working/{controller}/{action}/{id}",
// new { action = "Index", id = UrlParameter.Optional }
//);
}
示例3: RegisterArea
public override void RegisterArea(AreaRegistrationContext context)
{
// TRANSLATION ROUTING
CultureInfo cultureEN = CultureInfo.GetCultureInfo("en-US");
CultureInfo cultureIT = CultureInfo.GetCultureInfo("it-IT");
DictionaryRouteValueTranslationProvider translationProvider = new DictionaryRouteValueTranslationProvider(
new List<RouteValueTranslation> {
new RouteValueTranslation(cultureIT, "HomeDb", "configuratore-stampa-e-carta"),
new RouteValueTranslation(cultureIT, "Article", "materiale-in-anagrafica"),
new RouteValueTranslation(cultureIT, "CustomerSupplier", "anagrafica-clienti-fornitori-tipografia"),
new RouteValueTranslation(cultureIT, "IndexSheetPrintableArticle", "a-foglio-stampa-digitale-offset"),
new RouteValueTranslation(cultureIT, "IndexRollPrintableArticle", "a-rotolo-stampa-etichette-digitale-offset"),
new RouteValueTranslation(cultureIT, "IndexRigidPrintableArticle", "rigido-forex-vetrofanie-plotter-uv"),
new RouteValueTranslation(cultureIT, "TaskExecutor", "macchina-da-stampa-o-lavorazione"),
}
);
context.MapTranslatedRoute(
"DataBase_Translated",
"database/{controller}/{action}/{id}",
new { controller = "DataBase", action = "Index", id = UrlParameter.Optional },
new { controller = translationProvider, action = translationProvider },
true);
//context.MapRoute(
// "DataBase_default",
// "Anagrafica/{controller}/{action}/{id}",
// new { controller = "DataBase", action = "Index", id = UrlParameter.Optional }
//);
}