Get Windows System Info Collection

1. Culture Options

复制代码
  [DisplayName("Culture Options")]
        public IEnumerable<SelectListItem> CultureOptions
        {
            get
            {
                return CultureInfo.GetCultures(CultureTypes.AllCultures).OrderBy(info => info.DisplayName)
                           .BuildSelectItemList(info => info.DisplayName, info => info.Name,
                                                info =>
                                                string.IsNullOrWhiteSpace(UiCulture)
                                                    ? Equals(info, CultureInfo.CurrentCulture)
                                                    : info.Name == UiCulture,
                                                emptyItem: null);
            }
        }
复制代码

 

2. TimeZone Options

复制代码
  public IEnumerable<SelectListItem> TimeZoneOptions
        {
            get
            {
                return TimeZoneInfo.GetSystemTimeZones()
                                   .BuildSelectItemList(info => info.DisplayName, info => info.Id,
                                                        info =>
                                                        string.IsNullOrWhiteSpace(TimeZone)
                                                            ? Equals(info, TimeZoneInfo.Local)
                                                            : info.Id == TimeZone, emptyItem: null);
            }
        }
复制代码

 

posted @   Blackeye  阅读(213)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示