개정판 6af42ff0
issue #0002 Search Panel 수정
Change-Id: I6b65a08862f9ec421dd81464d4e48cc14c20e0dd
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
43 | 43 |
using System.ComponentModel; |
44 | 44 |
using static KCOM.Controls.Sample; |
45 | 45 |
using System.Web; |
46 |
using System.Threading.Tasks; |
|
46 | 47 |
|
47 | 48 |
namespace KCOM.Views |
48 | 49 |
{ |
... | ... | |
483 | 484 |
} |
484 | 485 |
thumbnailPanel.Width = Convert.ToInt32(CommonLib.Common.GetConfigString("SetThumbnail", "WIDTH", "250")); |
485 | 486 |
} |
487 |
|
|
486 | 488 |
timer = new Timer(timercallback, null, 0, InitInterval * 60000); |
489 |
|
|
487 | 490 |
} |
488 | 491 |
|
489 |
|
|
492 |
private async Task DownloadOriginalFileAsync() |
|
493 |
{ |
|
494 |
try |
|
495 |
{ |
|
496 |
using (System.Net.WebClient client = new System.Net.WebClient()) |
|
497 |
{ |
|
498 |
string instnaceFile = System.IO.Path.GetTempFileName().Replace(".pdf", ".tmp"); |
|
499 |
string downloadurl = GetOriginalPDFURL(); |
|
500 |
|
|
501 |
// canceltoken을 위해서 상위에 선언 |
|
502 |
var task = client.DownloadFileTaskAsync(new Uri(downloadurl), instnaceFile); |
|
503 |
|
|
504 |
client.DownloadProgressChanged += (snd, evt) => |
|
505 |
{ |
|
506 |
ViewerDataModel.Instance.DownloadFileProgress = evt.ProgressPercentage; |
|
507 |
|
|
508 |
//System.Diagnostics.Debug.WriteLine($"Download Progress {evt.ProgressPercentage}% {evt.BytesReceived}/{evt.TotalBytesToReceive}(Byte)"); |
|
509 |
}; |
|
510 |
|
|
511 |
await task; |
|
512 |
|
|
513 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.searchPanel_Instance.SetSerachPDFFile(instnaceFile); |
|
514 |
ViewerDataModel.Instance.IsDownloadOriginal = true; |
|
515 |
ViewerDataModel.Instance.OriginalTempFile = instnaceFile; |
|
516 |
} |
|
517 |
} |
|
518 |
catch (Exception ex) |
|
519 |
{ |
|
520 |
Logger.sendResLog("DownloadOriginalFileAsync", ex.Message, 0); |
|
521 |
} |
|
522 |
} |
|
490 | 523 |
|
491 | 524 |
private void timercallback(Object o) |
492 | 525 |
{ |
내보내기 Unified diff