TextInfo.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. //
  2. // System.Globalization.TextInfo.cs
  3. //
  4. // Author:
  5. // Dick Porter ([email protected])
  6. // Duncan Mak ([email protected])
  7. //
  8. // (C) 2002 Ximian, Inc.
  9. //
  10. //
  11. // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
  12. //
  13. // Permission is hereby granted, free of charge, to any person obtaining
  14. // a copy of this software and associated documentation files (the
  15. // "Software"), to deal in the Software without restriction, including
  16. // without limitation the rights to use, copy, modify, merge, publish,
  17. // distribute, sublicense, and/or sell copies of the Software, and to
  18. // permit persons to whom the Software is furnished to do so, subject to
  19. // the following conditions:
  20. //
  21. // The above copyright notice and this permission notice shall be
  22. // included in all copies or substantial portions of the Software.
  23. //
  24. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  25. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  26. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  27. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  28. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  29. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  30. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  31. //
  32. using System.Globalization;
  33. using System.Runtime.Serialization;
  34. namespace System.Globalization {
  35. [Serializable]
  36. public class TextInfo: IDeserializationCallback
  37. {
  38. private int m_win32LangID;
  39. int m_nDataItem;
  40. bool m_useUserOverride;
  41. internal TextInfo ()
  42. {
  43. }
  44. internal TextInfo (int lcid)
  45. {
  46. this.m_win32LangID=lcid;
  47. }
  48. [MonoTODO]
  49. public virtual int ANSICodePage
  50. {
  51. get {
  52. return(0);
  53. }
  54. }
  55. [MonoTODO]
  56. public virtual int EBCDICCodePage
  57. {
  58. get {
  59. return(0);
  60. }
  61. }
  62. [MonoTODO]
  63. public virtual string ListSeparator
  64. {
  65. get {
  66. return(",");
  67. }
  68. }
  69. [MonoTODO]
  70. public virtual int MacCodePage
  71. {
  72. get {
  73. return(0);
  74. }
  75. }
  76. [MonoTODO]
  77. public virtual int OEMCodePage
  78. {
  79. get {
  80. return(0);
  81. }
  82. }
  83. [MonoTODO]
  84. public override bool Equals(object obj)
  85. {
  86. throw new NotImplementedException();
  87. }
  88. public override int GetHashCode()
  89. {
  90. return(m_win32LangID);
  91. }
  92. [MonoTODO]
  93. public virtual char ToLower(char c)
  94. {
  95. return Char.ToLower (c);
  96. }
  97. [MonoTODO]
  98. public virtual string ToLower(string str)
  99. {
  100. if(str==null) {
  101. throw new ArgumentNullException("string is null");
  102. }
  103. Text.StringBuilder s = new Text.StringBuilder ();
  104. foreach (char c in str) {
  105. s.Append (Char.ToLower (c));
  106. }
  107. return s.ToString ();
  108. }
  109. [MonoTODO]
  110. public override string ToString()
  111. {
  112. return("TextInfo");
  113. }
  114. public string ToTitleCase (string str)
  115. {
  116. if(str == null)
  117. throw new ArgumentNullException("string is null");
  118. Text.StringBuilder s = new Text.StringBuilder ();
  119. s.Append (Char.ToUpper (str [0]));
  120. for (int i = 1; i < str.Length; i ++)
  121. s.Append (str [i]);
  122. return s.ToString ();
  123. }
  124. [MonoTODO]
  125. public virtual char ToUpper(char c)
  126. {
  127. return('X');
  128. }
  129. [MonoTODO]
  130. public virtual string ToUpper(string str)
  131. {
  132. if(str==null) {
  133. throw new ArgumentNullException("string is null");
  134. }
  135. return("");
  136. }
  137. /* IDeserialization interface */
  138. [MonoTODO]
  139. void IDeserializationCallback.OnDeserialization(object sender)
  140. {
  141. }
  142. }
  143. }