Exemplo n.º 1
0
        private void GetHttpImage()
        {
            Action action = null;
            _003C_003Ec__DisplayClass5 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass5();

            _003C_003Ec__DisplayClass._003C_003E4__this = this;
            _003C_003Ec__DisplayClass.imgUrl            = signinDataUser.SignedPic.Trim();
            if (!_003C_003Ec__DisplayClass.imgUrl.Equals(""))
            {
                txtUserName.FontWeight = FontWeights.Bold;
                if (sb != null)
                {
                    sb.Begin();
                }
                TaskFactory factory = Task.Factory;
                if (action == null)
                {
                    action = new Action(_003C_003Ec__DisplayClass._003CGetHttpImage_003Eb__2);
                }
                factory.StartNew(action);
            }
            else
            {
                txtUnSigned.Visibility = Visibility.Visible;
            }
        }
        public static void SavePDF(bool isHtml, string bookPath, int totalPage, float width, float height, string UserAccount, string bookId, string dbPath, string thumbsPath_Msize, string thumbsPath_Lsize, int counter = 0)
        {
            _003C_003Ec__DisplayClass5 _003C_003Ec__DisplayClass = new _003C_003Ec__DisplayClass5();

            _003C_003Ec__DisplayClass.isHtml           = isHtml;
            _003C_003Ec__DisplayClass.bookPath         = bookPath;
            _003C_003Ec__DisplayClass.totalPage        = totalPage;
            _003C_003Ec__DisplayClass.width            = width;
            _003C_003Ec__DisplayClass.height           = height;
            _003C_003Ec__DisplayClass.UserAccount      = UserAccount;
            _003C_003Ec__DisplayClass.bookId           = bookId;
            _003C_003Ec__DisplayClass.dbPath           = dbPath;
            _003C_003Ec__DisplayClass.thumbsPath_Msize = thumbsPath_Msize;
            _003C_003Ec__DisplayClass.thumbsPath_Lsize = thumbsPath_Lsize;
            _003C_003Ec__DisplayClass.counter          = counter;
            if (_003C_003Ec__DisplayClass.counter == 0)
            {
                PDFFactoryParameter pDFFactoryParameter = new PDFFactoryParameter();
                pDFFactoryParameter.isHtml           = _003C_003Ec__DisplayClass.isHtml;
                pDFFactoryParameter.bookPath         = _003C_003Ec__DisplayClass.bookPath;
                pDFFactoryParameter.totalPage        = _003C_003Ec__DisplayClass.totalPage;
                pDFFactoryParameter.width            = _003C_003Ec__DisplayClass.width;
                pDFFactoryParameter.height           = _003C_003Ec__DisplayClass.height;
                pDFFactoryParameter.UserAccount      = _003C_003Ec__DisplayClass.UserAccount;
                pDFFactoryParameter.bookId           = _003C_003Ec__DisplayClass.bookId;
                pDFFactoryParameter.dbPath           = _003C_003Ec__DisplayClass.dbPath;
                pDFFactoryParameter.thumbsPath_Msize = _003C_003Ec__DisplayClass.thumbsPath_Msize;
                pDFFactoryParameter.thumbsPath_Lsize = _003C_003Ec__DisplayClass.thumbsPath_Lsize;
                DataTable dataTable = MSCE.GetDataTable("select ID from FileRow where userid=@1 and id=@2", _003C_003Ec__DisplayClass.UserAccount.Replace("_Sync", ""), _003C_003Ec__DisplayClass.bookId);
                if (dataTable.Rows.Count > 0)
                {
                    dataTable.Rows[0]["ID"].ToString();
                    string text = "update  FileRow set PDFFactoryParameterJson=@1 where userid=@2 and id=@3";
                    int    num  = MSCE.ExecuteNonQuery(text, JsonConvert.SerializeObject(pDFFactoryParameter), _003C_003Ec__DisplayClass.UserAccount.Replace("_Sync", ""), _003C_003Ec__DisplayClass.bookId);
                    if (num < 1)
                    {
                        LogTool.Debug(new Exception("DB失敗: " + text));
                    }
                }
            }
            _003C_003Ec__DisplayClass.fileName = Path.Combine(_003C_003Ec__DisplayClass.bookPath, "PDFFactory\\PDF.pdf");
            _003C_003Ec__DisplayClass.PDFFactoryDirectoryName = Path.GetDirectoryName(_003C_003Ec__DisplayClass.fileName);
            _003C_003Ec__DisplayClass.FinalFilePath           = Path.Combine(_003C_003Ec__DisplayClass.bookPath, "PDF.pdf");
            Directory.CreateDirectory(_003C_003Ec__DisplayClass.PDFFactoryDirectoryName);
            Task.Factory.StartNew(new Action(_003C_003Ec__DisplayClass._003CSavePDF_003Eb__3));
        }