Ejemplo n.º 1
0
        internal JNetThrowableException(JNetRuntime runtime, jthrowable throwable)
            : base(GetMessage(runtime, throwable))
        {
            // TODO: enrich exception information (asynchronously)

            Throwable = throwable;
        }
Ejemplo n.º 2
0
        private static string GetMessage(JNetRuntime runtime, jthrowable throwable)
        {
            // TODO: Can we get 'throwable' message asynchronously (using another runtime instance)?

            var clz_Throwable = runtime.GetObjectClass(throwable);

            var mid_GetMessage = runtime.GetMethodID(clz_Throwable, "getMessage", "()Ljava/lang/String;");
            var jmessage       = (jstring)runtime.CallObjectMethod(throwable, mid_GetMessage);

            return(runtime.ToString(jmessage));
        }
Ejemplo n.º 3
0
 // Throw
 public jint Throw(jthrowable obj)
 => functions->Throw(env, obj);