示例#1
0
    public static bool Require(ProtectedMethod Method)
    {
        IntPtr State  = IntPtr.Zero;
        IntPtr Result = rb_protect(Method, Nil, ref State);

        return(Result == IntPtr.Zero);
    }
示例#2
0
    public static IntPtr SafeRuby(ProtectedMethod Method)
    {
        IntPtr State  = IntPtr.Zero;
        IntPtr Result = rb_protect(Method, Nil, ref State);

        if (State != IntPtr.Zero)
        {
            RaiseException();
        }
        return(Result);
    }