码迷,mamicode.com
首页 > Windows程序 > 详细

Get Windows System Info Collection

时间:2015-07-31 00:58:30      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:

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);
            }
        }

 

Get Windows System Info Collection

标签:

原文地址:http://www.cnblogs.com/Blackeye286/p/4136117.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!