| 180 | } |
| 181 | |
| 182 | CultureInfo MUtils::ToNative(void* value) |
| 183 | { |
| 184 | int32 lcid = 127; |
| 185 | #if USE_MONO |
| 186 | if (value) |
| 187 | lcid = static_cast<MonoCultureInfo*>(value)->lcid; |
| 188 | #elif USE_CSHARP |
| 189 | PROFILE_MEM(Localization); |
| 190 | const MClass* klass = GetBinaryModuleCorlib()->Assembly->GetClass("System.Globalization.CultureInfo"); |
| 191 | if (value && klass) |
| 192 | { |
| 193 | MProperty* lcidProperty = klass->GetProperty("LCID"); |
| 194 | if (lcidProperty && lcidProperty->GetGetMethod()) |
| 195 | { |
| 196 | MObject* lcidObj = lcidProperty->GetGetMethod()->Invoke(value, nullptr, nullptr); |
| 197 | lcid = *(int32*)MCore::Object::Unbox(lcidObj); |
| 198 | } |
| 199 | } |
| 200 | #endif |
| 201 | return CultureInfo(lcid); |
| 202 | } |
nothing calls this directly
no test coverage detected