프로젝트

일반

사용자정보

개정판 afaa7c92

IDafaa7c9296dcb3cdd2fedbadbb8c8190b2dec51a
상위 b0d55ac4
하위 0469e334, 8f6d4327

김동진이(가) 5년 이상 전에 추가함

issue #1038: mainmenu 에 page changed 와 changing 을 구분하여 각 컨트롤을 업데이트 하도록 수정.썸네일 프로퍼티 수정.

Change-Id: I663a283feeff15f2513605ff2da89763da345540

차이점 보기:

KCOM/Controls/Sample.xaml
471 471

  
472 472
                    <telerik:RadListBox x:Name="ImgListbox"
473 473
                                        ItemTemplate="{StaticResource ThumbnailDataTemplate}" 
474
                                        Grid.Row="1" 
475
                                        VirtualizingStackPanel.IsVirtualizing="True" 
474
                                        Grid.Row="1"                                            
476 475
                                        Background="{DynamicResource KCOMColor_AlternativeBrush}" 
477 476
                                        ItemContainerStyle="{StaticResource ItemContainerStyle}"
478 477
                                        BorderBrush="#FFC2C2C2" BorderThickness="0"  
479
                                        SelectedIndex="0"
478
                                        SelectedIndex="0"         
480 479
                                        ScrollViewer.HorizontalScrollBarVisibility="Disabled"
481
                                        ScrollViewer.VerticalScrollBarVisibility="Auto"
482
                                        ScrollViewer.CanContentScroll="False"
483
                                        ScrollViewer.IsDeferredScrollingEnabled="False"
484
                                        SelectionChanged="ImgListbox_SelectionChanged"
480
                                        ScrollViewer.VerticalScrollBarVisibility="Auto"                                        
481
                                        ScrollViewer.CanContentScroll="True"                                        
482
                                        ScrollViewer.IsDeferredScrollingEnabled="True"                                        
483
                                        VirtualizingStackPanel.IsVirtualizing="True"    
484
                                        VirtualizingStackPanel.VirtualizationMode="Recycling"
485 485
                                        telerik:StyleManager.Theme="Office2016" >
486 486
                        <telerik:RadListBox.ItemsPanel>
487 487
                            <ItemsPanelTemplate>
KCOM/Controls/Sample.xaml.cs
34 34

  
35 35
        private void Sample_Loaded(object sender, RoutedEventArgs e)
36 36
        {
37
            //측정
38
            //Stopwatch sw = new Stopwatch();
39
            //sw.Start();
40
            InitializeComponent();
41
            //System.Diagnostics.Debug.WriteLine("Sample() : " + sw.ElapsedMilliseconds.ToString() + "ms");
42

  
43
            _Initialize = true;
44
            lstSelectComment.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(lstSelectComment_SelectionChanged);
37
            if(!_Initialize)
38
            {
39
                InitializeComponent();
40
                //System.Diagnostics.Debug.WriteLine("Sample() : " + sw.ElapsedMilliseconds.ToString() + "ms");
45 41

  
42
                _Initialize = true;
43
                this.lstSelectComment.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(lstSelectComment_SelectionChanged);
44
                this.ImgListbox.SelectionChanged += new SelectionChangedEventHandler(ImgListbox_SelectionChanged);                
45
            }            
46 46
        }
47 47

  
48 48
        //private void ImgListbox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
......
151 151
        }
152 152

  
153 153
        private void ImgListbox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
154
        {
155
            Logger.sendCheckLog("ImgListbox_SelectionChanged", 1);
154
        {            
156 155
            if (ImgListbox.SelectedItem != null)
157 156
            {
158 157
                int _PageNo = -1;
......
162 161
                    _PageNo = this.CurrentPage.PageNumber;
163 162
                };
164 163

  
165
                if (_PageNo != ((ImgListbox.SelectedItem as ThumbnailItem).PageNumber))
164
                int nextpage = ((ImgListbox.SelectedItem as ThumbnailItem).PageNumber);
165
                if(_PageNo != nextpage)
166 166
                {
167
                    var _page = this._thumbnailItems.Where(item => item.PageNumber == (ImgListbox.SelectedItem as ThumbnailItem).PageNumber);
168
                    if (_page.Count() > 0)
169
                    {
170
                        ThumbnailItem _item = _page.First();
171
                        setPageChange(_item);
172
                    }
167
                    GotoPage(nextpage);
173 168
                }
169
                
174 170
            }
175 171
        }
