private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { try { if (mBolConnected) { mObjWeighingMachine.Disconnect(mObjConnection); } } catch (Exception lObjException) { CustomMessageBox.Show("Error", lObjException.Message); } }
private void DisconnectWeighingMachineService() { grdContainer.BlockUI(); try { if (mBolWeighingMachineLoaded) { mObjWeighingMachineServer.Disconnect(mObjWeighingMachineConnection); } } catch (Exception lObjException) { grdContainer.UnblockUI(); ShowMessage("Error", lObjException.Message); mBolWeighingMachineLoaded = false; } finally { grdContainer.UnblockUI(); } }