2 * libvlc.cs - libvlc-control CIL bindings
7 /**********************************************************************
8 * Copyright (C) 2007 RĂ©mi Denis-Courmont. *
9 * This program is free software; you can redistribute and/or modify *
10 * it under the terms of the GNU General Public License as published *
11 * by the Free Software Foundation; version 2 of the license, or (at *
12 * your option) any later version. *
14 * This program is distributed in the hope that it will be useful, *
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
17 * See the GNU General Public License for more details. *
19 * You should have received a copy of the GNU General Public License *
20 * along with this program; if not, you can get it from: *
21 * http://www.gnu.org/copyleft/gpl.html *
22 **********************************************************************/
25 using System.Runtime.InteropServices;
27 namespace VideoLAN.LibVLC
30 * Abstract safe handle class for non-NULL pointers
31 * (Microsoft.* namespace has a similar class, but lets stick to System.*)
33 public abstract class NonNullHandle : SafeHandle
35 protected NonNullHandle ()
36 : base (IntPtr.Zero, true)
40 public override bool IsInvalid
44 return handle == IntPtr.Zero;
49 public class BaseObject<HandleT> : IDisposable where HandleT : SafeHandle
51 protected NativeException ex;
52 protected HandleT self;
54 internal BaseObject (HandleT self)
57 ex = new NativeException ();
60 public void Dispose ()