public virtual Object Clone()
{
CultureInfo ci = (CultureInfo)MemberwiseClone();
ci._isReadOnly = false;
//If this is exactly our type, we can make certain optimizations so that we don't allocate NumberFormatInfo or DTFI unless
//they've already been allocated. If this is a derived type, we'll take a more generic codepath.
if (!m_isInherited)
{
if (this.dateTimeInfo != null)
{
ci.dateTimeInfo = (DateTimeFormatInfo)this.dateTimeInfo.Clone();
}
if (this.numInfo != null)
{
ci.numInfo = (NumberFormatInfo)this.numInfo.Clone();
}
}
else
{
ci.DateTimeFormat = (DateTimeFormatInfo)this.DateTimeFormat.Clone();
ci.NumberFormat = (NumberFormatInfo)this.NumberFormat.Clone();
}
if (_textInfo != null)
{
ci._textInfo = (TextInfo)_textInfo.Clone();
}
if (_calendar != null)
{
ci._calendar = (Calendar)_calendar.Clone();
}
return(ci);
}