示例#1
0
 static public IntPtr GetNonNullHandle(this INativeObject self, string argumentName)
 {
     if (self == null)
     {
         throw new ArgumentNullException(nameof(argumentName));
     }
     if (self.Handle == IntPtr.Zero)
     {
         throw new ObjectDisposedException(self.GetType().ToString());
     }
     return(self.Handle);
 }