176 172

  
......
192 188
                    {
193 189
                        ThumbnailItem _item = _page.First();
194 190
                        setPageChange(_item);
195
                        this.ImgListbox.SelectedIndex = _pageNumber - 1;
196
                        this.ImgListbox.ScrollIntoView(_pageNumber - 1);
191
                        //this.ImgListbox.SelectedIndex = _pageNumber - 1;                        
192
                        //this.ImgListbox.ScrollIntoView(_item);
197 193
                    }
198 194
                }
199 195
            }
......
210 206
            if (thumbnailItem != null)
211 207
            {
212 208
                if (PageChanging != null)
213
                {
214
                    //강인구 수정(페이지가 같을 경우 이동 안함)
215
                    if (CurrentPage != null && CurrentPage == thumbnailItem)
216
                    {
217
                        return;
218
                    }
219

  
209
                {                    
210
                    //if(CurrentPage != null && CurrentPage.PageNumber == _NextPage.PageNumber)
211
                    //{
212
                    //    return;
213
                    //}
220 214
                    this.CurrentPage = _NextPage;
221 215
                    _NextPage = thumbnailItem;
222 216
                    PageChanging(this, new PageChangeEventArgs
......
368 362

  
369 363
        public void SetNextPage()
370 364
        {
371
            Logger.sendCheckLog("pageNavigator_PageChanging_SetNextPage", 1);
372 365
            CurrentPage = _NextPage;
373 366
            PageChange(_NextPage);
374 367
        }
375 368

  
376 369
        private void PageChange(ThumbnailItem thumbitem)
377
        {
378
            Logger.sendCheckLog("pageNavigator_PageChanging_PageChange", 1);
370
        {            
379 371
            if (PageChanged != null)
380 372
            {
381 373
                var uri = _DefaultUri.Replace("{PageNo}", thumbitem.PageNumber.ToString());
......
389 381
                else
390 382
                    ImgListbox.ScrollIntoView(_thumbnailItems.Count() - 1);
391 383

  
392
                //txtCurentPageNo.Text = (_itemIndex + 1).ToString();
393

  
394
                //txtCurentPageNo.Text = this.CurrentPage.PageNumber.ToString();
395

  
396 384
                var _DocPages = _PageList.Where(p => p.PAGE_NUMBER == thumbitem.PageNumber);
397 385

  
398 386
                if (_DocPages.Count() > 0)
KCOM/Views/MainMenu.xaml.cs
386 386
            if (App.ParameterMode)
387 387
            {
388 388
                this.pageNavigator.PageChanging += pageNavigator_PageChanging;
389
                this.pageNavigator.PageChanged += PageNavigator_PageChanged;
389 390
                imageViewer_Compare = new Image();
390 391
                ViewerDataModel.Instance.Capture_Opacity = 0;
391 392
                da.From = 0.8;
......
404 405
            timer = new Timer(timercallback, null, 0, InitInterval * 60000);
405 406
        }
406 407

  
408
        
409

  
407 410
        private void timercallback(Object o)
408 411
        {
409 412
            Stopwatch sw = new Stopwatch();
......
494 497

  
495 498
        bool ComingNewBieEnd = false;
496 499

  
500
        private void PageNavigator_PageChanged(object sender, Sample.PageChangeEventArgs e)
501
        {
502
            if (zoomAndPanCanvas2.Width.IsNaN())
503
            {
504
                zoomAndPanControl.ZoomTo(new Rect { X = 0, Y = 0, Width = zoomAndPanCanvas.Width, Height = zoomAndPanCanvas.Height });
505
            }
506

  
507
            Common.ViewerDataModel.Instance.MarkupControls_USER.Clear();    //전체 제거
508
            Common.ViewerDataModel.Instance.MarkupControls.Clear();         //전체 제거
509

  
510
            List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
511
            foreach (var info in gridSelectionItem)
512
            {
513
                Logger.sendCheckLog(String.Format("==>{0}", info), 1);
514
            }
515
            /// fire selection event
516
            this.gridViewMarkup.UnselectAll();
517
            this.gridViewMarkup.Select(gridSelectionItem);
518

  
519
            if (!testPanel2.IsHidden)
520
            {
521
                ViewerDataModel.Instance.Sync_ContentOffsetX = zoomAndPanControl.ContentOffsetX;
522
                ViewerDataModel.Instance.Sync_ContentOffsetY = zoomAndPanControl.ContentOffsetY;
523
                ViewerDataModel.Instance.Sync_ContentScale = zoomAndPanControl.ContentScale;
524

  
525
                Common.ViewerDataModel.Instance.MarkupControls_Sync.Clear();
526
                List<MarkupInfoItem> gridSelectionRevItem = gridViewRevMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList();
527

  
528

  
529
                foreach (var item in gridSelectionRevItem)
530
                {
531
                    item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageNumber).ToList().ForEach(delegate (MarkupItem markupitem)
532
                    {
533
                        MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID);
534
                    });
535
                }
536
            }
537

  
538
            var instanceMain = this.ParentOfType<MainWindow>();
539
            instanceMain.dzTopMenu.tlcurrentPage.Text = e.CurrentPage.PAGE_NUMBER.ToString();
540
            instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = e.CurrentPage.PAGE_NUMBER.ToString();
541

  
542
            instanceMain.dzTopMenu.rotateOffSet = 0;
543
            var pageinfo = this.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == e.CurrentPage.PAGE_NUMBER).FirstOrDefault();
544
            drawingPannelRotate(pageinfo.PAGE_ANGLE);
545

  
546
            //}
547
            SetCommentPages(true);
548
        }
497 549
        private void pageNavigator_PageChanging(object sender, Controls.Sample.PageChangeEventArgs e)
498 550
        {
499 551
            Logger.sendCheckLog("pageNavigator_PageChanging_Start", 1);
......
566 618
                    ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage;
567 619
                    ViewerDataModel.Instance.ImageViewWidth = defaultBitmapImage.PixelWidth;
568 620
                    ViewerDataModel.Instance.ImageViewHeight = defaultBitmapImage.PixelHeight;
621
                    this.pageNavigator.SetNextPage();
569 622
                };
570 623
            }
571 624

  
......
671 724
                tlSyncPageNum.Text = String.Format("Current Page : {0}", BalancePoint);
672 725
            }
673 726

  
674
            this.pageNavigator.SetNextPage();
675

  
676
            if (zoomAndPanCanvas2.Width.IsNaN())
677
            {
678
                zoomAndPanControl.ZoomTo(new Rect { X = 0, Y = 0, Width = zoomAndPanCanvas.Width, Height = zoomAndPanCanvas.Height });
679
            }
680

  
681
            Logger.sendCheckLog("-- pageNavigator_PageChanging_ControlData Setting --", 1);
682
            Common.ViewerDataModel.Instance.MarkupControls_USER.Clear();    //전체 제거
683
            Common.ViewerDataModel.Instance.MarkupControls.Clear();         //전체 제거
684

  
685
            List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
686
            foreach (var info in gridSelectionItem)
687
            {
688
                Logger.sendCheckLog(String.Format("==>{0}", info), 1);
689
            }
690
            /// fire selection event
691
            this.gridViewMarkup.UnselectAll();
692
            this.gridViewMarkup.Select(gridSelectionItem);
693

  
694
            if (!testPanel2.IsHidden)
695
            {
696
                ViewerDataModel.Instance.Sync_ContentOffsetX = zoomAndPanControl.ContentOffsetX;
697
                ViewerDataModel.Instance.Sync_ContentOffsetY = zoomAndPanControl.ContentOffsetY;
698
                ViewerDataModel.Instance.Sync_ContentScale = zoomAndPanControl.ContentScale;
699

  
700
                Common.ViewerDataModel.Instance.MarkupControls_Sync.Clear();
701
                List<MarkupInfoItem> gridSelectionRevItem = gridViewRevMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList();
702

  
703

  
704
                foreach (var item in gridSelectionRevItem)
705
                {
706
                    item.MarkupList.Where(pageItem => pageItem.PageNumber == BalancePoint).ToList().ForEach(delegate (MarkupItem markupitem)
707
                    {
708
                        MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID);
709
                    });
710
                }
711
            }
712

  
713
            var instanceMain = this.ParentOfType<MainWindow>();
714
            instanceMain.dzTopMenu.tlcurrentPage.Text = e.CurrentPage.PAGE_NUMBER.ToString();
715
            instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = e.CurrentPage.PAGE_NUMBER.ToString();
716

  
717
            instanceMain.dzTopMenu.rotateOffSet = 0;
718
            var pageinfo = this.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == e.CurrentPage.PAGE_NUMBER).FirstOrDefault();
719
            drawingPannelRotate(pageinfo.PAGE_ANGLE);
720

  
721
            //}
722
            SetCommentPages(true);
723 727
        }
724 728

  
725 729

  

내보내기 Unified diff

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