개정판 3ffd4b2d
issue #923: fixed page change logic
Change-Id: I903f39391fca4a6ae241ba86b131f2aeed7c14a8
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
477 | 477 |
foreach(var markup in deleted) ViewerDataModel.Instance.MyMarkupList.Remove(markup); |
478 | 478 |
/// up to here |
479 | 479 |
|
480 |
if (PreviewUserMarkupInfoItem != null && isComingNewBie && !ComingNewBieEnd)
|
|
480 |
if (isComingNewBie && !ComingNewBieEnd) |
|
481 | 481 |
{ |
482 | 482 |
if (ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == PreviewUserMarkupInfoItem.UserID).FirstOrDefault() == null) |
483 | 483 |
{ |
... | ... | |
499 | 499 |
|
500 | 500 |
bool ComingNewBieEnd = false; |
501 | 501 |
|
502 |
private void PageNavigator_PageChanged(object sender, Sample.PageChangeEventArgs e) |
|
503 |
{ |
|
504 |
if (zoomAndPanCanvas2.Width.IsNaN()) |
|
505 |
{ |
|
506 |
zoomAndPanControl.ZoomTo(new Rect { X = 0, Y = 0, Width = zoomAndPanCanvas.Width, Height = zoomAndPanCanvas.Height }); |
|
507 |
} |
|
508 |
|
|
509 |
Common.ViewerDataModel.Instance.MarkupControls_USER.Clear(); //전체 제거 |
|
510 |
Common.ViewerDataModel.Instance.MarkupControls.Clear(); //전체 제거 |
|
511 |
|
|
512 |
List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
|
513 |
foreach (var info in gridSelectionItem) |
|
514 |
{ |
|
515 |
Logger.sendCheckLog(String.Format("==>{0}", info), 1); |
|
516 |
} |
|
517 |
/// fire selection event |
|
518 |
this.gridViewMarkup.UnselectAll(); |
|
519 |
this.gridViewMarkup.Select(gridSelectionItem); |
|
520 |
|
|
521 |
if (!testPanel2.IsHidden) |
|
522 |
{ |
|
523 |
ViewerDataModel.Instance.Sync_ContentOffsetX = zoomAndPanControl.ContentOffsetX; |
|
524 |
ViewerDataModel.Instance.Sync_ContentOffsetY = zoomAndPanControl.ContentOffsetY; |
|
525 |
ViewerDataModel.Instance.Sync_ContentScale = zoomAndPanControl.ContentScale; |
|
526 |
|
|
527 |
Common.ViewerDataModel.Instance.MarkupControls_Sync.Clear(); |
|
528 |
List<MarkupInfoItem> gridSelectionRevItem = gridViewRevMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); |
|
529 |
|
|
530 |
|
|
531 |
foreach (var item in gridSelectionRevItem) |
|
532 |
{ |
|
533 |
item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageNumber).ToList().ForEach(delegate (MarkupItem markupitem) |
|
534 |
{ |
|
535 |
MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID); |
|
536 |
}); |
|
537 |
} |
|
538 |
} |
|
539 |
|
|
540 |
var instanceMain = this.ParentOfType<MainWindow>(); |
|
541 |
instanceMain.dzTopMenu.tlcurrentPage.Text = e.CurrentPage.PAGE_NUMBER.ToString(); |
|
542 |
instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = e.CurrentPage.PAGE_NUMBER.ToString(); |
|
543 |
|
|
544 |
instanceMain.dzTopMenu.rotateOffSet = 0; |
|
545 |
var pageinfo = this.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == e.CurrentPage.PAGE_NUMBER).FirstOrDefault(); |
|
546 |
drawingPannelRotate(pageinfo.PAGE_ANGLE); |
|
547 |
|
|
548 |
SetCommentPages(true); |
|
549 |
} |
|
550 |
|
|
551 | 502 |
/// <summary> |
552 | 503 |
/// start page changing |
553 | 504 |
/// - save controls if page is modified |
... | ... | |
728 | 679 |
|
729 | 680 |
} |
730 | 681 |
|
682 |
/// <summary> |
|
683 |
/// called after page is changed |
|
684 |
/// </summary> |
|
685 |
/// <param name="sender"></param> |
|
686 |
/// <param name="e"></param> |
|
687 |
private void PageNavigator_PageChanged(object sender, Sample.PageChangeEventArgs e) |
|
688 |
{ |
|
689 |
if (zoomAndPanCanvas2.Width.IsNaN()) |
|
690 |
{ |
|
691 |
zoomAndPanControl.ZoomTo(new Rect { X = 0, Y = 0, Width = zoomAndPanCanvas.Width, Height = zoomAndPanCanvas.Height }); |
|
692 |
} |
|
693 |
|
|
694 |
/// 컨트롤을 새로 생성한다. |
|
695 |
Common.ViewerDataModel.Instance.MarkupControls_USER.Clear(); //전체 제거 |
|
696 |
Common.ViewerDataModel.Instance.MarkupControls.Clear(); //전체 제거 |
|
697 |
foreach (var markup in ViewerDataModel.Instance.MyMarkupList.Where(param => param.PageNumber == ViewerDataModel.Instance.PageNumber)) |
|
698 |
{ |
|
699 |
var info = ViewerDataModel.Instance._markupInfoList.Where(param => param.MarkupInfoID == markup.MarkupInfoID).First(); |
|
700 |
if (info != null) |
|
701 |
{ |
|
702 |
string sColor = (info.UserID == App.ViewInfo.UserID) ? "#FFFF0000" : info.DisplayColor; |
|
703 |
if (info.UserID == App.ViewInfo.UserID) |
|
704 |
{ |
|
705 |
var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, sColor, "", |
|
706 |
markup.MarkupInfoID, markup.ID); |
|
707 |
control.Visibility = Visibility.Hidden; |
|
708 |
} |
|
709 |
else |
|
710 |
{ |
|
711 |
var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, sColor, "", |
|
712 |
markup.MarkupInfoID, markup.ID); |
|
713 |
control.Visibility = Visibility.Hidden; |
|
714 |
} |
|
715 |
} |
|
716 |
}; |
|
717 |
/// up to here |
|
718 |
|
|
719 |
/// fire selection event |
|
720 |
List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업 |
|
721 |
this.gridViewMarkup.UnselectAll(); |
|
722 |
this.gridViewMarkup.Select(gridSelectionItem); |
|
723 |
|
|
724 |
if (!testPanel2.IsHidden) |
|
725 |
{ |
|
726 |
ViewerDataModel.Instance.Sync_ContentOffsetX = zoomAndPanControl.ContentOffsetX; |
|
727 |
ViewerDataModel.Instance.Sync_ContentOffsetY = zoomAndPanControl.ContentOffsetY; |
|
728 |
ViewerDataModel.Instance.Sync_ContentScale = zoomAndPanControl.ContentScale; |
|
729 |
|
|
730 |
Common.ViewerDataModel.Instance.MarkupControls_Sync.Clear(); |
|
731 |
List<MarkupInfoItem> gridSelectionRevItem = gridViewRevMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); |
|
732 |
|
|
733 |
|
|
734 |
foreach (var item in gridSelectionRevItem) |
|
735 |
{ |
|
736 |
item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageNumber).ToList().ForEach(delegate (MarkupItem markupitem) |
|
737 |
{ |
|
738 |
MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID); |
|
739 |
}); |
|
740 |
} |
|
741 |
} |
|
742 |
|
|
743 |
var instanceMain = this.ParentOfType<MainWindow>(); |
|
744 |
instanceMain.dzTopMenu.tlcurrentPage.Text = e.CurrentPage.PAGE_NUMBER.ToString(); |
|
745 |
instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = e.CurrentPage.PAGE_NUMBER.ToString(); |
|
746 |
|
|
747 |
instanceMain.dzTopMenu.rotateOffSet = 0; |
|
748 |
var pageinfo = this.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == e.CurrentPage.PAGE_NUMBER).FirstOrDefault(); |
|
749 |
drawingPannelRotate(pageinfo.PAGE_ANGLE); |
|
750 |
|
|
751 |
SetCommentPages(true); |
|
752 |
} |
|
753 |
|
|
731 | 754 |
private void SetCommentPages(bool onlyMe = false) |
732 | 755 |
{ |
733 | 756 |
Logger.sendCheckLog("pageNavigator_PageChanging_SetCommentPages Setting", 1); |
내보내기 Unified diff