개정판 2007ecaa
thumbnail을 별도의 프로세스에서 download 하도록 수정
Change-Id: Ica8432a3fbe5e44d92412ec91290097deddeee71
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
480 | 480 |
|
481 | 481 |
if (App.ParameterMode) |
482 | 482 |
{ |
483 |
|
|
483 | 484 |
App.splashString(ISplashMessage.MAINMENU_1); |
484 | 485 |
this.pageNavigator.ThumbInitialized += pageNavigator_ThumbInitialized; |
485 | 486 |
this.pageNavigator.PageChanging += pageNavigator_PageChanging; |
486 | 487 |
this.pageNavigator.PageChanged += PageNavigator_PageChanged; |
488 |
|
|
487 | 489 |
imageViewer_Compare = new Image(); |
488 | 490 |
ViewerDataModel.Instance.Capture_Opacity = 0; |
489 | 491 |
da.From = 0.8; |
... | ... | |
501 | 503 |
thumbnailPanel.Width = Convert.ToInt32(CommonLib.Common.GetConfigString("SetThumbnail", "WIDTH", "250")); |
502 | 504 |
} |
503 | 505 |
|
504 |
timer = new Timer(timercallback, null, 0, InitInterval * 60000); |
|
506 |
//timer = new Timer(timercallback, null, 0, InitInterval * 60000);
|
|
505 | 507 |
} |
506 | 508 |
|
507 |
private async Task DownloadOriginalFileAsync()
|
|
509 |
private void DownloadOriginalFile()
|
|
508 | 510 |
{ |
509 |
try |
|
510 |
{ |
|
511 |
using (System.Net.WebClient client = new System.Net.WebClient()) |
|
512 |
{ |
|
513 |
string instnaceFile = System.IO.Path.GetTempFileName().Replace(".pdf", ".tmp"); |
|
514 |
string downloadurl = GetOriginalPDFURL(); |
|
515 |
|
|
516 |
// canceltoken을 위해서 상위에 선언 |
|
517 |
var task = client.DownloadFileTaskAsync(new Uri(downloadurl), instnaceFile); |
|
518 |
|
|
519 |
client.DownloadProgressChanged += (snd, evt) => |
|
520 |
{ |
|
521 |
ViewerDataModel.Instance.DownloadFileProgress = evt.ProgressPercentage; |
|
511 |
#region 임시파일 다운로드 |
|
512 |
instnaceFile = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "MARKUS", System.IO.Path.GetRandomFileName().Replace(".pdf", ".tmp")); |
|
513 |
downloadurl = GetOriginalPDFURL(); |
|
514 |
|
|
515 |
string endpoint = App.ViewInfo.DocumentItemID + "file"; |
|
516 |
IIpc.WcfServer wcfServer = new IIpc.WcfServer(endpoint); |
|
517 |
wcfServer.IpcFileDownloadReceived += WcfServer_IpcFileDownloadReceived; |
|
518 |
wcfServer.Start(); |
|
519 |
|
|
520 |
DownloadProcess.FileDownloader(endpoint, ViewerDataModel.Instance.IsAdmin, downloadurl, instnaceFile); |
|
521 |
#endregion |
|
522 |
} |
|
522 | 523 |
|
523 |
//System.Diagnostics.Debug.WriteLine($"Download Progress {evt.ProgressPercentage}% {evt.BytesReceived}/{evt.TotalBytesToReceive}(Byte)");
|
|
524 |
};
|
|
524 |
string instnaceFile;
|
|
525 |
string downloadurl;
|
|
525 | 526 |
|
526 |
await task; |
|
527 |
private void WcfServer_IpcFileDownloadReceived(object sender, IIpc.IpcDownloadStatusArgs e) |
|
528 |
{ |
|
529 |
Dispatcher.BeginInvoke((Action)delegate () { ViewerDataModel.Instance.DownloadFileProgress = (int)e.Progress; }); |
|
527 | 530 |
|
528 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.searchPanel_Instance.SetSerachPDFFile(instnaceFile); |
|
529 |
ViewerDataModel.Instance.IsDownloadOriginal = true; |
|
530 |
ViewerDataModel.Instance.OriginalTempFile = instnaceFile; |
|
531 |
} |
|
532 |
} |
|
533 |
catch (Exception ex) |
|
531 |
if (e.IsFinish) |
|
534 | 532 |
{ |
535 |
Logger.sendResLog("DownloadOriginalFileAsync", ex.Message, 0); |
|
533 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.searchPanel_Instance.SetSerachPDFFile(instnaceFile); |
|
534 |
ViewerDataModel.Instance.IsDownloadOriginal = true; |
|
535 |
ViewerDataModel.Instance.OriginalTempFile = instnaceFile; |
|
536 | 536 |
} |
537 | 537 |
} |
538 | 538 |
|
... | ... | |
5448 | 5448 |
{ |
5449 | 5449 |
renderBitmap.Render(dv); |
5450 | 5450 |
|
5451 |
//GC.Collect();
|
|
5451 |
GC.Collect(2);
|
|
5452 | 5452 |
GC.WaitForPendingFinalizers(); |
5453 | 5453 |
//GC.Collect(); |
5454 | 5454 |
// encode png data |
내보내기 Unified diff