コード例 #1
0
 PrintSystemException(
     String message
     ) : base(GetMessageFromResource(PrinterHResult.HResultFromWin32((int)PrinterHResult.Error.PrintSystemGenericError),
                                     message))
 {
     base.HResult = PrinterHResult.HResultFromWin32((int)PrinterHResult.Error.PrintSystemGenericError);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 PrintSystemException(
     ) : base(GetMessageFromResource("PrintSystemException.Generic"))
 {
     base.HResult = PrinterHResult.HResultFromWin32((int)PrinterHResult.Error.PrintSystemGenericError);
 }
コード例 #4
0
 PrintingCanceledException(
     ) : base(PrinterHResult.HResultFromWin32((int)PrinterHResult.Error.PrintingCancelledGenericError), "PrintSystemException.PrintingCancelled.Generic")
 {
 }