当前位置: 首页>>代码示例>>C#>>正文


C# AreaRegistrationContext.MapTranslatedRoute方法代码示例

本文整理汇总了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);

        }
开发者ID:algola,项目名称:backup,代码行数:27,代码来源:AccountAreaRegistration.cs

示例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 }
            //);
        }
开发者ID:algola,项目名称:backup,代码行数:29,代码来源:WorkingAreaRegistration.cs

示例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 }
            //);
        }
开发者ID:algola,项目名称:backup,代码行数:32,代码来源:DataBaseAreaRegistration.cs


注:本文中的System.Web.Mvc.AreaRegistrationContext.MapTranslatedRoute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。