개정판 24c5e56c
- final pdf Font 추가
- Markus navi 속도 최적화 Key input 최적화
Change-Id: I7f2cf1933e86017d7b1df9ef4bd3048a8e80a653
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
592 | 592 |
} |
593 | 593 |
} |
594 | 594 |
|
595 |
if (this.pageNavigator.CurrentPage != null) |
|
596 |
{ |
|
597 |
/// delete markup list |
|
598 |
int iPageNo = this.pageNavigator.CurrentPage.PageNumber; |
|
595 |
//if (this.pageNavigator.CurrentPage != null)
|
|
596 |
//{
|
|
597 |
// /// delete markup list
|
|
598 |
// int iPageNo = this.pageNavigator.CurrentPage.PageNumber;
|
|
599 | 599 |
|
600 |
var deleted = (from markup in ViewerDataModel.Instance.MyMarkupList |
|
601 |
where (markup.PageNumber == iPageNo) |
|
602 |
&& (null == ViewerDataModel.Instance.MarkupControls_USER.Where(control => control.CommentID == markup.ID).FirstOrDefault()) |
|
603 |
select markup).ToList(); |
|
600 |
// var deleted = (from markup in ViewerDataModel.Instance.MyMarkupList
|
|
601 |
// where (markup.PageNumber == iPageNo)
|
|
602 |
// && (null == ViewerDataModel.Instance.MarkupControls_USER.Where(control => control.CommentID == markup.ID).FirstOrDefault())
|
|
603 |
// select markup).ToList();
|
|
604 | 604 |
|
605 |
foreach (var markup in deleted) |
|
606 |
{ |
|
607 |
ViewerDataModel.Instance.MyMarkupList.Remove(markup); |
|
608 |
} |
|
609 |
} |
|
610 |
else |
|
611 |
{ |
|
612 |
System.Diagnostics.Debug.WriteLine("UpdateMyMarkupList : this.pageNavigator.CurrentPage null "); |
|
613 |
} |
|
605 |
// foreach (var markup in deleted)
|
|
606 |
// {
|
|
607 |
// ViewerDataModel.Instance.MyMarkupList.Remove(markup);
|
|
608 |
// }
|
|
609 |
//}
|
|
610 |
//else
|
|
611 |
//{
|
|
612 |
// System.Diagnostics.Debug.WriteLine("UpdateMyMarkupList : this.pageNavigator.CurrentPage null ");
|
|
613 |
//}
|
|
614 | 614 |
|
615 | 615 |
/// up to here |
616 | 616 |
|
... | ... | |
634 | 634 |
//} |
635 | 635 |
} |
636 | 636 |
|
637 |
private DispatcherTimer renderTesttimer; |
|
638 |
|
|
639 | 637 |
/// <summary> |
640 | 638 |
/// start page changing |
641 | 639 |
/// - save controls if page is modified |
... | ... | |
645 | 643 |
/// <param name="e"></param> |
646 | 644 |
private async void pageNavigator_PageChanging(object sender, Controls.Sample.PageChangeEventArgs e) |
647 | 645 |
{ |
648 |
await Task.Delay(10); |
|
646 |
//await Task.Delay(10);
|
|
649 | 647 |
|
650 | 648 |
// 마크업 로드 |
651 | 649 |
//await this.Dispatcher.InvokeAsync(()=>MarkupLoad(e.PageNumber)); |
652 |
await MarkupLoadAsync(e.PageNumber); |
|
650 |
|
|
651 |
var token = ViewerDataModel.Instance.NewCancellationToken(); |
|
652 |
|
|
653 |
await MarkupLoadAsync(e.PageNumber,token); |
|
653 | 654 |
|
654 | 655 |
// 페이지 이미지 변경 |
655 |
await PageChangingAsync(e.CurrentPage, e.PageNumber); |
|
656 |
await PageChangingAsync(e.CurrentPage, e.PageNumber, token);
|
|
656 | 657 |
} |
657 | 658 |
|
658 |
private async Task PageChangingAsync(DOCPAGE currentPage, int changePageNumber) |
|
659 |
private async Task PageChangingAsync(DOCPAGE currentPage, int changePageNumber,CancellationToken token)
|
|
659 | 660 |
{ |
660 | 661 |
CompareMode.IsChecked = false; |
661 | 662 |
var BalancePoint = ViewerDataModel.Instance.PageBalanceMode == true ? changePageNumber + ViewerDataModel.Instance.PageBalanceNumber : changePageNumber; |
... | ... | |
684 | 685 |
|
685 | 686 |
#region 페이지 이미지 로딩 수정 |
686 | 687 |
|
687 |
ViewerDataModel.Instance.ImageViewPath = await App.PageStorage.GetPageImageAsync(changePageNumber); |
|
688 |
ViewerDataModel.Instance.ImageViewPath = await App.PageStorage.GetPageImageAsync(token,changePageNumber);
|
|
688 | 689 |
|
689 | 690 |
ScaleImage(pageWidth, pageHeight); |
690 | 691 |
|
... | ... | |
823 | 824 |
|
824 | 825 |
/// 페이지의 모든 마크업을 로드한 후 호출 |
825 | 826 |
/// 좌측 마크업 list의 아이템을 클릭하는 경우 MarkupControls_USER가 0으로 나와서 추가함. |
826 |
ViewerDataModel.Instance.LoadPageMarkup(); |
|
827 |
ViewerDataModel.Instance.LoadPageMarkupFinish();
|
|
827 | 828 |
|
828 | 829 |
//Point startPoint = new Point(15, 15); |
829 | 830 |
|
... | ... | |
1064 | 1065 |
return e.DesiredSize; |
1065 | 1066 |
} |
1066 | 1067 |
|
1067 |
private async Task MarkupLoadAsync(int pageNumber) |
|
1068 |
private async Task MarkupLoadAsync(int pageNumber, CancellationToken cts)
|
|
1068 | 1069 |
{ |
1069 | 1070 |
System.Diagnostics.Stopwatch stopwatch = new Stopwatch(); |
1070 | 1071 |
stopwatch.Start(); |
... | ... | |
1077 | 1078 |
|
1078 | 1079 |
foreach (var markup in ViewerDataModel.Instance.MyMarkupList.Where(param => param.PageNumber == pageNumber)) |
1079 | 1080 |
{ |
1081 |
if (cts.IsCancellationRequested) |
|
1082 |
{ |
|
1083 |
return; |
|
1084 |
} |
|
1085 |
|
|
1080 | 1086 |
var info = ViewerDataModel.Instance._markupInfoList.Where(param => param.MarkupInfoID == markup.MarkupInfoID).FirstOrDefault(); |
1081 | 1087 |
if (info != null) |
1082 | 1088 |
{ |
1083 | 1089 |
string sColor = (info.UserID == App.ViewInfo.UserID) ? "#FFFF0000" : info.DisplayColor; |
1084 | 1090 |
if (info.UserID == App.ViewInfo.UserID) |
1085 | 1091 |
{ |
1086 |
var control = await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, sColor, "", |
|
1092 |
var control = await MarkupParser.ParseExAsync(cts, App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, sColor, "",
|
|
1087 | 1093 |
markup.MarkupInfoID, markup.ID); |
1088 | 1094 |
control.Visibility = Visibility.Hidden; |
1089 | 1095 |
} |
1090 | 1096 |
else |
1091 | 1097 |
{ |
1092 |
var control = await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, sColor, "", |
|
1098 |
var control = await MarkupParser.ParseExAsync(cts, App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, sColor, "",
|
|
1093 | 1099 |
markup.MarkupInfoID, markup.ID); |
1094 | 1100 |
control.Visibility = Visibility.Hidden; |
1095 | 1101 |
} |
1096 | 1102 |
} |
1103 |
|
|
1097 | 1104 |
}; |
1098 | 1105 |
/// up to here |
1099 | 1106 |
|
... | ... | |
1119 | 1126 |
|
1120 | 1127 |
foreach (var markupitem in markupitems) |
1121 | 1128 |
{ |
1122 |
await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID); |
|
1129 |
await MarkupParser.ParseExAsync(ViewerDataModel.Instance.CancellationToken(), App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID); |
|
1130 |
|
|
1131 |
if (cts.IsCancellationRequested) |
|
1132 |
{ |
|
1133 |
return; |
|
1134 |
} |
|
1123 | 1135 |
} |
1124 | 1136 |
} |
1125 | 1137 |
} |
1126 | 1138 |
|
1127 |
SetCommentPages(); |
|
1139 |
SetCommentPages(cts);
|
|
1128 | 1140 |
} |
1129 | 1141 |
|
1130 |
public void SetCommentPages() |
|
1142 |
public void SetCommentPages(CancellationToken? cts)
|
|
1131 | 1143 |
{ |
1132 | 1144 |
Logger.sendCheckLog("pageNavigator_PageChanging_SetCommentPages Setting", 1); |
1133 | 1145 |
List<UsersCommentPagesMember> _pages = new List<UsersCommentPagesMember>(); |
... | ... | |
1153 | 1165 |
} |
1154 | 1166 |
_pages.Add(instance); |
1155 | 1167 |
} |
1168 |
|
|
1169 |
if (cts != null) |
|
1170 |
{ |
|
1171 |
if (cts.Value.IsCancellationRequested) |
|
1172 |
return; |
|
1173 |
} |
|
1156 | 1174 |
} |
1157 | 1175 |
|
1158 |
this.pageNavigator.SetCommentList(_pages.ToList()); |
|
1176 |
this.pageNavigator.SetCommentList(_pages.ToList(),cts);
|
|
1159 | 1177 |
} |
1160 | 1178 |
|
1161 | 1179 |
public void MarkupitemViewUpdate(string markupinfo_id) |
... | ... | |
2870 | 2888 |
} |
2871 | 2889 |
else if ((control as ArrowTextControl) != null) |
2872 | 2890 |
{ |
2891 |
ViewerDataModel.Instance.SystemMain.dzTopMenu.SetFont((control as ArrowTextControl).TextFamily); |
|
2892 |
|
|
2873 | 2893 |
if (!((control as ArrowTextControl).EnableEditing)) |
2874 | 2894 |
{ |
2875 | 2895 |
(control as ArrowTextControl).EnableEditing = true; |
... | ... | |
3511 | 3531 |
if (currentControl != null) |
3512 | 3532 |
{ |
3513 | 3533 |
(currentControl as ArrowArcControl).setClock(); |
3514 |
(currentControl as ArrowArcControl).MidPoint = new Point(0, 0); |
|
3534 |
(currentControl as ArrowArcControl).MiddlePoint = new Point(0, 0);
|
|
3515 | 3535 |
//(currentControl as ArcControl).ApplyTemplate(); |
3516 | 3536 |
} |
3517 | 3537 |
} |
... | ... | |
4786 | 4806 |
var markupitems = item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageNumber).ToList(); |
4787 | 4807 |
foreach (var markupitem in markupitems) |
4788 | 4808 |
{ |
4789 |
await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID); |
|
4809 |
await MarkupParser.ParseExAsync(ViewerDataModel.Instance.CancellationToken(), App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID);
|
|
4790 | 4810 |
} |
4791 | 4811 |
} |
4792 | 4812 |
|
... | ... | |
5407 | 5427 |
_canvas.Background = Brushes.White; |
5408 | 5428 |
_canvas.Width = adorner_.BorderSize.Width; |
5409 | 5429 |
_canvas.Height = adorner_.BorderSize.Height; |
5410 |
await MarkupParser.ParseAsync(App.ViewInfo.ProjectNO, data, _canvas, "#FFFF0000", ""); |
|
5430 |
await MarkupParser.ParseAsync(App.ViewInfo.ProjectNO, data, _canvas, "#FFFF0000", "", ViewerDataModel.Instance.CancellationToken());
|
|
5411 | 5431 |
|
5412 | 5432 |
BitmapEncoder encoder = new PngBitmapEncoder(); |
5413 | 5433 |
|
... | ... | |
5698 | 5718 |
{ |
5699 | 5719 |
if (item.PageNumber == pageNavigator.CurrentPage.PageNumber) |
5700 | 5720 |
{ |
5701 |
await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, item.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", |
|
5721 |
await MarkupParser.ParseExAsync(ViewerDataModel.Instance.CancellationToken(), App.ViewInfo.ProjectNO, item.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "",
|
|
5702 | 5722 |
items.MarkupInfoID, Commons.shortGuid()); |
5703 | 5723 |
} |
5704 | 5724 |
} |
내보내기 Unified diff