public void Dispose() { //make sure printer is cleaned up if (_printer != null) { _printer.Dispose(); _printer = null; } }
private Task InitializeAsync() { try { //if this fails, it is likely that the Proxy stub COM component has not been registered using regsvr32 //or, the proxy stub and winmd file is not in the expected directory, or permissions on that directory hav not been setup _printer = new OPOSPrinterServer(_deviceName); } catch (Exception ex) { throw new PrinterLayerException(PrinterError.NotFound, ex); } return(Task.FromResult <bool>(true)); //to avoid warning }