프로젝트

일반

사용자정보

개정판 3ffd4b2d

ID3ffd4b2daabb4028e4515a88bc8df0686548a1a4
상위 a2464ff0
하위 129ca191

백흠경이(가) 5년 이상 전에 추가함

issue #923: fixed page change logic

Change-Id: I903f39391fca4a6ae241ba86b131f2aeed7c14a8

차이점 보기:

KCOM/Services/BaseServices.cs
272 272
            if (e.Result != null)
273 273
            {
274 274
                ViewerDataModel.Instance._markupInfoList.Clear();
275
                if (e.Result.Count > 0)
276
                {
277
                    ViewerDataModel.Instance.MyMarkupList.Clear();
278
                }
275
                if (e.Result.Count > 0) ViewerDataModel.Instance.MyMarkupList.Clear();
279 276

  
280 277
                foreach(var info in e.Result)
281 278
                {
......
310 307
                            //Group_ID = p.Group_ID
311 308
                        };
312 309
                        ViewerDataModel.Instance.MyMarkupList.Add(markup);
313

  
314
			            var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, d.DisplayColor, "",
315
                                        d.MarkupInfoID, markup.ID);
316
                        control.Visibility = Visibility.Hidden;
317 310
                    }
318 311
                    else
319 312
                    {
......
329 322
                            //Group_ID = p.Group_ID
330 323
                        };
331 324
                        ViewerDataModel.Instance.MarkupList_Pre.Add(markup);
332

  
333
			            var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, d.DisplayColor, "",
334
                                        d.MarkupInfoID, markup.ID);
335
                        control.Visibility = Visibility.Hidden;
336 325
                    }
337 326
                }));
338 327

  
......
374 363
                    if (info.UserID == App.ViewInfo.UserID) info.DisplayColor = "#FFFF0000";
375 364
                }
376 365

  
366
                ViewerDataModel.Instance.PageNumber = 1;
367

  
377 368
                /// Consolidation 된 데이터가 최상단에 올 수 있도록 변경
378 369
                var markupItem = ViewerDataModel.Instance._markupInfoList.OrderByDescending(p => p.Consolidate == Convert.ToInt32(true)).ToList();
379 370
                markupItem.ForEach(data =>
......
489 480
                {
490 481
                    foreach (var item in gridSelectionItem)
491 482
                    {
492
                        if ((item.UserID == App.ViewInfo.UserID) && (this.pageNavigator.CurrentPage != null))
483
                        if (item.UserID == App.ViewInfo.UserID)
493 484
                        {
494 485
                            var controls = Common.ViewerDataModel.Instance.MarkupControls_USER.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList();
495 486
                            if (controls.Count == 0)
496 487
                            {
497
                                var instance = ViewerDataModel.Instance.MyMarkupList.Where(d => d.PageNumber == pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList();
488
                                var instance = ViewerDataModel.Instance.MyMarkupList.Where(d => d.PageNumber == ViewerDataModel.Instance.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList();
498 489
                                foreach (var markup in instance)
499 490
                                {
500 491
                                    MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", 
......
509 500
                                control.Visibility = Visibility.Visible;
510 501
                            }
511 502
                        }
512
                        else if (this.pageNavigator.CurrentPage != null)
503
                        else
513 504
                        {
514 505
                            var controls = Common.ViewerDataModel.Instance.MarkupControls.Where(d => d.MarkupInfoID == item.MarkupInfoID).ToList();
515 506
                            if (controls.Count == 0)
516 507
                            {
517
                                var instance = ViewerDataModel.Instance.MarkupList_Pre.Where(d => d.PageNumber == pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList();
508
                                var instance = ViewerDataModel.Instance.MarkupList_Pre.Where(d => d.PageNumber == ViewerDataModel.Instance.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList();
518 509
                                foreach (var markup in instance)
519 510
                                {
520 511
                                    MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "",
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

클립보드 이미지 추가 (최대 크기: 500 MB)