Skip to content

Commit

Permalink
Update culture infos and implement missing or not implemented members
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-safar committed May 15, 2012
1 parent a61485e commit 9d5de96
Show file tree
Hide file tree
Showing 20 changed files with 5,070 additions and 2,766 deletions.
34 changes: 18 additions & 16 deletions mcs/class/corlib/System.Globalization/CompareInfo.cs
Expand Up @@ -62,19 +62,21 @@ void IDeserializationCallback.OnDeserialization(object sender)
/* This will build the ICU collator, and store
* the pointer in ICU_collator
*/
/*
try {
this.construct_compareinfo (icu_name);
} catch {
// ICU_collator=IntPtr.Zero;
}
*/
}
}

[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern void construct_compareinfo (string locale);
//[MethodImplAttribute (MethodImplOptions.InternalCall)]
//private extern void construct_compareinfo (string locale);

[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern void free_internal_collator ();
//[MethodImplAttribute (MethodImplOptions.InternalCall)]
//private extern void free_internal_collator ();

[MethodImplAttribute (MethodImplOptions.InternalCall)]
private extern int internal_compare (string str1, int offset1,
Expand Down Expand Up @@ -113,15 +115,16 @@ public class CompareInfo {

// Keep in synch with MonoCompareInfo in the runtime.
private int culture;
[NonSerialized]
private string icu_name;
// [NonSerialized]
// private string icu_name;
// [NonSerialized]
// private IntPtr ICU_collator;

#pragma warning disable 169
private int win32LCID; // Unused, but MS.NET serializes this
private string m_name; // Unused, but MS.NET serializes this
#pragma warning restore 169

readonly string m_name; // MS.NET serializes this

[NonSerialized]
SimpleCollator collator;
Expand All @@ -133,12 +136,10 @@ public class CompareInfo {
// Protects access to 'collators'
private static object monitor = new Object ();

/* Hide the .ctor() */
CompareInfo() {}

internal CompareInfo (CultureInfo ci)
{
this.culture = ci.LCID;
this.m_name = ci.Name;
if (UseManagedCollation) {
lock (monitor) {
if (collators == null)
Expand All @@ -150,20 +151,22 @@ internal CompareInfo (CultureInfo ci)
}
}
} else {
/*
#if !MOONLIGHT
this.icu_name = ci.IcuName;
this.construct_compareinfo (icu_name);
#endif
*/
}
}

/*
~CompareInfo ()
{
#if !MOONLIGHT
free_internal_collator ();
#endif
}

*/
#if !MOONLIGHT
private int internal_compare_managed (string str1, int offset1,
int length1, string str2,
Expand Down Expand Up @@ -853,16 +856,15 @@ public override string ToString()
* shows it. Some documentation about what it does
* would be nice.
*/
public int LCID
{
public int LCID {
get {
return(culture);
return culture;
}
}

[ComVisible (false)]
public virtual string Name {
get { return icu_name; }
get { return m_name; }
}
}
}

0 comments on commit 9d5de96

Please sign in to comment.