PrintSystemException( String message ) : base(GetMessageFromResource(PrinterHResult.HResultFromWin32((int)PrinterHResult.Error.PrintSystemGenericError), message)) { base.HResult = PrinterHResult.HResultFromWin32((int)PrinterHResult.Error.PrintSystemGenericError); }
GetMessageFromResource( int errorCode, String resourceKey ) { String exceptionMessage = null; String resourceString = printResourceManager.GetString(resourceKey, System.Threading.Thread.CurrentThread.CurrentUICulture); if (PrinterHResult.HResultFacility(errorCode) == PrinterHResult.Facility.Win32) { exceptionMessage = String.Format(System.Threading.Thread.CurrentThread.CurrentUICulture, resourceString, GetFormattedWin32Error(PrinterHResult.HResultCode(errorCode))); } else { exceptionMessage = String.Format(System.Threading.Thread.CurrentThread.CurrentUICulture, resourceString, errorCode); } return(exceptionMessage); }
PrintSystemException( ) : base(GetMessageFromResource("PrintSystemException.Generic")) { base.HResult = PrinterHResult.HResultFromWin32((int)PrinterHResult.Error.PrintSystemGenericError); }
PrintingCanceledException( ) : base(PrinterHResult.HResultFromWin32((int)PrinterHResult.Error.PrintingCancelledGenericError), "PrintSystemException.PrintingCancelled.Generic") { }