コード例 #1
0
        //FIXME:
        private static string GetMessage(PdfError error)
        {
            switch (error)
            {
            case PdfError.Success:
                return("没有错误");

            case PdfError.CannotOpenFile:
                return("文件未找到或无法打开");

            case PdfError.InvalidFormat:
                return("文件不是PDF格式或损坏");

            case PdfError.PasswordProtected:
                return("需要密码或不正确的密码");

            case PdfError.UnsupportedSecurityScheme:
                return("不支持的安全方案");

            case PdfError.PageNotFound:
                return("页面找不到或内容错误");

            default:
                return("未知错误");
            }
        }
コード例 #2
0
        private static string GetMessage(PdfError error)
        {
            switch (error)
            {
            case PdfError.Success:
                return("No error");

            case PdfError.CannotOpenFile:
                return("File not found or could not be opened");

            case PdfError.InvalidFormat:
                return("File not in PDF format or corrupted");

            case PdfError.PasswordProtected:
                return("Password required or incorrect password");

            case PdfError.UnsupportedSecurityScheme:
                return("Unsupported security scheme");

            case PdfError.PageNotFound:
                return("Page not found or content error");

            default:
                return("Unknown error");
            }
        }
コード例 #3
0
ファイル: PdfException.cs プロジェクト: sungaila/PDFtoImage
 private static string GetMessage(PdfError error)
 {
     return(error switch
     {
         PdfError.Success => "No error",
         PdfError.CannotOpenFile => "File not found or could not be opened",
         PdfError.InvalidFormat => "File not in PDF format or corrupted",
         PdfError.PasswordProtected => "Password required or incorrect password",
         PdfError.UnsupportedSecurityScheme => "Unsupported security scheme",
         PdfError.PageNotFound => "Page not found or content error",
         _ => "Unknown error",
     });
コード例 #4
0
ファイル: PdfException.cs プロジェクト: sungaila/PDFtoImage
 public PdfException(PdfError error)
     : this(GetMessage(error))
 {
     Error = error;
 }