Exemplo n.º 1
0
 public MonoBtlsBioMono(IMonoBtlsBioMono backend)
     : base(new BoringBioHandle(mono_btls_bio_mono_new()))
 {
     this.backend   = backend;
     handle         = GCHandle.Alloc(this);
     instance       = GCHandle.ToIntPtr(handle);
     readFunc       = OnRead;
     writeFunc      = OnWrite;
     controlFunc    = Control;
     readFuncPtr    = Marshal.GetFunctionPointerForDelegate(readFunc);
     writeFuncPtr   = Marshal.GetFunctionPointerForDelegate(writeFunc);
     controlFuncPtr = Marshal.GetFunctionPointerForDelegate(controlFunc);
     mono_btls_bio_mono_initialize(Handle.DangerousGetHandle(), instance, readFuncPtr, writeFuncPtr, controlFuncPtr);
 }
Exemplo n.º 2
0
 protected override void Close()
 {
     try {
         if (backend != null)
         {
             backend.Close();
             backend = null;
         }
         if (handle.IsAllocated)
         {
             handle.Free();
         }
     } finally {
         base.Close();
     }
 }
Exemplo n.º 3
0
		protected override void Close ()
		{
			try {
				if (backend != null) {
					backend.Close ();
					backend = null;
				}
				if (handle.IsAllocated)
					handle.Free ();
			} finally {
				base.Close ();
			}
		}
Exemplo n.º 4
0
		public MonoBtlsBioMono (IMonoBtlsBioMono backend)
			: base (new BoringBioHandle (mono_btls_bio_mono_new ()))
		{
			this.backend = backend;
			handle = GCHandle.Alloc (this);
			instance = GCHandle.ToIntPtr (handle);
			readFunc = OnRead;
			writeFunc = OnWrite;
			controlFunc = Control;
			readFuncPtr = Marshal.GetFunctionPointerForDelegate (readFunc);
			writeFuncPtr = Marshal.GetFunctionPointerForDelegate (writeFunc);
			controlFuncPtr = Marshal.GetFunctionPointerForDelegate (controlFunc);
			mono_btls_bio_mono_initialize (Handle.DangerousGetHandle (), instance, readFuncPtr, writeFuncPtr, controlFuncPtr);
		}