• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Localizer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Localizer的典型用法代码示例。如果您正苦于以下问题:C# Localizer类的具体用法?C# Localizer怎么用?C# Localizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Localizer类属于命名空间,在下文中一共展示了Localizer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: LocalizedRangeAttribute

        public LocalizedRangeAttribute(RangeAttribute attribute, Localizer t)
            : base(attribute.OperandType, new FormatterConverter().ToString(attribute.Minimum), new FormatterConverter().ToString(attribute.Maximum)) {
            if ( !String.IsNullOrEmpty(attribute.ErrorMessage) )
                ErrorMessage = attribute.ErrorMessage;

            T = t;
        }
开发者ID:anycall,项目名称:Orchard,代码行数:7,代码来源:LocalizedRangeAttribute.cs


示例2: CascadedTemplate

		[Test] public void CascadedTemplate ()
		{
			Localizer loc = new Localizer(null);
			loc.Add("Plural", "{1}s");
			loc.Add("Report2", "Report {Plural'1}/{Plural'2}");
			Assert.AreEqual("Report Scopes/Storys", loc.Resolve("Report2'Scope'Story"));
		}
开发者ID:versionone,项目名称:VersionOne.Localization,代码行数:7,代码来源:LocalizerTester.cs


示例3: TermsFilterForms

 public TermsFilterForms(
     IShapeFactory shapeFactory,
     ITaxonomyService taxonomyService) {
     _taxonomyService = taxonomyService;
     Shape = shapeFactory;
     T = NullLocalizer.Instance;
 }
开发者ID:Higea,项目名称:Orchard,代码行数:7,代码来源:TermsFilterForms.cs


示例4: CreateFilteredRequestTable

        public static MvcHtmlString CreateFilteredRequestTable(this HtmlHelper helper, IQueryable<FilteredRequestRecord> filteredRequestRecords, Localizer T)
        {
            StringBuilder sb = new StringBuilder();

            if (filteredRequestRecords == null || !filteredRequestRecords.Any())
            {
                sb.AppendLine(T("No requests are filtered yet.").Text);
            }
            else
            {
                sb.AppendLine("<table><tr>");
                sb.AppendFormat("<th>{0}</th>", T("Request time"));
                sb.AppendFormat("<th>{0}</th>", T("Url"));
                sb.AppendFormat("<th>{0}</th>", T("User Host Address"));
                sb.AppendFormat("<th>{0}</th>", T("User Agent"));
                sb.AppendLine("</tr>");

                foreach (FilteredRequestRecord filteredRequest in filteredRequestRecords.OrderByDescending(r => r.RequestTime))
                {
                    sb.AppendLine("<tr>");
                    sb.AppendFormat("<td>{0}</td>", filteredRequest.RequestTime);
                    sb.AppendFormat("<td>{0}</td>", filteredRequest.Url);
                    sb.AppendFormat("<td>{0}</td>", filteredRequest.UserHostAddress);
                    sb.AppendFormat("<td>{0}</td>", filteredRequest.UserAgent);
                    sb.AppendLine("</tr>");
                }
                sb.AppendLine("</table>");
            }
            return new MvcHtmlString(sb.ToString());
        }
开发者ID:rijkshuisstijl,项目名称:Rijkshuisstijl.UrlProtector,代码行数:30,代码来源:UrlProtectorHtmlHelper.cs


示例5: ContentPartRecordsForm

 public ContentPartRecordsForm(
     ShellBlueprint shellBlueprint,
     IShapeFactory shapeFactory) {
     _shellBlueprint = shellBlueprint;
     Shape = shapeFactory;
     T = NullLocalizer.Instance;
 }
开发者ID:RasterImage,项目名称:Orchard,代码行数:7,代码来源:ContentPartRecordsForm.cs


示例6: DisplayFilter

        public static LocalizedString DisplayFilter(string fieldName, dynamic formState, Localizer T)
        {
            var op = (NumericOperator)Enum.Parse(typeof(NumericOperator), Convert.ToString(formState.Operator));
            string value = Convert.ToString(formState.Value);
            string min = Convert.ToString(formState.Min);
            string max = Convert.ToString(formState.Max);

            switch (op) {
                case NumericOperator.LessThan:
                    return T("{0} is less than {1}", fieldName, value);
                case NumericOperator.LessThanEquals:
                    return T("{0} is less or equal than {1}", fieldName, value);
                case NumericOperator.Equals:
                    return T("{0} equals {1}", fieldName, value);
                case NumericOperator.NotEquals:
                    return T("{0} is not equal to {1}", fieldName, value);
                case NumericOperator.GreaterThan:
                    return T("{0} is greater than {1}", fieldName, value);
                case NumericOperator.GreaterThanEquals:
                    return T("{0} is greater or equal than {1}", fieldName, value);
                case NumericOperator.Between:
                    return T("{0} is between {1} and {2}", fieldName, min, max);
                case NumericOperator.NotBetween:
                    return T("{0} is not between {1} and {2}", fieldName, min, max);
            }

            // should never be hit, but fail safe
            return new LocalizedString(fieldName);
        }
