コード例 #1
0
ファイル: JniObject.cs プロジェクト: tottty/csjni
 protected internal JniObject(JniEnvironment environment, IntPtr handle, JniObjectLifecycle lifecycle)
 {
     if (handle == IntPtr.Zero)
     {
         throw new JniException("TODO");
     }
     if (lifecycle == JniObjectLifecycle.Dead)
     {
         throw new JniException("Invalid starting state");
     }
     mHandle = handle;
     mLifeCycle = lifecycle;
     if (mLifeCycle == JniObjectLifecycle.Local)
     {
         environment.AddToCurrentFrame(this);
     }
     else if (mLifeCycle == JniObjectLifecycle.LocalJ2N)
     {
         mWillFinalize = false;
         GC.SuppressFinalize(this);
     }
 }