static void DestroysObjects(SapAcquisition acq, SapAcqDevice camera, SapBuffer buf, SapTransfer xfer, SapView view) { if (xfer != null) { xfer.Destroy(); xfer.Dispose(); } if (camera != null) { camera.Destroy(); camera.Dispose(); } if (acq != null) { acq.Destroy(); acq.Dispose(); } if (buf != null) { buf.Destroy(); buf.Dispose(); } if (view != null) { view.Destroy(); view.Dispose(); } //Console.WriteLine("\nPress any key to terminate\n"); //Console.ReadKey(true); }
static void DestroysObjects(SapAcqDevice acq, SapBuffer buf, SapTransfer xfer, SapView view) { if (xfer != null && xfer.Initialized) { xfer.Destroy(); xfer.Dispose(); } if (acq != null && acq.Initialized) { acq.Destroy(); acq.Dispose(); } if (buf != null && buf.Initialized) { buf.Destroy(); buf.Dispose(); } if (view != null && view.Initialized) { view.Destroy(); view.Dispose(); } }
static void DestroysObjects(SapAcquisition acq, SapAcqDevice camera, SapBuffer buf, SapTransfer xfer, SapView view) { if (xfer != null) { xfer.Destroy(); xfer.Dispose(); } if (camera != null) { camera.Destroy(); camera.Dispose(); } if (acq != null) { acq.Destroy(); acq.Dispose(); } if (buf != null) { buf.Destroy(); buf.Dispose(); } if (view != null) { view.Destroy(); view.Dispose(); } //Console.WriteLine("\nPress any key to terminate\n"); //Console.ReadKey(true); }
public override bool?Disconnect() { try { if (Xfer != null) { Xfer.Destroy(); Xfer.Dispose(); } if (AcqDevice != null) { AcqDevice.Destroy(); AcqDevice.Dispose(); } if (Acquisition != null) { Acquisition.Destroy(); Acquisition.Dispose(); } if (Buffers != null) { Buffers.Destroy(); Buffers.Dispose(); } if (View != null) { View.Destroy(); View.Dispose(); } if (ServerLocation != null) { ServerLocation.Dispose(); } return(true); } catch (Exception ex) { ex.ToString().Print("Disconnect Error"); return(null); } }
private void DisposeObjects() { if (m_Xfer != null) { m_Xfer.Dispose(); m_Xfer = null; } if (m_View != null) { m_View.Dispose(); m_View = null; m_ImageBox.View = null; } if (m_Buffers != null) { m_Buffers.Dispose(); m_Buffers = null; } if (m_Acquisition != null) { m_Acquisition.Dispose(); m_Acquisition = null; } }
/// <summary> /// 释放句柄 /// </summary> private void DisposeObjects() { if (m_Xfer != null) { m_Xfer.Dispose(); m_Xfer = null; } if (m_View != null) { m_View.Dispose(); m_View = null; m_ImageBox.View = null; } if (m_Buffers != null) { m_Buffers.Dispose(); m_Buffers = null; } if (m_AcqDevice != null) { m_AcqDevice.Dispose(); m_AcqDevice = null; } }