private static void CloseQuietly(Connection connection, ZebraCardPrinter zebraCardPrinter) { try { if (zebraCardPrinter != null) { zebraCardPrinter.Destroy(); } } catch { } try { if (connection != null) { connection.Close(); } } catch { } }
public static void CleanUpQuietly(ZebraCardPrinter zebraCardPrinter, Connection connection) { try { if (zebraCardPrinter != null) { zebraCardPrinter.Destroy(); } } catch (ZebraCardException) { // Do nothing } try { if (connection != null) { connection.Close(); } } catch (ConnectionException) { // Do nothing } }