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


C# Globalization.CultureData类代码示例

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


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

示例1: TextInfo

 //////////////////////////////////////////////////////////////////////////
 ////
 ////  TextInfo Constructors
 ////
 ////  Implements CultureInfo.TextInfo.
 ////
 //////////////////////////////////////////////////////////////////////////
 internal unsafe TextInfo(CultureData cultureData)
 {
     _cultureData = cultureData;
     _cultureName = _cultureData.CultureName;
     _textInfoName = _cultureData.STEXTINFO;
     FinishInitialization(_textInfoName);
 }
开发者ID:kouvel,项目名称:coreclr,代码行数:14,代码来源:TextInfo.Unix.cs

示例2: RegionInfo

        [System.Security.SecuritySafeCritical]  // auto-generated
        public RegionInfo(String name) {
            if (name==null)
                throw new ArgumentNullException("name");

            if (name.Length == 0) //The InvariantCulture has no matching region
            { 
                throw new ArgumentException(Environment.GetResourceString("Argument_NoRegionInvariantCulture"));
            }
            
            Contract.EndContractBlock();

            //
            // First try it as an entire culture. We must have user override as true here so
            // that we can pick up custom cultures *before* built-in ones (if they want to
            // prefer built-in cultures they will pass "us" instead of "en-US").
            //
            this.m_cultureData = CultureData.GetCultureDataForRegion(name,true);
            // this.m_name = name.ToUpper(CultureInfo.InvariantCulture);

            if (this.m_cultureData == null)
                throw new ArgumentException(
                    String.Format(
                        CultureInfo.CurrentCulture,
                        Environment.GetResourceString("Argument_InvalidCultureName"), name), "name");


            // Not supposed to be neutral
            if (this.m_cultureData.IsNeutralCulture)
                throw new ArgumentException(Environment.GetResourceString("Argument_InvalidNeutralRegionName", name), "name");

            SetName(name);
        }
开发者ID:l1183479157,项目名称:coreclr,代码行数:33,代码来源:RegionInfo.cs

示例3: TextInfo

 internal TextInfo(CultureData cultureData)
 {
     this.m_cultureData = cultureData;
     this.m_cultureName = this.m_cultureData.CultureName;
     this.m_textInfoName = this.m_cultureData.STEXTINFO;
     this.m_dataHandle = CompareInfo.InternalInitSortHandle(this.m_textInfoName);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:TextInfo.cs

示例4: RegionInfo

        [System.Security.SecuritySafeCritical]  // auto-generated
        public RegionInfo(String name)
        {
            if (name == null)
                throw new ArgumentNullException("name");

            if (name.Length == 0) //The InvariantCulture has no matching region
            {
                throw new ArgumentException(SR.Argument_NoRegionInvariantCulture);
            }

            Contract.EndContractBlock();

            //
            // For CoreCLR we only want the region names that are full culture names
            //
            this.m_cultureData = CultureData.GetCultureDataForRegion(name, true);
            if (this.m_cultureData == null)
                throw new ArgumentException(
                    String.Format(
                        CultureInfo.CurrentCulture,
                        SR.Argument_InvalidCultureName, name), "name");


            // Not supposed to be neutral
            if (this.m_cultureData.IsNeutralCulture)
                throw new ArgumentException(SR.Format(SR.Argument_InvalidNeutralRegionName, name), "name");

            SetName(name);
        }
开发者ID:l1183479157,项目名称:coreclr,代码行数:30,代码来源:RegionInfo.cs

示例5: TextInfo

 //////////////////////////////////////////////////////////////////////////
 ////
 ////  TextInfo Constructors
 ////
 ////  Implements CultureInfo.TextInfo.
 ////
 //////////////////////////////////////////////////////////////////////////
 internal unsafe TextInfo(CultureData cultureData)
 {
     // TODO: Implement this fully.
     this.m_cultureData = cultureData;
     this.m_cultureName = this.m_cultureData.CultureName;
     this.m_textInfoName = this.m_cultureData.STEXTINFO;
 }
开发者ID:enavro,项目名称:coreclr,代码行数:14,代码来源:TextInfo.Unix.cs

示例6: TextInfo

 //////////////////////////////////////////////////////////////////////////
 ////
 ////  TextInfo Constructors
 ////
 ////  Implements CultureInfo.TextInfo.
 ////
 //////////////////////////////////////////////////////////////////////////
 internal unsafe TextInfo(CultureData cultureData)
 {
     m_cultureData = cultureData;
     m_cultureName = m_cultureData.CultureName;
     m_textInfoName = m_cultureData.STEXTINFO;
     m_needsTurkishCasing = NeedsTurkishCasing(m_textInfoName);
 }
开发者ID:Rayislandstyle,项目名称:dotnet-coreclr,代码行数:14,代码来源:TextInfo.Unix.cs

示例7: TextInfo

 //////////////////////////////////////////////////////////////////////////
 ////
 ////  TextInfo Constructors
 ////
 ////  Implements CultureInfo.TextInfo.
 ////
 //////////////////////////////////////////////////////////////////////////
 internal unsafe TextInfo(CultureData cultureData)
 {
     // TODO: Implement this fully.
     m_cultureData = cultureData;
     m_cultureName = m_cultureData.CultureName;
     m_textInfoName = m_cultureData.STEXTINFO;
     m_needsTurkishCasing = NeedsTurkishCasing(this.m_textInfoName);
 }
开发者ID:perfectphase,项目名称:coreclr,代码行数:15,代码来源:TextInfo.Unix.cs

示例8: TextInfo

 //////////////////////////////////////////////////////////////////////////
 ////
 ////  TextInfo Constructors
 ////
 ////  Implements CultureInfo.TextInfo.
 ////
 //////////////////////////////////////////////////////////////////////////
 internal unsafe TextInfo(CultureData cultureData)
 {
     // This is our primary data source, we don't need most of the rest of this
     this.m_cultureData = cultureData;
     this.m_cultureName = this.m_cultureData.CultureName;
     this.m_textInfoName = this.m_cultureData.STEXTINFO;
     FinishInitialization(this.m_textInfoName);
 }
开发者ID:dagood,项目名称:coreclr,代码行数:15,代码来源:TextInfo.Windows.cs

示例9: TestThatCultureIsSavedAndReturned

        public void TestThatCultureIsSavedAndReturned()
        {
            var culture = new CultureData(CultureInfo.CurrentCulture);

            var entry = new LanguageEntry(culture);

            Assert.AreEqual(culture, entry.Language);
        }
开发者ID:hangy,项目名称:openfoodfacts-category-web,代码行数:8,代码来源:LanguageEntryTests.cs

示例10: TextInfo

        //////////////////////////////////////////////////////////////////////////
        ////
        ////  TextInfo Constructors
        ////
        ////  Implements CultureInfo.TextInfo.
        ////
        //////////////////////////////////////////////////////////////////////////
        internal unsafe TextInfo(CultureData cultureData)
        {
            const uint LCMAP_SORTHANDLE = 0x20000000;

            // This is our primary data source, we don't need most of the rest of this
            _cultureData = cultureData;
            _cultureName = _cultureData.CultureName;
            _textInfoName = _cultureData.STEXTINFO;

            long handle;
            int ret = Interop.mincore.LCMapStringEx(_textInfoName, LCMAP_SORTHANDLE, null, 0, &handle, IntPtr.Size, null, null, IntPtr.Zero);
            _sortHandle = ret > 0 ? (IntPtr)handle : IntPtr.Zero;
        }
开发者ID:huamichaelchen,项目名称:corert,代码行数:20,代码来源:TextInfo.Win32.cs

示例11: OnDeserialized

        private void OnDeserialized(StreamingContext ctx)
        {
            if (this.m_name != null)
            {
                m_cultureData = CultureData.GetCultureData(m_name, m_useUserOverride);
                // 
                if (this.m_cultureData == null)
                    throw new CultureNotFoundException(
                        "m_name", m_name, Environment.GetResourceString("Argument_CultureNotSupported"));
            }
            // Note: This is for Everett compatibility
            // 
#if FEATURE_USE_LCID
            else
                m_cultureData = CultureData.GetCultureData(CultureID, m_useUserOverride);
#endif
            if (calendar == null)
            {
                calendar = (Calendar) GregorianCalendar.GetDefaultInstance().Clone();
                calendar.SetReadOnlyState(m_isReadOnly);
            }
            else
            {
                CultureInfo.CheckDomainSafetyObject(calendar, this);
            }
            InitializeOverridableProperties(m_cultureData, calendar.ID);

            //
            //  turn off read only state till we finish initializing all fields and then store read only state after we are done.
            //
            bool isReadOnly = m_isReadOnly;
            m_isReadOnly = false;

            // If we deserialized defaults ala Whidbey, make sure they're still defaults
            // Whidbey's arrays could get a bit mixed up.
            if (longDatePattern  != null) this.LongDatePattern  = longDatePattern;
            if (shortDatePattern != null) this.ShortDatePattern = shortDatePattern;
            if (yearMonthPattern != null) this.YearMonthPattern = yearMonthPattern;
            if (longTimePattern  != null) this.LongTimePattern  = longTimePattern;
            if (shortTimePattern != null) this.ShortTimePattern = shortTimePattern;
            
            m_isReadOnly = isReadOnly;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:43,代码来源:DateTimeFormatInfo.cs

示例12: nativeInitCultureData

 internal static extern bool nativeInitCultureData(CultureData cultureData);
开发者ID:JonHanna,项目名称:coreclr,代码行数:1,代码来源:CultureData.cs

示例13: OnDeserialized

        private void OnDeserialized(StreamingContext ctx)
        {
#if FEATURE_CORECLR            
            // This won't happen anyway since CoreCLR doesn't support serialization
            this.m_cultureData = CultureData.GetCultureData(m_name, true);
#else
            if (m_name == null)
            {
                Contract.Assert(m_dataItem >= 0, "[RegionInfo.OnDeserialized] null name and invalid dataItem");
                m_cultureId = IdFromEverettRegionInfoDataItem[m_dataItem];
            }

            if (m_cultureId == 0)
            {
                this.m_cultureData = CultureData.GetCultureDataForRegion(this.m_name, true);
            }
            else
            {
                this.m_cultureData = CultureData.GetCultureData(m_cultureId, true);
            }
                
#endif
            if (this.m_cultureData == null)
                throw new ArgumentException(
                    String.Format(
                        CultureInfo.CurrentCulture,
                        Environment.GetResourceString("Argument_InvalidCultureName"), m_name), "m_name");

            if (m_cultureId == 0)
            {
                SetName(this.m_name);
            }
            else
            {
                this.m_name = this.m_cultureData.SREGIONNAME;
            }
        }
开发者ID:l1183479157,项目名称:coreclr,代码行数:37,代码来源:RegionInfo.cs

示例14: CreateCultureData

        private static CultureData CreateCultureData(string cultureName, bool useUserOverride)
        {
            CultureData culture = new CultureData();
            culture._bUseOverrides = useUserOverride;
            culture._sRealName = cultureName;

            // Ask native code if that one's real
            if (culture.InitCultureData() == false)
            {
                if (culture.InitCompatibilityCultureData() == false)
                {
                    return null;
                }
            }

            return culture;
        }
开发者ID:kyulee1,项目名称:corert,代码行数:17,代码来源:CultureData.cs

示例15: TextInfo

        ////////////////////////////////////////////////////////////////////////
        //
        //  TextInfo Constructors
        //
        //  Implements CultureInfo.TextInfo.
        //
        ////////////////////////////////////////////////////////////////////////
        internal TextInfo(CultureData cultureData) 
        {
            // This is our primary data source, we don't need most of the rest of this
            this.m_cultureData = cultureData;
            this.m_cultureName = this.m_cultureData.CultureName;
            this.m_textInfoName = this.m_cultureData.STEXTINFO;
#if !FEATURE_CORECLR
            IntPtr handleOrigin;
            this.m_dataHandle = CompareInfo.InternalInitSortHandle(m_textInfoName, out handleOrigin);
            this.m_handleOrigin = handleOrigin;
#endif
        }
开发者ID:gsfreema,项目名称:coreclr,代码行数:19,代码来源:TextInfo.cs


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