mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 04:18:43 +00:00
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System;
|
|
using IL2CPU.API;
|
|
using IL2CPU.API.Attribs;
|
|
|
|
namespace Cosmos.Core_Plugs.System
|
|
{
|
|
[Plug(Target = typeof(Exception))]
|
|
public static class ExceptionImpl
|
|
{
|
|
private static string mMessage;
|
|
|
|
public static unsafe string GetClassName(
|
|
[ObjectPointerAccess] uint* aThis)
|
|
{
|
|
int xObjectType = (int)*aThis;
|
|
return "**Not Able to determine Exception Type**";
|
|
}
|
|
public static string get_Message(Exception aThis)
|
|
{
|
|
return mMessage;
|
|
}
|
|
|
|
[PlugMethod(Signature = "System_String__System_Exception_GetMessageFromNativeResources_System_Exception_ExceptionMessageKind_")]
|
|
public static string GetMessageFromNativeResources(int aKind)
|
|
{
|
|
if (aKind == 0x3)
|
|
{
|
|
return "Out of memory!";
|
|
}
|
|
return "<Exception Message from Native Source>";
|
|
}
|
|
|
|
public static void Ctor(Exception aThis, string aMessage)
|
|
{
|
|
mMessage = aMessage;
|
|
}
|
|
|
|
public static string ToString(Exception aThis)
|
|
{
|
|
return "Exception: " + aThis.Message;
|
|
}
|
|
}
|
|
}
|