开发者ID:galyna,项目名称:maozedong-orchard1,代码行数:29,代码来源:NumericFilterForm.cs


示例7: EventController

 public EventController(IOrchardServices services, 
     IEventService eventService)
 {
     T = NullLocalizer.Instance;
     _eventService = eventService;
     _services = services;
 }
开发者ID:NFLPA,项目名称:NFLPA.CalendarEvents,代码行数:7,代码来源:EventController.cs


示例8: RelationshipController

 public RelationshipController(
     IRelationshipService relationshipService,
     IRepository<RelationshipRecord> relationshipRepository) {
     _relationshipService = relationshipService;
     _relationshipRepository = relationshipRepository;
     T = NullLocalizer.Instance;
 }
开发者ID:wezmag,项目名称:Coevery,代码行数:7,代码来源:RelationshipController.cs


示例9: AdminController

        public AdminController(IOrchardServices orchardService, IDirectoryNavService directoryNavService)
        {
            _orchardServices = orchardService;
            _directoryNavService = directoryNavService;

            T = NullLocalizer.Instance;
        }
开发者ID:bolorock,项目名称:Orchard.Bolo.DirectoryNav,代码行数:7,代码来源:AdminController.cs


示例10: WinXinRespForms

        public WinXinRespForms(IShapeFactory shapeFactory, IContentManager contentManager)
        {
            Shape = shapeFactory;
            T = NullLocalizer.Instance;

            _contentManager = contentManager;
        }
开发者ID:ccccccmd,项目名称:Orchard.WeChat,代码行数:7,代码来源:WinXinRespForms.cs


示例11: DisplayFilter

 public static LocalizedString DisplayFilter(string fieldName, dynamic formState, Localizer T) {
     bool value = Convert.ToBoolean(formState.Value);
     fieldName = fieldName.Split('.')[1];
     return value
         ? T("{0} is true", fieldName)
         : T("{0} is false", fieldName);
 }
开发者ID:wezmag,项目名称:Coevery,代码行数:7,代码来源:BooleanFilterForm.cs


示例12: AddressDirectoryService

 public AddressDirectoryService(IOrchardServices services,Lazy<IMechanicsService> mechanics)
 {
     _services = services;
     _mechanics = mechanics;
     Logger = NullLogger.Instance;
     T = NullLocalizer.Instance;
 }
开发者ID:akhurst,项目名称:ricealumni,代码行数:7,代码来源:AddressDirectoryService.cs


示例13: DisplayFilter

 public static LocalizedString DisplayFilter(string fieldName, dynamic formState, Localizer T) {
     var op = (Orchard.Projections.FilterEditors.Forms.StringOperator) Enum.Parse(typeof (Orchard.Projections.FilterEditors.Forms.StringOperator), Convert.ToString(formState.Operator));
     string value = Convert.ToString(formState.Value);
     fieldName = fieldName.Split('.')[1];
     switch (op) {
         case Orchard.Projections.FilterEditors.Forms.StringOperator.Equals:
             return T("{0} is equal to '{1}'", fieldName, value);
         case Orchard.Projections.FilterEditors.Forms.StringOperator.NotEquals:
             return T("{0} is not equal to '{1}'", fieldName, value);
         case Orchard.Projections.FilterEditors.Forms.StringOperator.Contains:
             return T("{0} contains '{1}'", fieldName, value);
         case Orchard.Projections.FilterEditors.Forms.StringOperator.ContainsAny:
             return T("{0} contains any of '{1}'", fieldName, new LocalizedString(String.Join("', '", value.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries))));
         case Orchard.Projections.FilterEditors.Forms.StringOperator.ContainsAll:
             return T("{0} contains all '{1}'", fieldName, new LocalizedString(String.Join("', '", value.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries))));
         case Orchard.Projections.FilterEditors.Forms.StringOperator.Starts:
             return T("{0} starts with '{1}'", fieldName, value);
         case Orchard.Projections.FilterEditors.Forms.StringOperator.NotStarts:
             return T("{0} does not start with '{1}'", fieldName, value);
         case Orchard.Projections.FilterEditors.Forms.StringOperator.Ends:
             return T("{0} ends with '{1}'", fieldName, value);
         case Orchard.Projections.FilterEditors.Forms.StringOperator.NotEnds:
             return T("{0} does not end with '{1}'", fieldName, value);
         case Orchard.Projections.FilterEditors.Forms.StringOperator.NotContains:
             return T("{0} does not contain '{1}'", fieldName, value);
         default:
             throw new ArgumentOutOfRangeException();
     }
 }
