개정판 2007ecaa
thumbnail을 별도의 프로세스에서 download 하도록 수정
Change-Id: Ica8432a3fbe5e44d92412ec91290097deddeee71
KCOM/Controls/Sample.xaml.cs | ||
---|---|---|
1 |
using IKCOM; |
|
1 |
using IIpc; |
|
2 |
using IKCOM; |
|
2 | 3 |
using KCOM.Common; |
3 | 4 |
using KCOMDataModel.DataModel; |
4 | 5 |
using MarkupToPDF.Common; |
... | ... | |
30 | 31 |
public event PropertyChangedEventHandler PropertyChanged; |
31 | 32 |
public DelegateCommand SelectCommentCommand { get; private set; } |
32 | 33 |
|
33 |
//PageManager.PageStorage samplePageStorage; |
|
34 | 34 |
|
35 | 35 |
public Sample() |
36 | 36 |
{ |
... | ... | |
41 | 41 |
return; |
42 | 42 |
} |
43 | 43 |
|
44 |
//App.splashString(ISplashMessage.SAMPLE);
|
|
44 |
App.splashString(ISplashMessage.SAMPLE); |
|
45 | 45 |
this.Loaded += Sample_Loaded; |
46 | 46 |
this.Unloaded += Sample_Unloaded; |
47 | 47 |
} |
... | ... | |
154 | 154 |
|
155 | 155 |
public async Task SetPageNaviAsync(List<DOCPAGE> PageList, string DefaultUri) |
156 | 156 |
{ |
157 |
App.splashString(ISplashMessage.SAMPLE); |
|
157 | 158 |
//rdoAllPages.Checked += new RoutedEventHandler(rdoCommented_Checked); |
158 | 159 |
//rdoFavoritePages.Checked += new RoutedEventHandler(rdoFavoritePages_Checked); |
159 | 160 |
|
... | ... | |
162 | 163 |
|
163 | 164 |
string tempStoragePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "MARKUS", System.IO.Path.GetRandomFileName()); |
164 | 165 |
|
165 |
//samplePageStorage = new PageManager.PageStorage(_DefaultUri, tempStoragePath,"jpg", _PageList.Count(), _PageList.Count()); |
|
166 |
|
|
167 |
await this.Dispatcher.InvokeAsync(()=> ThumbnailSetAsync()); |
|
168 | 166 |
|
167 |
//ThumbnailSetAsync(); |
|
168 |
await this.Dispatcher.InvokeAsync(()=> ThumbnailSetAsync()); |
|
169 |
|
|
169 | 170 |
this.PageCount = PageList.Count(); |
170 | 171 |
|
171 |
//ThumbNmailSet(); |
|
172 |
|
|
172 |
string endpoint = App.ViewInfo.DocumentItemID + "Thumbnail"; |
|
173 |
|
|
174 |
IIpc.WcfServer wcfServer = new IIpc.WcfServer(endpoint); |
|
175 |
wcfServer.IpcThumbnailReceived += WcfServer_IpcThumbnailReceived; |
|
176 |
wcfServer.Start(); |
|
177 |
|
|
178 |
DownloadProcess.ThumbnailDownloader(endpoint,ViewerDataModel.Instance.IsAdmin, this._DefaultUri, tempStoragePath, "jpg", this.PageCount); |
|
179 |
|
|
180 |
App.splashScreen.Close(); |
|
181 |
} |
|
182 |
|
|
183 |
private void WcfServer_IpcThumbnailReceived(object sender, IpcThumbnailEventArgs e) |
|
184 |
{ |
|
185 |
var items = _thumbnailItems.Where(x => x.PageNumber == e.PageNo); |
|
186 |
|
|
187 |
if (items.Count() > 0) |
|
188 |
{ |
|
189 |
//Dispatcher.BeginInvoke((Action)delegate () |
|
190 |
//{ |
|
191 |
items.First().ImageUri = new Uri(e.Path, UriKind.Absolute); |
|
192 |
//}); |
|
193 |
} |
|
173 | 194 |
} |
174 | 195 |
|
175 | 196 |
void rdoCommented_Checked(object sender, RoutedEventArgs e) |
... | ... | |
201 | 222 |
//if (rdoAllPages.IsChecked == true) expCommentPages.IsExpanded = false; |
202 | 223 |
if (IsInitialized) |
203 | 224 |
{ |
225 |
//ThumbnailSetAsync(); |
|
204 | 226 |
await this.Dispatcher.InvokeAsync(() => ThumbnailSetAsync()); |
205 | 227 |
} |
206 | 228 |
} |
... | ... | |
477 | 499 |
|
478 | 500 |
public async void SetCommentPages(object obj = null) |
479 | 501 |
{ |
502 |
//ThumbnailSetAsync(); |
|
480 | 503 |
await this.Dispatcher.InvokeAsync(() => ThumbnailSetAsync()); |
481 | 504 |
} |
482 | 505 |
|
... | ... | |
599 | 622 |
let pageLink = uri.Replace("{PageNo}", page.PAGE_NUMBER.ToString()) |
600 | 623 |
select new ThumbnailItem |
601 | 624 |
{ |
602 |
ImageUri = new Uri(pageLink), |
|
625 |
//ImageUri = new Uri(pageLink),
|
|
603 | 626 |
PageUri = new Uri(pageLink.Replace("jpg", "png")), |
604 | 627 |
PageNumber = page.PAGE_NUMBER, |
605 | 628 |
Angle = page.PAGE_ANGLE |
... | ... | |
611 | 634 |
|
612 | 635 |
FilteredThumbnail.Source = _thumbnailItems; |
613 | 636 |
|
637 |
FilteredThumbnail.View.CurrentChanging += (snd, evt) => |
|
638 |
{ |
|
639 |
System.Diagnostics.Debug.WriteLine("ect"); |
|
640 |
}; |
|
641 |
|
|
614 | 642 |
FilterPages = _thumbnailItems.Select(x=>x.PageNumber).ToList(); |
615 | 643 |
|
616 |
FilteredThumbnail.Filter += (snd,evt) => |
|
644 |
FilteredThumbnail.Filter += (snd, evt) =>
|
|
617 | 645 |
{ |
618 | 646 |
if (FilterPages?.Count() > 0 && evt.Item != null) |
619 | 647 |
{ |
... | ... | |
629 | 657 |
|
630 | 658 |
FilterPages.Clear(); |
631 | 659 |
|
632 |
|
|
633 | 660 |
if (rdoAllPages.IsChecked == true) |
634 | 661 |
{ |
635 | 662 |
FilterPages = _thumbnailItems.Select(x=>x.PageNumber).ToList(); |
... | ... | |
666 | 693 |
|
667 | 694 |
if (FilterPages.Count() > 0) |
668 | 695 |
{ |
669 |
ImgListbox.SelectedItem = _thumbnailItems.Where(x=>x.PageNumber == FilterPages.FirstOrDefault()).FirstOrDefault(); |
|
696 |
if (_thumbnailItems.Count() > 0) |
|
697 |
{ |
|
698 |
ImgListbox.SelectedItem = _thumbnailItems[0]; |
|
699 |
} |
|
700 |
|
|
670 | 701 |
//SetCommentList(UsersCommentPagesList.ToList()); |
671 | 702 |
} |
672 | 703 |
else |
내보내기 Unified diff