本文整理汇总了C#中System.Globalization.TextInfo类的典型用法代码示例。如果您正苦于以下问题:C# TextInfo类的具体用法?C# TextInfo怎么用?C# TextInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextInfo类属于System.Globalization命名空间,在下文中一共展示了TextInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CaseInsensitiveHashCodeProvider
public CaseInsensitiveHashCodeProvider(CultureInfo culture) {
if (culture==null) {
throw new ArgumentNullException("culture");
}
Contract.EndContractBlock();
m_text = culture.TextInfo;
}
示例2: CaseInsensitiveHashCodeProvider
public CaseInsensitiveHashCodeProvider (CultureInfo culture)
{
if (culture == null)
throw new ArgumentNullException ("culture");
if (!AreEqual (culture, CultureInfo.InvariantCulture))
m_text = culture.TextInfo;
}
示例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;
}
示例4: CaseInsensitiveHashCodeProvider
public CaseInsensitiveHashCodeProvider(CultureInfo culture)
{
if(culture == null)
{
throw new ArgumentNullException("culture");
}
info = culture.TextInfo;
}
示例5: MarkdownService
public MarkdownService(IContentProvider contentProvider)
{
ContentProvider = contentProvider;
_markdown = new MarkdownSharp.Markdown(CreateMarkdownOptions());
_invariantTextInfo = CultureInfo.InvariantCulture.TextInfo;
Tranformers = new Tranformers();
}
示例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");
}
示例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;
}
示例8: InInsertMacro
public InInsertMacro()
{
textInfo = cultureInfo.TextInfo;
}
示例9: ButtonEx
/// <summary>
/// ���캯����
/// </summary>
public ButtonEx()
: base(HtmlTextWriterTag.Input)
{
this.Width = new Unit("70px");
this.CssClass = "ButtonFlat";
this.textInfo = Thread.CurrentThread.CurrentCulture.TextInfo;
}
示例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;
}
示例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;
}
示例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;
}
示例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
}
示例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);
}
示例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;
}