开发者ID:wezmag,项目名称:Coevery,代码行数:29,代码来源:StringFilterForm.cs


示例14: OrderController

 public OrderController(IWebStoreConfigurationService webStoreConfigurationServices, IBasketServices basketServices, IWebStoreProfileServices webstoreProfileServices)
 {
     this.T = NullLocalizer.Instance;
     this._basketServices = basketServices;
     this._webstoreProfileServices = webstoreProfileServices;
     this._webStoreConfigurationServices = webStoreConfigurationServices;
 }
开发者ID:homastudiocorp,项目名称:SnagIt,代码行数:7,代码来源:OrderController.cs


示例15: AdminUserController

        public AdminUserController(
            IRepository<RoleRecord> roleRepository,
            IOrderService orderService,
            ICampaignService campaignService,
            IRepository<CurrencyRecord> currencyRepository,
            IMembershipService membershipService,
            ShellSettings shellSettings,
            IOrchardServices services,
            IUserService userService,
            ISiteService siteService,
            IShapeFactory shapeFactory)
        {
            _roleRepository = roleRepository;
            _orderService = orderService;
            _campaignService = campaignService;
            _currencyRepository = currencyRepository;
            _membershipService = membershipService;
            _shellSettings = shellSettings;
            Services = services;
            _siteService = siteService;
            _userService = userService;

            T = NullLocalizer.Instance;
            Shape = shapeFactory;
        }
开发者ID:omidam81,项目名称:Ver1.0,代码行数:25,代码来源:AdminUserController.cs


示例16: SelectRolesForms

 public SelectRolesForms(
     IShapeFactory shapeFactory,
     IRoleService roleService) {
     _roleService = roleService;
     Shape = shapeFactory;
     T = NullLocalizer.Instance;
 }
开发者ID:SunRobin2015,项目名称:RobinWithOrchard,代码行数:7,代码来源:SelectRolesForms.cs


示例17: OptionAdminController

		public OptionAdminController(IOrchardServices services, IPollService pollService) {
			_services = services;
			_pollService = pollService;
			_notifier = _services.Notifier;
			New = _services.New;
			T = NullLocalizer.Instance;
		}
开发者ID:SmartFire,项目名称:DarkSky.Poll,代码行数:7,代码来源:OptionAdminController.cs


示例18: WebShopSettingsPartHandler

 public WebShopSettingsPartHandler(IRepository<WebShopSettingsRecord> repository)
 {
     T = NullLocalizer.Instance;
     Filters.Add(new ActivatingFilter<WebShopSettingsPart>("Site"));
     Filters.Add(StorageFilter.For(repository));
     OnGetContentItemMetadata<WebShopSettingsPart>((context, part) => context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("WebShop"))));
 }
开发者ID:SmartFire,项目名称:Cascade.WebShop,代码行数:7,代码来源:WebShopSettingsPartHandler.cs


示例19: GalleryScreenshotService

 public GalleryScreenshotService(IOrchardServices orchardServices, IUserkeyService userkeyService,
     IAuthenticationService authenticationService) {
     T = NullLocalizer.Instance;
     _orchardServices = orchardServices;
     _userkeyService = userkeyService;
     _authenticationService = authenticationService;
 }
开发者ID:NickAndersonX,项目名称:xodb,代码行数:7,代码来源:GalleryScreenshotService.cs


示例20: CheckoutController

 public CheckoutController(IWebStoreServices webStoreServices, IOrchardServices orchardServices, IShapeFactory shapeFactory)
 {
     this._localizer = NullLocalizer.Instance;
     this._webStoreServices = webStoreServices;
     this._orchardServices = orchardServices;
     this._shapeFactory = shapeFactory;
 }
开发者ID:mattlucas,项目名称:BuckeyeIndustries,代码行数:7,代码来源:CheckoutController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Location类代码示例发布时间:2022-05-24
下一篇:
C# Localization类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap