本文整理汇总了C#中System.Globalization.TextInfo类的典型用法代码示例。如果您正苦于以下问题:C# TextInfo类的具体用法?C# TextInfo怎么用?C# TextInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextInfo类属于System.Globalization命名空间,在下文中一共展示了TextInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CaseInsensitiveHashCodeProvider
public CaseInsensitiveHashCodeProvider(CultureInfo culture) {
if (culture==null) {
throw new ArgumentNullException("culture");
}
Contract.EndContractBlock();
m_text = culture.TextInfo;
}
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:caseinsensitivehashcodeprovider.cs
示例2: CaseInsensitiveHashCodeProvider
public CaseInsensitiveHashCodeProvider (CultureInfo culture)
{
if (culture == null)
throw new ArgumentNullException ("culture");
if (!AreEqual (culture, CultureInfo.InvariantCulture))
m_text = culture.TextInfo;
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:CaseInsensitiveHashCodeProvider.cs
示例3: EnergyBarWrapper
public EnergyBarWrapper(EnergyBar bBar, EnergyBar cBar)
{
bullsBar = bBar.GetComponent<EnergyBar>();
cleotsBar = cBar.GetComponent<EnergyBar>();
// Take that h-bar.
myTI = new CultureInfo("en-US",false).TextInfo;
}
开发者ID:CalPolyGameDevelopment,项目名称:ettell,代码行数:7,代码来源:EnergyBarWrapper.cs
示例4: CaseInsensitiveHashCodeProvider
public CaseInsensitiveHashCodeProvider(CultureInfo culture)
{
if(culture == null)
{
throw new ArgumentNullException("culture");
}
info = culture.TextInfo;
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:CaseInsensitiveHashCodeProvider.cs
示例5: MarkdownService
public MarkdownService(IContentProvider contentProvider)
{
ContentProvider = contentProvider;
_markdown = new MarkdownSharp.Markdown(CreateMarkdownOptions());
_invariantTextInfo = CultureInfo.InvariantCulture.TextInfo;
Tranformers = new Tranformers();
}
开发者ID:ststeiger,项目名称:MarkdownReaderAndWriter,代码行数:10,代码来源:MarkdownService.cs
示例6: CompareProperties
private void CompareProperties (TextInfo t1, TextInfo t2, bool compareReadOnly)
{
Assert.AreEqual (t1.ANSICodePage, t2.ANSICodePage, "ANSICodePage");
Assert.AreEqual (t1.EBCDICCodePage, t2.EBCDICCodePage, "EBCDICCodePage");
Assert.AreEqual (t1.ListSeparator, t2.ListSeparator, "ListSeparator");
Assert.AreEqual (t1.MacCodePage, t2.MacCodePage, "MacCodePage");
Assert.AreEqual (t1.OEMCodePage, t2.OEMCodePage, "OEMCodePage");
Assert.AreEqual (t1.CultureName, t2.CultureName, "CultureName");
if (compareReadOnly)
Assert.AreEqual (t1.IsReadOnly, t2.IsReadOnly, "IsReadOnly");
//FIXME Assert.AreEqual (t1.IsRightToLeft, t2.IsRightToLeft, "IsRightToLeft");
Assert.AreEqual (t1.LCID, t2.LCID, "LCID");
}
开发者ID:sushihangover,项目名称:playscript,代码行数:13,代码来源:TextInfoTest.cs
示例7: ResourceWriter
// Constructors.
public ResourceWriter(Stream stream)
{
if(stream == null)
{
throw new ArgumentNullException("stream");
}
else if(!stream.CanWrite)
{
throw new ArgumentException
(_("IO_NotSupp_Write"), "stream");
}
this.stream = stream;
generateDone = false;
table = new Hashtable();
ignoreCaseNames = new Hashtable();
types = new ArrayList();
info = CultureInfo.InvariantCulture.TextInfo;
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:19,代码来源:ResourceWriter.cs
示例8: InInsertMacro
public InInsertMacro()
{
textInfo = cultureInfo.TextInfo;
}
开发者ID:neilmayhew,项目名称:pathway,代码行数:4,代码来源:InInsertMacro.cs
示例9: ButtonEx
/// <summary>
/// ���캯����
/// </summary>
public ButtonEx()
: base(HtmlTextWriterTag.Input)
{
this.Width = new Unit("70px");
this.CssClass = "ButtonFlat";
this.textInfo = Thread.CurrentThread.CurrentCulture.TextInfo;
}
开发者ID:jeasonyoung,项目名称:csharp_ipower,代码行数:11,代码来源:ButtonEx.cs
示例10: CultureInfo
// Constructor called by SQL Server's special munged culture - creates a culture with
// a TextInfo and CompareInfo that come from a supplied alternate source. This object
// is ALWAYS read-only.
// Note that we really cannot use an LCID version of this override as the cached
// name we create for it has to include both names, and the logic for this is in
// the GetCultureInfo override *only*.
internal CultureInfo(String cultureName, String textAndCompareCultureName)
{
if (cultureName==null) {
throw new ArgumentNullException("cultureName",
Environment.GetResourceString("ArgumentNull_String"));
}
Contract.EndContractBlock();
this.m_cultureData = CultureData.GetCultureData(cultureName, false);
if (this.m_cultureData == null)
throw new CultureNotFoundException(
"cultureName", cultureName, Environment.GetResourceString("Argument_CultureNotSupported"));
this.m_name = this.m_cultureData.CultureName;
CultureInfo altCulture = GetCultureInfo(textAndCompareCultureName);
this.compareInfo = altCulture.CompareInfo;
this.textInfo = altCulture.TextInfo;
}
开发者ID:l1183479157,项目名称:coreclr,代码行数:25,代码来源:CultureInfo.cs
示例11: ReadOnly
public static TextInfo ReadOnly (TextInfo textInfo)
{
if (textInfo == null)
throw new ArgumentNullException ("textInfo");
TextInfo ti = new TextInfo (textInfo);
ti.m_isReadOnly = true;
return ti;
}
开发者ID:t-ashula,项目名称:mono,代码行数:9,代码来源:TextInfo.cs
示例12: TextInfo
private TextInfo (TextInfo textInfo)
{
m_win32LangID = textInfo.m_win32LangID;
m_nDataItem = textInfo.m_nDataItem;
m_useUserOverride = textInfo.m_useUserOverride;
m_listSeparator = textInfo.ListSeparator;
customCultureName = textInfo.CultureName;
ci = textInfo.ci;
handleDotI = textInfo.handleDotI;
data = textInfo.data;
}
开发者ID:t-ashula,项目名称:mono,代码行数:11,代码来源:TextInfo.cs
示例13: AreEqual
static bool AreEqual (TextInfo info, CultureInfo culture)
{
#if !NET_2_1
return info.LCID == culture.LCID;
#else
return info.CultureName == culture.Name;
#endif
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:CaseInsensitiveHashCodeProvider.cs
示例14: ReadOnly
public static TextInfo ReadOnly(TextInfo textInfo)
{
if (textInfo == null) { throw new ArgumentNullException("textInfo"); }
if (textInfo.IsReadOnly) { return (textInfo); }
TextInfo clonedTextInfo = (TextInfo)(textInfo.MemberwiseClone());
clonedTextInfo.SetReadOnlyState(true);
return (clonedTextInfo);
}
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:10,代码来源:textinfo.cs
示例15: ConstructInvariant
private void ConstructInvariant (bool read_only)
{
cultureID = InvariantCultureId;
/* NumberFormatInfo defaults to the invariant data */
numInfo=NumberFormatInfo.InvariantInfo;
if (!read_only) {
numInfo = (NumberFormatInfo) numInfo.Clone ();
}
textInfo = CreateTextInfo (read_only);
m_name=String.Empty;
englishname=
nativename="Invariant Language (Invariant Country)";
iso3lang="IVL";
iso2lang="iv";
win3lang="IVL";
default_calendar_type = 1 << CalendarTypeBits | (int) GregorianCalendarTypes.Localized;
}
开发者ID:shana,项目名称:mono,代码行数:21,代码来源:CultureInfo.cs
示例16: ReadOnly
public static TextInfo ReadOnly(TextInfo textInfo)
{
Contract.Ensures(Contract.Result<System.Globalization.TextInfo>() != null);
return default(TextInfo);
}
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:6,代码来源:System.Globalization.TextInfo.cs
示例17: ToTitleCase
/// <summary>
/// Converts the specified string to titlecase.
/// </summary>
public static string ToTitleCase(this string str, TextInfo info)
{
return (info ?? CultureInfo.CurrentCulture.TextInfo).ToTitleCase(str);
}
开发者ID:Sword-Breaker,项目名称:fizzler,代码行数:8,代码来源:StringExtensions.cs
示例18: ConstructInvariant
private void ConstructInvariant (bool read_only)
{
cultureID = InvariantCultureId;
/* NumberFormatInfo defaults to the invariant data */
numInfo=NumberFormatInfo.InvariantInfo;
/* DateTimeFormatInfo defaults to the invariant data */
dateTimeInfo=DateTimeFormatInfo.InvariantInfo;
if (!read_only) {
numInfo = (NumberFormatInfo) numInfo.Clone ();
dateTimeInfo = (DateTimeFormatInfo) dateTimeInfo.Clone ();
}
textInfo = CreateTextInfo (read_only);
m_name=String.Empty;
displayname=
englishname=
nativename="Invariant Language (Invariant Country)";
iso3lang="IVL";
iso2lang="iv";
icu_name="en_US_POSIX";
win3lang="IVL";
}
开发者ID:nestalk,项目名称:mono,代码行数:25,代码来源:CultureInfo.cs
示例19: SimpleCollator
// readonly byte [] contractionFlags = new byte [16];
// This array is internally used inside IndexOf() to store
// "no need to check" ASCII characters.
//
// Now that it should be thread safe, this array is allocated
// at every time.
// byte [] neverMatchFlags = new byte [128 / 8];
#region .ctor() and split functions
public SimpleCollator (CultureInfo culture)
{
lcid = culture.LCID;
textInfo = culture.TextInfo;
unsafe {
SetCJKTable (culture, ref cjkIndexer,
ref cjkCatTable, ref cjkLv1Table,
ref cjkLv2Indexer, ref cjkLv2Table);
}
// Get tailoring info
TailoringInfo t = null;
for (CultureInfo ci = culture; ci.LCID != 127; ci = ci.Parent) {
t = Uni.GetTailoringInfo (ci.LCID);
if (t != null)
break;
}
if (t == null) // then use invariant
t = Uni.GetTailoringInfo (127);
frenchSort = t.FrenchSort;
Uni.BuildTailoringTables (culture, t, ref contractions,
ref level2Maps);
unsafeFlags = new byte [UnsafeFlagLength];
foreach (Contraction c in contractions) {
if (c.Source.Length > 1)
foreach (char ch in c.Source)
unsafeFlags [(int) ch / 8 ]
|= (byte) (1 << ((int) ch & 7));
// for (int i = 0; i < c.Source.Length; i++) {
// int ch = c.Source [i];
// if (ch > 127)
// continue;
// contractionFlags [ch / 8] |= (byte) (1 << (ch & 7));
// }
}
if (lcid != 127)
foreach (Contraction c in invariant.contractions) {
if (c.Source.Length > 1)
foreach (char ch in c.Source)
unsafeFlags [(int) ch / 8 ]
|= (byte) (1 << ((int) ch & 7));
// for (int i = 0; i < c.Source.Length; i++) {
// int ch = c.Source [i];
// if (ch > 127)
// continue;
// contractionFlags [ch / 8] |= (byte) (1 << (ch & 7));
// }
}
// FIXME: Since tailorings are mostly for latin
// (and in some cases Cyrillic) characters, it would
// be much better for performance to store "start
// indexes" for > 370 (culture-specific letters).
/*
// dump tailoring table
Console.WriteLine ("******** building table for {0} : contractions - {1} diacritical - {2}",
culture.LCID, contractions.Length, level2Maps.Length);
foreach (Contraction c in contractions) {
foreach (char cc in c.Source)
Console.Write ("{0:X4} ", (int) cc);
Console.WriteLine (" -> '{0}'", c.Replacement);
}
*/
}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:78,代码来源:SimpleCollator.cs
示例20: CultureInfo
// Constructor called by SQL Server's special munged culture - creates a culture with
// a TextInfo and CompareInfo that come from a supplied alternate source. This object
// is ALWAYS read-only.
// Note that we really cannot use an LCID version of this override as the cached
// name we create for it has to include both names, and the logic for this is in
// the GetCultureInfo override *only*.
internal CultureInfo(String cultureName, String textAndCompareCultureName)
{
if (cultureName==null) {
throw new ArgumentNullException("cultureName",
Environment.GetResourceString("ArgumentNull_String"));
}
this.m_cultureTableRecord = CultureTableRecord.GetCultureTableRecord(cultureName, false);
this.cultureID = this.m_cultureTableRecord.ActualCultureID;
this.m_name = this.m_cultureTableRecord.ActualName;
CultureInfo altCulture = GetCultureInfo(textAndCompareCultureName);
this.compareInfo = altCulture.CompareInfo;
this.textInfo = altCulture.TextInfo;
}
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:22,代码来源:cultureinfo.cs
注:本文中的System.Globalization.TextInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论