프로젝트

일반

사용자정보

개정판 5912549a

ID5912549ae62022f51914c5b428d9a7ea91117296
상위 fc5ed14c
하위 d7ee2793

김태성이(가) 4달 전에 추가함

issue #0000 sync 기능 수정

Change-Id: Ie314403b4dee3d991f6a4f82fadc9a42f5b2216c

차이점 보기:

KCOM/Common/ViewerDataModel.cs
1253 1253
            }
1254 1254
        }
1255 1255

  
1256
        private double _SyncPageAngle { get; set; }
1256 1257
        
1258
        public double SyncPageAngle
1259
        {
1260
            get
1261
            {
1262
                return _SyncPageAngle;
1263
            }
1264
            set
1265
            {
1266
                if (_SyncPageAngle != value)
1267
                {
1268
                    _SyncPageAngle = value;
1269
                    OnPropertyChanged("SyncPageAngle");
1270
                }
1271
            }
1272
        }
1273

  
1257 1274
        private int _SyncPageNumber { get; set; }
1258 1275

  
1259 1276
        /// <summary>
......
1296 1313
            }
1297 1314
        }
1298 1315

  
1316
        public List<DOCPAGE> SyncPages { get; set; }
1317

  
1299 1318
        public double AngleOffsetX
1300 1319
        {
1301 1320
            get
KCOM/Events/Implementation/TopMenuEvent.cs
1609 1609
            }
1610 1610
            //double angle = (double)rotateValue.GetValue(rotateOffSet);
1611 1611
            //instanceMain.dzMainMenu.rotate.Angle = angle;
1612
            var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90));
1612
            //var rotationNum = Math.Abs((instanceMain.dzMainMenu.rotate.Angle / 90));
1613 1613

  
1614 1614
            if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth)
1615 1615
            {
......
1617 1617
                instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height;
1618 1618
                instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize;
1619 1619
            }
1620

  
1620 1621
            if (instanceMain.dzMainMenu.rotate.Angle == 0)
1621 1622
            {
1622 1623
                instanceMain.dzMainMenu.translate.X = 0;
KCOM/KCOM.csproj.user
117 117
  </PropertyGroup>
118 118
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug_DIG|x64'">
119 119
    <StartProgram>C:\Program Files\DOFTECH\MARKUS\KCOM.exe</StartProgram>
120
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjMxOTQ2MjAxMTQiLCJiUGFydG5lciI6ZmFsc2UsIkNyZWF0ZUZpbmFsUERGUGVybWlzc2lvbiI6dHJ1ZSwiTmV3Q29tbWVudFBlcm1pc3Npb24iOnRydWUsIlByb2plY3ROTyI6IjExMjMwNyIsIlVzZXJJRCI6ImRvZnRlY2gifQ==</StartArguments>
120
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjIyODcyOTQ1MTQiLCJiUGFydG5lciI6ZmFsc2UsIkNyZWF0ZUZpbmFsUERGUGVybWlzc2lvbiI6dHJ1ZSwiTmV3Q29tbWVudFBlcm1pc3Npb24iOnRydWUsIlByb2plY3ROTyI6IlRFU1QwMSIsIlVzZXJJRCI6IlRFU1QwMV81NzMifQ==</StartArguments>
121 121
  </PropertyGroup>
122 122
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug_DIG|x86'">
123 123
    <StartArguments>eyJEb2N1bWVudEl0ZW1JRCI6IjExMDAwMTAyIiwiYlBhcnRuZXIiOmZhbHNlLCJDcmVhdGVGaW5hbFBERlBlcm1pc3Npb24iOiJ0cnVlIiwiTmV3Q29tbWVudFBlcm1pc3Npb24iOiJ0cnVlIiwiUHJvamVjdE5PIjoiMDAwMDAwIiwiVXNlcklEIjoiSmFtZXMiLCJNb2RlIjowfQ==/</StartArguments>
KCOM/Views/MainMenu.xaml.cs
27 27
using System.Windows.Ink;
28 28
using System.Windows.Input;
29 29
using System.Windows.Media;
30
using System.Windows.Media.Animation;
30 31
using System.Windows.Media.Imaging;
31 32
using System.Windows.Shapes;
32 33
using System.Windows.Threading;
......
117 118
    {
118 119
        #region 프로퍼티
119 120

  
120
        private BitmapFrame tempPageImage =null;
121
        private BitmapFrame tempPageImage = null;
121 122

  
122 123
        public UndoDataGroup UndoDataGroup { get; set; }
123 124
        public CommentUserInfo previousControl { get; set; }
......
399 400
            if (item.Consolidate == 1 || item.AvoidConsolidate == 1 || item.PartConsolidate == 1)
400 401
            {
401 402
                ViewerDataModel.Instance._markupInfoList.Remove(item);
402
                if(item.PartConsolidate == 1)
403
                if (item.PartConsolidate == 1)
403 404
                {
404
                    if(ViewerDataModel.Instance._markupInfoList.Where(x => x.UserID == App.ViewInfo.UserID && x.PartConsolidate == 1).Count() > 0)
405
                    if (ViewerDataModel.Instance._markupInfoList.Where(x => x.UserID == App.ViewInfo.UserID && x.PartConsolidate == 1).Count() > 0)
405 406
                    {
406 407
                        foreach (var comment in ViewerDataModel.Instance._markupInfoList.Where(x => x.UserID == App.ViewInfo.UserID && x.PartConsolidate == 1))
407 408
                        {
......
412 413
                    {
413 414
                        foreach (var comment in ViewerDataModel.Instance._markupInfoList.Where(x => x.UserID == App.ViewInfo.UserID))
414 415
                        {
415
                            comment.userDelete = true;                            
416
                            comment.userDelete = true;
416 417
                        }
417 418
                    }
418 419
                }
......
532 533

  
533 534
            if (App.ParameterMode)
534 535
            {
535
                
536

  
536 537
                App.splashString(ISplashMessage.MAINMENU_1);
537 538
                this.pageNavigator.ThumbInitialized += pageNavigator_ThumbInitialized;
538 539
                this.pageNavigator.PageChanging += pageNavigator_PageChanging;
......
545 546
                da.Duration = new Duration(TimeSpan.FromSeconds(1));
546 547
                da.AutoReverse = true;
547 548
                da.RepeatBehavior = System.Windows.Media.Animation.RepeatBehavior.Forever;
548
               
549

  
549 550
                if (!App.ViewInfo.CreateFinalPDFPermission && !App.ViewInfo.NewCommentPermission)
550 551
                {
551 552
                    this.SymbolPane.Visibility = Visibility.Collapsed;
......
567 568
        {
568 569
            #region 임시파일 다운로드
569 570
            instnaceFile = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "MARKUS", System.IO.Path.GetRandomFileName().Split('.')[0] + ".pdf");
570
       
571

  
571 572
            var directUri = CommonLib.Common.GetConfigString("DocumentDownloadPath", "url", "");
572 573

  
573 574
            bool isRestDownload = Convert.ToBoolean(CommonLib.Common.GetConfigString("DocumentDownloadPath", "IsRest", "False"));
......
586 587

  
587 588
                    downloadurl = string.Format(directUri, filename);
588 589
                }
589
             }
590
            }
590 591
            else
591 592
            {
592 593
                downloadurl = GetOriginalPDFURL();
593 594
            }
594 595

  
595 596
            ViewerDataModel.Instance.OriginalTempFile = instnaceFile;
596
            
597

  
597 598
            string endpoint = Common.Commons.ShortGuid() + "file";
598 599
            IIpc.WcfServer wcfServer = new IIpc.WcfServer(endpoint);
599 600
            wcfServer.IpcFileDownloadReceived += WcfServer_IpcFileDownloadReceived;
600 601
            wcfServer.Start();
601
            
602

  
602 603
            DownloadProcess.FileDownloader(endpoint, ViewerDataModel.Instance.IsAdmin, downloadurl, instnaceFile, isRestDownload);
603 604
            #endregion
604 605
        }
......
656 657

  
657 658
                var exist = ViewerDataModel.Instance.MyMarkupList.Find(data => data.ID == markup.CommentID);
658 659
                #region 기존 코멘트
659
                if (exist != null) 
660
                if (exist != null)
660 661
                {
661 662
                    if (exist.Data != markup.ConvertData) //코멘트가 같은지
662 663
                    {
......
713 714
            Common.ViewerDataModel.Instance.MarkupControls.Clear();         //전체 제거
714 715

  
715 716
            await PageChangingAsync(page, PageNo, ViewerDataModel.Instance.NewPagImageCancelToken());
716
            
717

  
717 718
            await MarkupLoadAsync(PageNo, ViewerDataModel.Instance.PageAngle, ViewerDataModel.Instance.NewMarkupCancelToken());
718 719

  
719 720
            //var pagechangeTask = PageChangingAsync(page, page.PAGE_NUMBER, ViewerDataModel.Instance.NewPagImageCancelToken());
......
723 724
            //await Task.WhenAll(pagechangeTask, markupLoadTask);
724 725
        }
725 726

  
726
        private async Task PageChangingAsync(DOCPAGE currentPage, int changePageNumber,CancellationToken token)
727
        private async Task PageChangingAsync(DOCPAGE currentPage, int changePageNumber, CancellationToken token)
727 728
        {
728 729
            var BalancePoint = ViewerDataModel.Instance.PageBalanceMode == true ? changePageNumber + ViewerDataModel.Instance.PageBalanceNumber : changePageNumber;
729 730

  
......
762 763
            var contentScale = zoomAndPanControl.ContentScale;
763 764

  
764 765
            #region 페이지 이미지 로딩 수정
765
            
766 766

  
767
            ViewerDataModel.Instance.ImageViewPath = await App.PageStorage.GetPageImageAsync(token,changePageNumber);
768 767

  
769
            if(token.IsCancellationRequested)
768
            ViewerDataModel.Instance.ImageViewPath = await App.PageStorage.GetPageImageAsync(token, changePageNumber);
769

  
770
            if (token.IsCancellationRequested)
770 771
            {
771 772
                return;
772 773
            }
......
823 824
                else
824 825
                {
825 826
                    Logger.sendCheckLog("Compare Image Download", 1);
826
   
827
                    ComparePageLoad(CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.SyncPageNumber, false);
827

  
828
                    ClearCompareRect();
829

  
830
                    ComparePageLoad(CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.SyncPageNumber, OriginalSizeMode.IsChecked);
828 831
                }
829 832
            }
830 833

  
......
833 836
            this.pageNavigator.ChangePage(changePageNumber);
834 837
        }
835 838

  
836
        private void ComparePageLoad(string documentID,int PageNo, bool IsOriginalSize)
839
        private void ComparePageLoad(string documentID, int PageNo, bool IsOriginalSize)
837 840
        {
838 841
            if (PageNo > ViewerDataModel.Instance.SyncPageCount)
839 842
            {
......
864 867
                zoomAndPanCanvas2.Width = ViewerDataModel.Instance.ImageViewPath_C.PixelWidth;
865 868
                zoomAndPanCanvas2.Height = ViewerDataModel.Instance.ImageViewPath_C.PixelHeight;
866 869

  
867
                zoomAndPanControl.ZoomTo(new Rect
868
                {
869
                    X = 0,
870
                    Y = 0,
871
                    Width = Math.Max(zoomAndPanCanvas.Width, zoomAndPanCanvas2.Width),
872
                    Height = Math.Max(zoomAndPanCanvas.Height, zoomAndPanCanvas2.Height),
873
                });
870
                SyncRotation(ViewerDataModel.Instance.SyncPageAngle);
871

  
874 872

  
875 873
                if (Sync.IsChecked)
876 874
                {
877 875
                    Sync_Click(null, new RoutedEventArgs());
878 876
                }
879

  
877
                else
878
                {
879
                    zoomAndPanControl2.ZoomTo(new Rect
880
                    {
881
                        X = 0,
882
                        Y = 0,
883
                        Width = zoomAndPanCanvas2.Width,
884
                        Height = zoomAndPanCanvas2.Height,
885
                    });
886
                }
880 887
                if (CompareMode.IsChecked)
881 888
                {
882 889
                    SyncCompare_Click(null, new RoutedEventArgs());
883 890
                }
891

  
892
                //zoomAndPanControl.ScaleToFit();
893
                //zoomAndPanControl.ZoomTo(new Rect
894
                //{
895
                //    X = 0,
896
                //    Y = 0,
897
                //    Width = Math.Max(zoomAndPanCanvas.Width, zoomAndPanCanvas2.Width),
898
                //    Height = Math.Max(zoomAndPanCanvas.Height, zoomAndPanCanvas2.Height),
899
                //});
884 900
            }
885 901
        }
886 902

  
......
1085 1101
        /// <param name="PageAngle"></param>
1086 1102
        /// <param name="cts"></param>
1087 1103
        /// <returns></returns>
1088
        private async Task MarkupLoadAsync(int pageNumber,Double PageAngle, CancellationToken cts)
1104
        private async Task MarkupLoadAsync(int pageNumber, Double PageAngle, CancellationToken cts)
1089 1105
        {
1090 1106
            System.Diagnostics.Stopwatch stopwatch = new Stopwatch();
1091 1107
            stopwatch.Start();
......
1153 1169

  
1154 1170
                    foreach (var markupitem in markupitems)
1155 1171
                    {
1156
                        await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync,PageAngle, item.DisplayColor, "", item.MarkupInfoID,
1172
                        await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, PageAngle, item.DisplayColor, "", item.MarkupInfoID,
1157 1173
                            STAMP_Contents: App.SystemInfo.STAMP_CONTENTS);
1158 1174

  
1159 1175
                        //if (cts.IsCancellationRequested)
......
1201 1217
                }
1202 1218
            }
1203 1219

  
1204
            this.pageNavigator.SetCommentList(_pages.ToList(),cts);
1220
            this.pageNavigator.SetCommentList(_pages.ToList(), cts);
1205 1221
        }
1206 1222

  
1207 1223
        public void MarkupitemViewUpdate(string markupinfo_id)
......
1820 1836
                    if (controlType != ControlType.PenControl)
1821 1837
                    {
1822 1838
                        currentControl.OnCreatingMouseMove(currentCanvasDrawingMouseMovePoint, ViewerDataModel.Instance.IsAxisLock || ViewerDataModel.Instance.IsPressShift);
1823
                        
1824 1839

  
1825
                        if(currentControl is MarkupToPDF.Controls.Polygon.PolygonControl && ((MarkupToPDF.Controls.Polygon.PolygonControl)currentControl).IsCompleted)
1840

  
1841
                        if (currentControl is MarkupToPDF.Controls.Polygon.PolygonControl && ((MarkupToPDF.Controls.Polygon.PolygonControl)currentControl).IsCompleted)
1826 1842
                        {
1827 1843
                            var vControl = currentControl as MarkupToPDF.Controls.Polygon.PolygonControl;
1828 1844
                            var firstPoint = vControl.PointSet.First();
......
1836 1852
                            vControl.UpdateControl();
1837 1853
                            currentControl = null;
1838 1854
                        }
1839
                        else if(currentControl is MarkupToPDF.Controls.Polygon.CloudControl && ((MarkupToPDF.Controls.Polygon.CloudControl)currentControl).IsCompleted)
1855
                        else if (currentControl is MarkupToPDF.Controls.Polygon.CloudControl && ((MarkupToPDF.Controls.Polygon.CloudControl)currentControl).IsCompleted)
1840 1856
                        {
1841 1857
                            var vControl = currentControl as MarkupToPDF.Controls.Polygon.CloudControl;
1842 1858

  
......
2247 2263
            }
2248 2264
            else
2249 2265
            {
2250
                
2266

  
2251 2267
            }
2252 2268
        }
2253 2269

  
2254 2270
        private CommentUserInfo enterMouse = null;
2255 2271

  
2256
        private object IntersectsControls(Point mousePosition,Canvas drawingRotateCanvas)
2272
        private object IntersectsControls(Point mousePosition, Canvas drawingRotateCanvas)
2257 2273
        {
2258 2274
            object result = null;
2259 2275

  
......
3101 3117
                        App.Custom_ViewInfoId = item.MarkupInfoID;
3102 3118
                    }
3103 3119
                }
3104
                
3120

  
3105 3121
                switch (controlType)
3106 3122
                {
3107 3123
                    case ControlType.Coordinate:
......
3845 3861
                                    currentControl = null;
3846 3862

  
3847 3863
                                    if (Common.ViewerDataModel.Instance.SelectedControl == "Batch")
3848
                                    { 
3864
                                    {
3849 3865
                                        controlType = ControlType.None;
3850 3866
                                        IsSwingMode = false;
3851 3867
                                        Common.ViewerDataModel.Instance.SelectedControl = "";
......
3889 3905
                                    {
3890 3906
                                        ControlType = controlType
3891 3907
                                    };
3892
                                    
3908

  
3893 3909
                                    currentControl.CommentID = Commons.ShortGuid();
3894 3910
                                    currentControl.IsNew = true;
3895 3911
                                    currentControl.MarkupInfoID = App.Custom_ViewInfoId;
......
3906 3922
                                    (currentControl as TextControl).Base_TextBox.Focus();
3907 3923
                                    (currentControl as TextControl).SetFontFamily(this.ParentOfType<MainWindow>().dzTopMenu.GetFontFamily().FontFamily);
3908 3924

  
3909
                                    if(previousControl == null)
3925
                                    if (previousControl == null)
3910 3926
                                    {
3911 3927
                                        previousControl = currentControl as TextControl;
3912 3928
                                    }
......
4009 4025
                                    (currentControl as TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape;
4010 4026
                                    (currentControl as TextControl).ArcLength = ViewerDataModel.Instance.ArcLength;
4011 4027
                                    (currentControl as TextControl).ApplyTemplate();
4012
                                    
4028

  
4013 4029
                                    (currentControl as TextControl).SetFontFamily(this.ParentOfType<MainWindow>().dzTopMenu.GetFontFamily().FontFamily);
4014 4030

  
4015 4031
                                    (currentControl as TextControl).Base_TextBox.Focus();
......
4056 4072

  
4057 4073
                                    try
4058 4074
                                    {
4059
                                        if(!(currentControl as ArrowTextControl).IsEditingMode)
4075
                                        if (!(currentControl as ArrowTextControl).IsEditingMode)
4060 4076
                                        {
4061 4077
                                            ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl);
4062 4078
                                        }
......
4244 4260
                                        ControlType = ControlType.ArrowTransTextBorderControl,
4245 4261
                                        PageAngle = ViewerDataModel.Instance.PageAngle
4246 4262
                                    };
4247
                                    
4263

  
4248 4264
                                    currentControl.CommentID = Commons.ShortGuid();
4249 4265
                                    currentControl.IsNew = true;
4250 4266
                                    currentControl.MarkupInfoID = App.Custom_ViewInfoId;
......
4399 4415
                                }
4400 4416
                                else
4401 4417
                                {
4402
                                    if ( Application.Current.Resources.Keys.OfType<string>().Count(x => x == "UserSign") == 0)
4418
                                    if (Application.Current.Resources.Keys.OfType<string>().Count(x => x == "UserSign") == 0)
4403 4419
                                    {
4404 4420
                                        Application.Current.Resources.Add("UserSign", _sign);
4405 4421
                                    }
......
4613 4629
                {
4614 4630
                    if (currentControl is ITextControl)
4615 4631
                    {
4616
                        var textBox = currentControl.ChildrenOfType<TextBox>().Where(x=> x.Name == "PART_ArrowTextBox" || x.Name == "Base_TextBox" || x.Name == "PART_TextBox");
4632
                        var textBox = currentControl.ChildrenOfType<TextBox>().Where(x => x.Name == "PART_ArrowTextBox" || x.Name == "Base_TextBox" || x.Name == "PART_TextBox");
4617 4633

  
4618
                        if(textBox.Count() > 0)
4634
                        if (textBox.Count() > 0)
4619 4635
                        {
4620 4636
                            Behaviors.SpecialcharRemove specialcharRemove = new Behaviors.SpecialcharRemove();
4621 4637
                            specialcharRemove.Attach(textBox.First());
......
4641 4657

  
4642 4658
                        if (string.IsNullOrEmpty(control.ArrowText))
4643 4659
                        {
4644
                            UndoCommand.Instance.Push(EventType.Delete, new [] { control });
4660
                            UndoCommand.Instance.Push(EventType.Delete, new[] { control });
4645 4661
                        }
4646 4662
                    };
4647 4663

  
......
4666 4682
            if (mouseHandlingMode != MouseHandlingMode.None && e.LeftButton == MouseButtonState.Pressed)
4667 4683
            {
4668 4684
                // MACRO 버튼클릭하여 CLOUD RECT 그린 후
4669
             
4685

  
4670 4686

  
4671 4687
                if (mouseHandlingMode == MouseHandlingMode.Adorner && SelectLayer.Children.Count > 0)
4672 4688
                {
......
4695 4711

  
4696 4712
        }
4697 4713

  
4698
        
4699 4714

  
4700
        
4715

  
4716

  
4701 4717

  
4702 4718
        private void MenuSendBackward_Click(object sender, RoutedEventArgs e)
4703 4719
        {
......
4812 4828
            inkBoard.Strokes.Add(stroke);
4813 4829
        }
4814 4830

  
4815
        private async  void btnConsolidate_Click(object sender, RoutedEventArgs e)
4831
        private async void btnConsolidate_Click(object sender, RoutedEventArgs e)
4816 4832
        {
4817 4833
            //SelectionSet.Instance.UnSelect(this.ParentOfType<MainWindow>().dzMainMenu);
4818 4834
            //// update mylist and gridview
......
4826 4842
            btnConsolidate.IsEnabled = false;
4827 4843
            var result = await ConsolidationMethod();
4828 4844

  
4829
            if(result)
4845
            if (result)
4830 4846
            {
4831
                 var consolidateItem = ViewerDataModel.Instance._markupInfoList.Where(x => x.Consolidate == 1 && x.AvoidConsolidate == 0);
4847
                var consolidateItem = ViewerDataModel.Instance._markupInfoList.Where(x => x.Consolidate == 1 && x.AvoidConsolidate == 0);
4832 4848

  
4833
                if(consolidateItem?.Count() > 0)
4849
                if (consolidateItem?.Count() > 0)
4834 4850
                {
4835 4851
                    gridViewMarkup.Select(consolidateItem);
4836 4852
                }
......
4872 4888
                    List<IKCOM.MarkupInfoItem> MySelectItem = new List<IKCOM.MarkupInfoItem>();
4873 4889
                    foreach (var item in this.gridViewMarkup.SelectedItems)
4874 4890
                    {
4875
                        if((item as IKCOM.MarkupInfoItem).Depatment.Equals(this.userData.DEPARTMENT))
4891
                        if ((item as IKCOM.MarkupInfoItem).Depatment.Equals(this.userData.DEPARTMENT))
4876 4892
                            MySelectItem.Add(item as IKCOM.MarkupInfoItem);
4877 4893
                    }
4878 4894

  
......
4980 4996

  
4981 4997
            var result = await this.ParentOfType<MainWindow>().dzTopMenu.ExecuteSaveCommandAsync(this);
4982 4998

  
4983
            if(!result)
4999
            if (!result)
4984 5000
            {
4985 5001

  
4986 5002
            }
......
5177 5193
                //Compare 초기화
5178 5194
                CompareMode.IsChecked = false;
5179 5195
                var balancePoint = Convert.ToInt32((sender as System.Windows.Controls.Control).Tag);
5180
                
5196

  
5181 5197
                if (ViewerDataModel.Instance.SyncPageNumber == 0)
5182 5198
                {
5183 5199
                    ViewerDataModel.Instance.SyncPageNumber = 1;
......
5191 5207
                    ViewerDataModel.Instance.PageBalanceNumber += balancePoint;
5192 5208
                }
5193 5209

  
5194
                if ((ViewerDataModel.Instance.SyncPageNumber + balancePoint) >= 1 
5195
                    && ViewerDataModel.Instance.SyncPageNumber + balancePoint  <= ViewerDataModel.Instance.SyncPageCount)
5210
                if ((ViewerDataModel.Instance.SyncPageNumber + balancePoint) >= 1
5211
                    && ViewerDataModel.Instance.SyncPageNumber + balancePoint <= ViewerDataModel.Instance.SyncPageCount)
5196 5212
                {
5197 5213
                    ViewerDataModel.Instance.SyncPageNumber += balancePoint;
5198 5214
                }
......
5233 5249

  
5234 5250
                        ComparePageLoad(CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.SyncPageNumber, isOriginalSize);
5235 5251
                    }
5236
                   
5252

  
5237 5253
                    //강인구 추가(페이지 이동시 코멘트 재 호출)
5238 5254
                    ViewerDataModel.Instance.MarkupControls_Sync.Clear();
5239 5255
                    List<MarkupInfoItem> gridSelectionRevItem = gridViewRevMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList();
......
5243 5259
                        var markupitems = item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.SyncPageNumber).ToList();
5244 5260
                        foreach (var markupitem in markupitems)
5245 5261
                        {
5246
                            await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync,0, item.DisplayColor, "", item.MarkupInfoID,
5262
                            await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, 0, item.DisplayColor, "", item.MarkupInfoID,
5247 5263
                                STAMP_Contents: App.SystemInfo.STAMP_CONTENTS);
5248 5264
                        }
5249 5265
                    }
......
5252 5268
            }
5253 5269
        }
5254 5270

  
5255
        private void SyncRotation_Click(object sender,RoutedEventArgs e)
5271
        private void SyncRotation_Click(object sender, RoutedEventArgs e)
5256 5272
        {
5257 5273
            var direction = int.Parse((sender as Telerik.Windows.Controls.RadPathButton).Tag.ToString());
5258

  
5259
            double translateX = 0;
5260
            double translateY = 0;
5274
    
5261 5275
            double angle = rotate2.Angle;
5262 5276

  
5263 5277
            if (direction == 1)
5264 5278
            {
5265
                if (angle < 270)
5279
                if (angle == 270)
5266 5280
                {
5267
                    angle += 90;
5281
                    angle = 0;
5268 5282
                }
5269 5283
                else
5270 5284
                {
5271
                    angle = 0;
5285
                    angle += 90;
5272 5286
                }
5273 5287
            }
5274 5288
            else
5275 5289
            {
5276
                if (angle > 0)
5290
                if (angle == 0)
5277 5291
                {
5278
                    angle -= 90;
5292
                    angle = 270;
5279 5293
                }
5280 5294
                else
5281 5295
                {
5282
                    angle = 270;
5296
                    angle -= 90;
5283 5297
                }
5284 5298
            }
5285
            zoomAndPanControl2.RotationAngle = angle;
5286
            zoomAndPanControl2.ScaleToFit();
5299
            ViewerDataModel.Instance.SyncPageAngle = angle;
5287 5300

  
5288
            //if (angle == 90 || angle == 270)
5289
            //{
5301
            SyncRotation(ViewerDataModel.Instance.SyncPageAngle);
5302

  
5303
        }
5304

  
5305
        private void SyncRotation(double angle)
5306
        {
5307
            double translateX = 0;
5308
            double translateY = 0;
5309

  
5310

  
5311
            if (angle == 90 || angle == 270)
5312
            {
5290 5313
                double emptySize = zoomAndPanCanvas2.Width;
5291 5314
                zoomAndPanCanvas2.Width = zoomAndPanCanvas2.Height;
5292 5315
                zoomAndPanCanvas2.Height = emptySize;
5293
            //}
5316
            }
5317
            else
5318
            {
5319
                zoomAndPanCanvas2.Width = ViewerDataModel.Instance.ImageViewWidth_C;
5320
                zoomAndPanCanvas2.Height = ViewerDataModel.Instance.ImageViewHeight_C;
5321
            }
5294 5322

  
5295
            if (angle == 90)
5323
            if (angle == 0)
5324
            {
5325
                translateX = 0;
5326
                translateY = 0;
5327
            }
5328
            else if (angle == 90)
5296 5329
            {
5297 5330
                translateX = zoomAndPanCanvas2.Width;
5298 5331
                translateY = 0;
......
5302 5335
                translateX = zoomAndPanCanvas2.Width;
5303 5336
                translateY = zoomAndPanCanvas2.Height;
5304 5337
            }
5305
            else if (angle == 270)
5338
            else
5306 5339
            {
5307 5340
                translateX = 0;
5308 5341
                translateY = zoomAndPanCanvas2.Height;
5309 5342
            }
5310
            zoomAndPanControl2.ContentViewportWidth = zoomAndPanCanvas2.Width;
5311
            zoomAndPanControl2.ContentViewportHeight = zoomAndPanCanvas2.Height;
5343
            zoomAndPanControl2.RotationAngle = rotate.Angle;
5344
            //zoomAndPanControl2.ContentViewportWidth = zoomAndPanCanvas2.Width;
5345
            //zoomAndPanControl2.ContentViewportHeight = zoomAndPanCanvas2.Height;
5312 5346
            translate2.X = translateX;
5313 5347
            translate2.Y = translateY;
5314 5348
            rotate2.Angle = angle;
5349

  
5350
            zoomAndPanControl2.RotationAngle = angle;
5351
            zoomAndPanControl2.ScaleToFit();
5352
            
5353

  
5315 5354
            //translate2CompareBorder.X = translateX;
5316 5355
            //translate2CompareBorder.Y = translateY;
5317 5356
            //rotate2CompareBorder.Angle = angle;
......
5359 5398
            else
5360 5399
            {
5361 5400
                IsSyncPDFMode = false;
5362
                ComparePageLoad(CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber, false);
5363 5401

  
5364 5402
                zoomAndPanControl2.ApplyTemplate();
5365 5403
                zoomAndPanControl2.UpdateLayout();
5404

  
5405
                ComparePageLoad(CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber, OriginalSizeMode.IsChecked);
5406

  
5366 5407
                zoomAndPanCanvas2.Width = Convert.ToDouble(Common.ViewerDataModel.Instance.ContentWidth);
5367 5408
                zoomAndPanCanvas2.Height = Convert.ToDouble(Common.ViewerDataModel.Instance.ContentHeight);
5368 5409
            }
......
5373 5414
        /// </summary>
5374 5415
        private void ClearCompareRect()
5375 5416
        {
5376
            da.From = 1;
5377
            da.To = 1;
5378
            da.Duration = new Duration(TimeSpan.FromSeconds(9999));
5379
            da.AutoReverse = false;
5417
            //da.From = 1;
5418
            //da.To = 1;
5419
            //da.Duration = new Duration(TimeSpan.FromSeconds(9999));
5420
            //da.AutoReverse = false;
5421
          
5422
            //canvas_compareBorder.BeginAnimation(OpacityProperty, da);
5423
            canvas_compareBorder.BeginAnimation(OpacityProperty, null);
5380 5424
            canvas_compareBorder.Children.Clear();
5381
            canvas_compareBorder.BeginAnimation(OpacityProperty, da);
5382 5425
        }
5383 5426

  
5384 5427
        /// <summary>
......
5386 5429
        /// </summary>
5387 5430
        private async void SetCompareRect()
5388 5431
        {
5389
            canvas_compareBorder.Children.Clear();
5390

  
5391 5432
            if (CompareMode.IsChecked)
5392 5433
            {
5393 5434
                //borderComprareWait.Visibility = Visibility.Visible;
......
5438 5479
                ClearCompareRect();
5439 5480
            }
5440 5481
        }
5441

  
5442 5482
        private void CompareDisplay(List<Rect> rects)
5443 5483
        {
5484
            ClearCompareRect();
5485

  
5486
            // UI 스레드에서 작업을 수행
5487
            Application.Current.Dispatcher.Invoke(() =>
5488
            {
5489
                foreach (var d in rects)
5490
                {
5491
                    d.Inflate(new Size(5, 5));
5492

  
5493
                    var point = MarkupToPDF.Controls.Common.MathSet.getRectMiddlePoint(d);
5494
                    var rectangle = new System.Windows.Shapes.Rectangle
5495
                    {
5496
                        Fill = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 244, 15, 126)),
5497
                        Width = d.Width,
5498
                        Height = d.Height,
5499
                        RenderTransformOrigin = point
5500
                    };
5501
                    Canvas.SetLeft(rectangle, d.X - ((point.X - d.X) / 2.0));
5502
                    Canvas.SetTop(rectangle, d.Y - ((point.Y - d.Y) / 2.0));
5503

  
5504
                    canvas_compareBorder.Children.Add(rectangle);
5505
                }
5506

  
5507
                canvas_compareBorder.Visibility = Visibility.Visible;
5508

  
5509
                // 애니메이션 설정
5510
                DoubleAnimation animation = new DoubleAnimation
5511
                {
5512
                    From = 0.7,
5513
                    To = 0.3,
5514
                    Duration = new Duration(TimeSpan.FromSeconds(3)),
5515
                    AutoReverse = true
5516
                };
5517

  
5518
                canvas_compareBorder.BeginAnimation(UIElement.OpacityProperty, animation);
5519
            });
5520
        }
5521

  
5522
        private void CompareDisplay2(List<Rect> rects)
5523
        {
5524
            canvas_compareBorder.BeginAnimation(OpacityProperty, null);
5525
       
5444 5526
            rects.ForEach(d =>
5445 5527
            {
5446 5528
                d.Inflate(new Size(5, 5));
......
5458 5540
                myEllipse.RenderTransformOrigin = point;
5459 5541
                canvas_compareBorder.Children.Add(myEllipse);
5460 5542
            });
5461

  
5543
            
5462 5544
            canvas_compareBorder.Visibility = Visibility.Visible;
5463 5545
            da.From =0.7;
5464 5546
            da.To = 0.3;
......
5481 5563
                if (pageinfo != null)
5482 5564
                {
5483 5565
                    ViewerDataModel.Instance.SyncPageCount = pageinfo.PAGE_COUNT;
5566
                    ViewerDataModel.Instance.SyncPages = pageinfo.DOCPAGE.ToList();
5484 5567
                }
5485 5568
                else
5486 5569
                {
......
5511 5594
                        }
5512 5595
                        gridViewRevMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoRevList;
5513 5596

  
5514
                        ComparePageLoad(CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber, false);
5597
                        var findPage = ViewerDataModel.Instance.SyncPages.Find(x => x.PAGE_NUMBER == pageNavigator.CurrentPage.PageNumber);
5598
                        
5599
                        int syncCurrentPageNo = 1;
5600

  
5601
                        if(findPage != null)
5602
                        {
5603
                            syncCurrentPageNo = pageNavigator.CurrentPage.PageNumber;
5604
                            ViewerDataModel.Instance.SyncPageAngle = findPage.PAGE_ANGLE;
5605
                        }
5606

  
5607
                        ComparePageLoad(CurrentRev.DOCUMENT_ID, syncCurrentPageNo, OriginalSizeMode.IsChecked);
5515 5608

  
5516 5609
                        Sync_Offset_Point = new Point(zoomAndPanControl.ContentOffsetX, zoomAndPanControl.ContentOffsetY);
5517 5610

  
......
5563 5656
            ClearCompareRect();
5564 5657

  
5565 5658
            ComparePageLoad(CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.SyncPageNumber, OriginalSizeMode.IsChecked);
5659

  
5566 5660
        }
5567 5661

  
5568 5662
        private void EnsembleLink_Button_Click(object sender, RoutedEventArgs e)
......
5616 5710

  
5617 5711
                    Sync_Offset_Point = new Point(zoomAndPanControl.ContentOffsetX, zoomAndPanControl.ContentOffsetY);
5618 5712

  
5619
                    ComparePageLoad(CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber, false);
5713
                    ComparePageLoad(CurrentRev.DOCUMENT_ID, pageNavigator.CurrentPage.PageNumber, OriginalSizeMode.IsChecked);
5620 5714

  
5621 5715
                    zoomAndPanCanvas2.Width = Convert.ToDouble(Common.ViewerDataModel.Instance.ContentWidth);
5622 5716
                    zoomAndPanCanvas2.Height = Convert.ToDouble(Common.ViewerDataModel.Instance.ContentHeight);

내보내기 Unified diff

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