프로젝트

일반

사용자정보

개정판 6707a5c7

ID6707a5c7d16ccd6271385271c0ffd927f7d7ade0
상위 4ca11b36
하위 44c5e27e

이지연이(가) 약 6년 전에 추가함

issue #680 temp file save add

차이점 보기:

KCOM/Views/MainMenu.xaml.cs
29 29
using KCOM.Controls;
30 30
using KCOMDataModel.DataModel;
31 31
using System.Xml;
32
using static KCOM.TempFile;
33
using System.Windows.Threading;
34
using System.Diagnostics;
35
using System.Threading;
32 36

  
33 37
namespace KCOM.Views
34 38
{
......
221 225
        }
222 226

  
223 227
        #endregion
224

  
225

  
228
                
226 229
        public MainMenu()
227 230
        {
228 231
            InitializeComponent();
229
            this.Loaded += MainMenu_Loaded;
232
            this.Loaded += MainMenu_Loaded;           
230 233
        }
234

  
235
        public class TempDt
236
        {
237
            public int PageNumber { get; set; }
238
            public string CommentID { get; set; }
239
            public string ConvertData { get; set; }
240
            public int DATA_TYPE { get; set; }
241
            public string MarkupInfoID { get; set; }
242
            public int IsUpdate { get; set; }
243
        }
244

  
245
        List<TempDt> tempDtList = new List<TempDt>();
246
            
231 247
        private void SetCursor()
232 248
        {
233 249
            this.Cursor = cursor;
......
296 312
            {
297 313
                ComingNewBieEnd = false;
298 314
                ViewerDataModel.Instance.MarkupList_USER.Remove(a);
315
                //임시파일에서도 삭제
316
                for (int i = 0; i < item.MarkupList.Count; i++)
317
                {
318
                    temp.DelTemp(item.MarkupList[i].ID, this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber.ToString());                    
319
                }
299 320
            });
300 321

  
301 322
            gridViewMarkup.ItemsSource = ViewerDataModel.Instance._markupInfoList;
......
342 363

  
343 364
        System.Windows.Media.Animation.DoubleAnimation da = new System.Windows.Media.Animation.DoubleAnimation();
344 365

  
366
        private static Timer timer;
367
        private int InitInterval = KCOM.Properties.Settings.Default.InitInterval;
345 368
        private void MainMenu_Loaded(object sender, RoutedEventArgs e)
346 369
        {
347 370
            if (App.ParameterMode)
348
            {          
349
                if (System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory + "ControlLog.xml")) //임시파일이 있는가?
350
                {
351
                    //this.pageNavigator.PageChanging += pageNavigator_PageChanging;
352
                    this.pageNavigator.PageChanging += TempLoad;
353
                    
354
                }
355
                else
356
                {
357
                    this.pageNavigator.PageChanging += pageNavigator_PageChanging;
358
                    imageViewer_Compare = new Image();
359

  
360
                    layerControl.ProjectNo = App.ViewInfo.ProjectNO;
361
                    ViewerDataModel.Instance.Capture_Opacity = 0;
362

  
363
                    da.From = 0.8;
364
                    da.To = 0;
365
                    da.Duration = new Duration(TimeSpan.FromSeconds(1));
366
                    da.AutoReverse = true;
367
                    da.RepeatBehavior = System.Windows.Media.Animation.RepeatBehavior.Forever;
368
                }
369
            }
371
            {
372
                this.pageNavigator.PageChanging += pageNavigator_PageChanging;
373
                imageViewer_Compare = new Image();
374
                layerControl.ProjectNo = App.ViewInfo.ProjectNO;
375
                ViewerDataModel.Instance.Capture_Opacity = 0;
376
                da.From = 0.8;
377
                da.To = 0;
378
                da.Duration = new Duration(TimeSpan.FromSeconds(1));
379
                da.AutoReverse = true;
380
                da.RepeatBehavior = System.Windows.Media.Animation.RepeatBehavior.Forever;
381
            }
382
            timer = new Timer(timercallback, null, 0, InitInterval * 60000); 
370 383
        }
371 384

  
372
        //private void pageNavigator_PageChanging(object sender, Controls.Sample.PageChangeEventArgs e)
373
        private void TempLoad(object sender, Controls.Sample.PageChangeEventArgs e)
385
        private void timercallback(Object o)
374 386
        {
375
            MarkupToPDF.Controls.Parsing.LayerControl layerControl = new MarkupToPDF.Controls.Parsing.LayerControl();
376
            XmlDocument xdoc = new XmlDocument();
377
            xdoc.Load(AppDomain.CurrentDomain.BaseDirectory + "ControlLog.xml"); // XML 데이타를 파일에서 로드                
378
            XmlNodeList nodes = xdoc.SelectNodes("/Root/CommentID"); // 특정 노드들을 필터링
379

  
380
            int PageNumber = 0;
381

  
382
            foreach (XmlNode node in nodes) //파일안에 데이터가 있는가?
383
            {
384
                string sCommentID = node.Attributes["Value"].Value;
385
                string ConvertData = node.SelectSingleNode("ConvertData").InnerText;
386
                string DATA_TYPE = node.SelectSingleNode("DATA_TYPE").InnerText;
387
                PageNumber = Convert.ToInt32(node.SelectSingleNode("PageNumber").InnerText);
388
                string MarkupInfoID = node.SelectSingleNode("MarkupInfoID").InnerText;
389

  
390
                layerControl.markupParseEx(ConvertData, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", MarkupInfoID, sCommentID);                
391
            }
387
            Stopwatch sw = new Stopwatch();
388
            sw.Start();
389
            TempFileAdd();
390
            sw.Stop();
392 391

  
393

  
394
            //  ViewerDataModel.Instance.PageBalanceNumber = PageNumber;
395
            ViewerDataModel.Instance.PageNumber = ViewerDataModel.Instance.PageBalanceNumber = PageNumber;
396
          //  BalancePoint = 
397
            // BalancePoint = 2
398
            var BalancePoint = pageNavigator.PageCount;
399

  
400
            /*
401
            if (BalancePoint < 1)
392
            Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate
402 393
            {
403
                BalancePoint = 1;
404
                ViewerDataModel.Instance.PageBalanceNumber = 0;
405
            }
394
               if (this.ParentOfType<MainWindow>().dzTopMenu.cbAutoSave.IsChecked == true) //Auto Save Checked?
395
                {
396
                    timer.Change(((int)this.ParentOfType<MainWindow>().dzTopMenu.cbSaveInterval.Value * 60000) / 2, sw.ElapsedMilliseconds); //Timer Setting
397
                }
398
            }));
406 399

  
407
            if (pageNavigator.PageCount < BalancePoint)
408
            {
409
                BalancePoint = pageNavigator.PageCount;
410
                ViewerDataModel.Instance.PageBalanceNumber = 0;
411
            }
412
            */
400
            GC.Collect();
401
        }
413 402

  
414
            string uri = "";
415
            if (userData.COMPANY != "EXT")
416
            {
417
                uri = String.Format(Properties.Settings.Default.mainServerImageWebPath, _ViewInfo.ProjectNO, (Convert.ToInt32(_ViewInfo.DocumentItemID) / 100).ToString(), _ViewInfo.DocumentItemID, PageNumber);
418
            }
419
            else
403
        void TempFileAdd()
404
        {   
405
            Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate
420 406
            {
421 407
                uri = String.Format(Properties.Settings.Default.subServerImageWebPath, _ViewInfo.ProjectNO, _ViewInfo.DocumentItemID, PageNumber);
422 408
            }
423 409

  
424
            var defaultBitmapImage = new BitmapImage();
425
            defaultBitmapImage.BeginInit();
426
            defaultBitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
427
            defaultBitmapImage.CacheOption = BitmapCacheOption.OnLoad;
428
            defaultBitmapImage.UriSource = new Uri(uri);
429
            defaultBitmapImage.EndInit();
410
            var defaultBitmapImage = new BitmapImage(new Uri(uri));
430 411

  
431
            ViewerDataModel.Instance.ImageViewPath = null;
432
            GC.Collect();
412
            ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage;
413
            ViewerDataModel.Instance.ImageViewWidth = defaultBitmapImage.PixelWidth;
414
            ViewerDataModel.Instance.ImageViewHeight = defaultBitmapImage.PixelHeight;
433 415

  
434 416
            if (defaultBitmapImage.IsDownloading)
435 417
            {
436 418
                defaultBitmapImage.DownloadCompleted += (ex, arg) =>
437 419
                {
438
                    defaultBitmapImage.Freeze();
439
                    mainPanel.UpdateLayout();
440
                    GC.Collect();
441 420
                    ViewerDataModel.Instance.ImageViewPath = defaultBitmapImage;
442 421
                    ViewerDataModel.Instance.ImageViewWidth = defaultBitmapImage.PixelWidth;
443 422
                    ViewerDataModel.Instance.ImageViewHeight = defaultBitmapImage.PixelHeight;
444 423
                };
445 424
            }
446 425

  
447
            zoomAndPanCanvas.Width = Convert.ToDouble(e.CurrentPage.PAGE_WIDTH);
448
            zoomAndPanCanvas.Height = Convert.ToDouble(e.CurrentPage.PAGE_HEIGHT);
449

  
450

  
451
            Common.ViewerDataModel.Instance.ContentWidth = zoomAndPanCanvas.Width;
452
            Common.ViewerDataModel.Instance.ContentHeight = zoomAndPanCanvas.Height;
453
            inkBoard.Width = zoomAndPanCanvas.Width;
454
            inkBoard.Height = zoomAndPanCanvas.Height;
455

  
426
                    EmptyControlCheck();
456 427

  
457
            if (!testPanel2.IsHidden)
458
            {
459
                //PDF모드일때 잠시 대기(강인구)
460
                if (IsSyncPDFMode)
461
                {
462
                    Get_FinalImage.Get_PdfImage get_PdfImage = new Get_FinalImage.Get_PdfImage();
463
                    var pdfpath = new BitmapImage(new Uri(get_PdfImage.Run(CurrentRev.TO_VENDOR, App.ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, ViewerDataModel.Instance.PageNumber)));
464

  
465
                    if (pdfpath.IsDownloading)
428
                    if (undoTime > updatetime)
466 429
                    {
467
                        pdfpath.DownloadCompleted += (ex, arg) =>
430
                        if (ViewerDataModel.Instance.MarkupControls_USER.Count > 0)
468 431
                        {
469
                            ViewerDataModel.Instance.ImageViewPath_C = pdfpath;
470
                            ViewerDataModel.Instance.ImageViewWidth_C = pdfpath.PixelWidth;
471
                            ViewerDataModel.Instance.ImageViewHeight_C = pdfpath.PixelHeight;
472
                            zoomAndPanCanvas2.Width = pdfpath.PixelWidth;
473
                            zoomAndPanCanvas2.Height = pdfpath.PixelHeight;
474
                        };
475
                    }
476
                    else
477
                    {
478
                        ViewerDataModel.Instance.ImageViewPath_C = pdfpath;
479
                        ViewerDataModel.Instance.ImageViewWidth_C = pdfpath.PixelWidth;
480
                        ViewerDataModel.Instance.ImageViewHeight_C = pdfpath.PixelHeight;
432
                            foreach (var control in ViewerDataModel.Instance.MarkupControls_USER)
433
                            {
434
                                var root = layerControl.MarkupToString(control, App.ViewInfo.UserID);
435
                                
436
                                var existItem = ViewerDataModel.Instance.MarkupList_USER.Where(data => data.ID == root.CommentID).FirstOrDefault();
437
                                if (existItem != null)
438
                                {
439
                                    if (existItem.Data != root.ConvertData) 
440
                                    {
441
                                        tempDtList.Add(new TempDt()
442
                                        {
443
                                            CommentID = control.CommentID,
444
                                            ConvertData = root.ConvertData,
445
                                            DATA_TYPE = root.DATA_TYPE,
446
                                            MarkupInfoID = App.Custom_ViewInfoId,
447
                                            PageNumber = this.pageNavigator.CurrentPage.PageNumber,
448
                                            IsUpdate = 1
449
                                        });
450
                                    }
451
                                }
452
                                else //신규 추가 된 코멘트
453
                                {
454
                                    if (root.CommentID != null)
455
                                    {
456
                                        var currentCommentCheck = ViewerDataModel.Instance.MarkupList_USER.Where(dt => dt.ID == control.CommentID).FirstOrDefault();
457
                                        if (currentCommentCheck != null)
458
                                        {
459
                                            tempDtList.Add(new TempDt()
460
                                            {
461
                                                CommentID = control.CommentID,
462
                                                ConvertData = root.ConvertData,
463
                                                DATA_TYPE = root.DATA_TYPE,
464
                                                MarkupInfoID = App.Custom_ViewInfoId,
465
                                                PageNumber = this.pageNavigator.CurrentPage.PageNumber,
466
                                                IsUpdate = 1
467
                                            });
468
                                        }
469
                                        else
470
                                        {
471
                                            tempDtList.Add(new TempDt()
472
                                            {
473
                                                CommentID = control.CommentID,
474
                                                ConvertData = root.ConvertData,
475
                                                DATA_TYPE = root.DATA_TYPE,
476
                                                MarkupInfoID = App.Custom_ViewInfoId,
477
                                                PageNumber = this.pageNavigator.CurrentPage.PageNumber,
478
                                                IsUpdate = 0
479
                                            });
480
                                        }
481
                                    }
482
                                }
483
                            }                            
484
                        }
481 485

  
482
                        zoomAndPanCanvas2.Width = pdfpath.PixelWidth;
483
                        zoomAndPanCanvas2.Height = pdfpath.PixelHeight;
486
                        temp.WriteTemp(tempDtList);
487
                        tempDtList.Clear();
484 488
                    }
485 489
                }
486
                else
487
                {
488
                    string uri2 = "";
489
                    if (userData.COMPANY != "EXT")
490
                    {
491
                        uri2 = String.Format(Properties.Settings.Default.mainServerImageWebPath, _ViewInfo.ProjectNO, (Convert.ToInt32(CurrentRev.DOCUMENT_ID) / 100).ToString(), CurrentRev.DOCUMENT_ID, BalancePoint);
492
                    }
493
                    else
494
                    {
495
                        uri2 = String.Format(Properties.Settings.Default.subServerImageWebPath, _ViewInfo.ProjectNO, CurrentRev.DOCUMENT_ID, BalancePoint);
496
                    }
490
            }));
497 491

  
492
        }
498 493

  
499
                    var defaultBitmapImage_Compare = new BitmapImage(new Uri(uri2));
500 494

  
501
                    ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare;
502
                    ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth;
503
                    ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight;
504
                    zoomAndPanCanvas2.Width = defaultBitmapImage_Compare.PixelWidth;
505
                    zoomAndPanCanvas2.Height = defaultBitmapImage_Compare.PixelHeight;
495
        public class TempLoadData
496
        {
497
            public int PageNumber { get; set; }
498
            public string CommentID { get; set; }
499
            public string ConvertData { get; set; }
500
            public string DATA_TYPE { get; set; }
501
            public string MarkupInfoID { get; set; }
502
            public int IsUpdate { get; set; }
503
        }
506 504

  
507
                    zoomAndPanControl.ZoomTo(new Rect
508
                    {
509
                        X = 0,
510
                        Y = 0,
511
                        Width = Math.Max(zoomAndPanCanvas.Width, zoomAndPanCanvas2.Width),
512
                        Height = Math.Max(zoomAndPanCanvas.Height, zoomAndPanCanvas2.Height),
513
                    });
505
        List<TempLoadData> tempLoadData = new List<TempLoadData>();
506
        public string FilePath = AppDomain.CurrentDomain.BaseDirectory + "Temp\\" + App.ViewInfo.DocumentItemID + ".tmp";
514 507

  
515
                    if (defaultBitmapImage_Compare.IsDownloading)
508
        public void TempLoad()
509
        {
510
            if ((System.IO.File.Exists(FilePath)) == true) 
511
            {
512
                XmlDocument xdoc = new XmlDocument();
513
                xdoc.Load(FilePath);               
514
                XmlNodeList nodes = xdoc.SelectNodes("/Root/CommentID"); 
515
                int PageNumber = 0;
516
                if (nodes.Count > 0) 
517
                {
518
                    if (MessageBox.Show("저장하지 못한 데이터가 있습니다. 불러오시겠습니까?", "MARKUS", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
516 519
                    {
517
                        defaultBitmapImage_Compare.DownloadCompleted += (ex, arg) =>
520
                        foreach (XmlNode node in nodes)
518 521
                        {
519

  
520
                            ViewerDataModel.Instance.ImageViewPath_C = defaultBitmapImage_Compare;
521
                            ViewerDataModel.Instance.ImageViewWidth_C = defaultBitmapImage_Compare.PixelWidth;
522
                            ViewerDataModel.Instance.ImageViewHeight_C = defaultBitmapImage_Compare.PixelHeight;
523

  
524
                            zoomAndPanCanvas2.Width = defaultBitmapImage_Compare.PixelWidth;
525
                            zoomAndPanCanvas2.Height = defaultBitmapImage_Compare.PixelHeight;
526

  
527
                            zoomAndPanControl.ZoomTo(new Rect
522
                            string CommentID = node.Attributes["Value"].Value;
523
                            string ConvertData = node.SelectSingleNode("ConvertData").InnerText;
524
                            string DATA_TYPE = node.SelectSingleNode("DATA_TYPE").InnerText;
525
                            string MarkupInfoID = node.SelectSingleNode("MarkupInfoID").InnerText;
526
                            int IsUpdate = Convert.ToInt32(node.SelectSingleNode("IsUpdate").InnerText);
527
                            PageNumber = Convert.ToInt32(node.SelectSingleNode("PageNumber").InnerText);                           
528
                            
529
                            tempLoadData.Add(new TempLoadData()
528 530
                            {
529
                                X = 0,
530
                                Y = 0,
531
                                Width = Math.Max(zoomAndPanCanvas.Width, zoomAndPanCanvas2.Width),
532
                                Height = Math.Max(zoomAndPanCanvas.Height, zoomAndPanCanvas2.Height),
531
                                PageNumber = PageNumber,
532
                                CommentID = CommentID,
533
                                ConvertData = ConvertData,
534
                                DATA_TYPE = DATA_TYPE,
535
                                MarkupInfoID = MarkupInfoID,
536
                                IsUpdate = IsUpdate
533 537
                            });
534
                        };
535
                    }
536
                }
537
                tlSyncPageNum.Text = String.Format("Current Page : {0}", BalancePoint);
538
            }
539

  
540
            this.pageNavigator.SetNextPage();
541

  
538
                        }
542 539

  
540
                        if (PageNumber > 0)
541
                        {
542
                            this.pageNavigator.GotoPage(PageNumber);
543
                        }
543 544

  
545
                        // Temp Object add               
546
                        if (pageNavigator.CurrentPage.PageNumber == PageNumber)
547
                        {
548
                            TempControlLoad();
549
                        }
550
                        tempLoadData.Clear();
551
                    }
552
                }
553
                else //파일 삭제
554
                {
555
                    temp.Remove();
556
                }
557
            }          
544 558
        }
545

  
559
    
546 560

  
547 561
        public void ReleaseAdorner()
548 562
        {
......
615 629
                foreach (var control in ViewerDataModel.Instance.MarkupControls_USER)
616 630
                {
617 631
                    var root = layerControl.MarkupToString(control, App.ViewInfo.UserID);
618

  
619 632
                   
620
                        var existItem = ViewerDataModel.Instance.MarkupList_USER.Where(data => data.ID == root.CommentID).FirstOrDefault();
621
                        if (existItem != null) //신규 추가 된 코멘트
633
                    var existItem = ViewerDataModel.Instance.MarkupList_USER.Where(data => data.ID == root.CommentID).FirstOrDefault();
634
                    if (existItem != null) //신규 추가 된 코멘트
635
                    {
636
                        if (existItem.Data != root.ConvertData) //코멘트가 같은지
622 637
                        {
623
                            if (existItem.Data != root.ConvertData) //코멘트가 같은지
624
                            {
625
                                existItem.Data = root.ConvertData;
626
                                existItem.IsUpdate = true;
627
                            }
638
                            existItem.Data = root.ConvertData;
639
                            existItem.IsUpdate = true;
628 640
                        }
629
                        else
641
                    }
642
                    else
643
                    {
644
                        if (root.CommentID != null)
630 645
                        {
631
                            if (root.CommentID != null)
646
                            isComingNewBie = true;
647
                            var currentCommentCheck = ViewerDataModel.Instance.MarkupList_USER.Where(dt => dt.ID == control.CommentID).FirstOrDefault();
648
                            if (currentCommentCheck != null)
632 649
                            {
633
                                isComingNewBie = true;
634
                                var currentCommentCheck = ViewerDataModel.Instance.MarkupList_USER.Where(dt => dt.ID == control.CommentID).FirstOrDefault();
635
                                if (currentCommentCheck != null)
636
                                {
637
                                    currentCommentCheck.Data = root.ConvertData;
638
                                }
639
                                else
650
                                currentCommentCheck.Data = root.ConvertData;
651
                            }
652
                            else
653
                            {
654
                                ViewerDataModel.Instance.MarkupList_USER.Add(new MarkupItemEx
640 655
                                {
641
                                    ViewerDataModel.Instance.MarkupList_USER.Add(new MarkupItemEx
642
                                    {
643
                                        ID = control.CommentID,
644
                                        Data = root.ConvertData,
645
                                        Data_Type = root.DATA_TYPE,
646
                                        MarkupInfoID = App.Custom_ViewInfoId,
647
                                        PageNumber = this.pageNavigator.CurrentPage.PageNumber,
648
                                    });
649
                                }
656
                                    ID = control.CommentID,
657
                                    Data = root.ConvertData,
658
                                    Data_Type = root.DATA_TYPE,
659
                                    MarkupInfoID = App.Custom_ViewInfoId,
660
                                    PageNumber = this.pageNavigator.CurrentPage.PageNumber,
661
                                });
650 662
                            }
651 663
                        }
652
                    
653

  
654
                    
664
                    }                    
655 665
                }
656 666
            }
657 667

  
668

  
658 669
            if (PreviewUserMarkupInfoItem != null && isComingNewBie && !ComingNewBieEnd)
659 670
            {
660 671
                if (ViewerDataModel.Instance._markupInfoList.Where(info => info.UserID == PreviewUserMarkupInfoItem.UserID).FirstOrDefault() == null)
......
679 690
            {   
680 691
                this.ParentOfType<MainWindow>().dzTopMenu.SaveEvent(null, null);
681 692
            }
682

  
693
            
683 694
            ViewerDataModel.Instance.UndoDataList.Clear();
684

  
695
            
685 696
            InkControl_Convert();
686 697

  
687 698
            ReleaseAdorner();
......
750 761
            inkBoard.Width = zoomAndPanCanvas.Width;
751 762
            inkBoard.Height = zoomAndPanCanvas.Height;
752 763

  
764
           
753 765

  
754 766
            if (!testPanel2.IsHidden)
755 767
            {
......
850 862
            {
851 863
                if (item.UserID == App.ViewInfo.UserID)
852 864
                {
865
                    ViewerDataModel.Instance.current_page_commentcnt = ViewerDataModel.Instance.MarkupList_USER.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().Count;
853 866
                    ViewerDataModel.Instance.MarkupList_USER.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem)
854 867
                    {
855 868
                        layerControl.markupParseEx(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", item.MarkupInfoID, markupitem.ID);
856 869
                    });
870
                    
857 871
                }
858 872
                else
859 873
                {
......
863 877
                    });
864 878
                }
865 879
            }
866

  
880
            
867 881
            if (!testPanel2.IsHidden)
868 882
            {
869 883
                ViewerDataModel.Instance.Sync_ContentOffsetX = zoomAndPanControl.ContentOffsetX;
......
888 902
            instanceMain.dzTopMenu.tlcurrentPage.Text = e.CurrentPage.PAGE_NUMBER.ToString();
889 903
            instanceMain.dzTopMenu.tlcurrentPage_readonly.Text = e.CurrentPage.PAGE_NUMBER.ToString();
890 904

  
891
            //강인구 추가
892 905
            instanceMain.dzTopMenu.rotateOffSet = 0;
893 906
            var pageinfo = this.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == e.CurrentPage.PAGE_NUMBER).FirstOrDefault();
894 907
            drawingPannelRotate(pageinfo.PAGE_ANGLE);
......
896 909
            //}
897 910
            SetCommentPages(true);
898 911
        }
912
        
913

  
914
        //Temp Control Load
915
        public void TempControlLoad()
916
        {
917
            List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>();
918

  
919
            for (int k = 0; k < tempLoadData.Count; k++)
920
            {
921
                System.Windows.Controls.Control item = null;
922
                Multi_Undo_data multi_Undo_Data;
923
                
924

  
925
                switch (tempLoadData[k].IsUpdate)
926
                {
927
                    case 0://추가
928
                        var control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.CommentID == tempLoadData[k].CommentID).FirstOrDefault();
929
                        if (control != null)
930
                        {
931
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(control);
932
                            var Item_ = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (control as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault();
933
                            ViewerDataModel.Instance.MarkupList_USER.Remove(Item_);
934
                        }
935

  
936
                        //Control                   
937
                        item = layerControl.TempMarkupParseEx(tempLoadData[k].ConvertData, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", tempLoadData[k].MarkupInfoID, tempLoadData[k].CommentID);
938
                                               
939
                        UndoData = new Undo_data()
940
                        {
941
                            IsUndo = false,
942
                            Event = Event_Type.Create,
943
                            EventTime = DateTime.Now,
944
                            Opacity = ViewerDataModel.Instance.ControlOpacity,
945
                            Markup_List = new List<Multi_Undo_data>()
946
                        };
947

  
948
                        multi_Undo_Data = new Multi_Undo_data();
949
                        multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo);
950
                        UndoData.Markup_List.Add(multi_Undo_Data);
951
                        ViewerDataModel.Instance.UndoDataList.Add(UndoData);
952
                        break;
953
                    case 1://수정
954
                        control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.CommentID == tempLoadData[k].CommentID).FirstOrDefault();
955
                        if (control != null)
956
                        {
957
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(control);
958
                            var Item_ = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (control as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault();
959
                            ViewerDataModel.Instance.MarkupList_USER.Remove(Item_);
960
                        }
961

  
962
                        //Control                   
963
                        item = layerControl.TempMarkupParseEx(tempLoadData[k].ConvertData, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", tempLoadData[k].MarkupInfoID, tempLoadData[k].CommentID);
964

  
965
                        UndoData = new Undo_data()
966
                        {
967
                            IsUndo = false,
968
                            Event = Event_Type.Thumb,
969
                            EventTime = DateTime.Now,
970
                            Opacity = ViewerDataModel.Instance.ControlOpacity,
971
                            Markup_List = new List<Multi_Undo_data>()
972
                        };
973

  
974
                        multi_Undo_Data = new Multi_Undo_data();
975
                        multi_Undo_Data = this.ParentOfType<MainWindow>().dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo);
976
                        UndoData.Markup_List.Add(multi_Undo_Data);
977
                        ViewerDataModel.Instance.UndoDataList.Add(UndoData);                        
978
                        break;
979
                    case 2://삭제
980

  
981
                        control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.CommentID == tempLoadData[k].CommentID).FirstOrDefault();
982
                        if (control != null)
983
                        {
984
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(control);
985
                            var Item_ = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (control as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault();
986
                            ViewerDataModel.Instance.MarkupList_USER.Remove(Item_);                  
987
                        }
988
                        break;
989
                }              
990
            }       
991
        }
899 992

  
900 993
        private void SetCommentPages(bool onlyMe = false)
901 994
        {
......
3081 3174
                {
3082 3175
                    //dragSelectionBorder.Visibility = Visibility.Visible;
3083 3176
                    isLeftMouseButtonDownOnWindow = true;
3084
                }
3085

  
3177
                }               
3086 3178

  
3087 3179
                var control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.IsMouseOver).FirstOrDefault();
3088 3180
                if (control != null)
......
3247 3339
                    ViewerDataModel.Instance.UndoDataList.Add(UndoData);
3248 3340

  
3249 3341
                    SelectLayer.Children.Add(final);
3250
                }
3342
                }              
3251 3343
            }
3252

  
3253 3344
            else if (mouseHandlingMode == MouseHandlingMode.Drawing)
3254
            {
3345
            {               
3255 3346
                init();
3256 3347
                //강인구 추가(우 클릭 일 경우 커서 변경 하지 않음)
3257 3348
                if (cursor != Cursors.SizeAll)
......
4638 4729
                                RemoveLineStroke(canvasDrawingMouseDownPoint);
4639 4730
                            }
4640 4731
                            IsDrawing = true;
4641

  
4642
                            temp.AddTemp(currentControl, pageNavigator.CurrentPage.PageNumber);
4643 4732
                            return;
4644 4733
                        }
4645 4734
                    default:
......
4706 4795
                ViewerDataModel.Instance.MarkupControls_USER.Remove(control);
4707 4796
                var Item_ = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.ID == (control as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault();
4708 4797
                ViewerDataModel.Instance.MarkupList_USER.Remove(Item_);
4709

  
4710

  
4798
                
4799
                //임시파일에서도 삭제한다.
4800
                temp.DelTemp((control as MarkupToPDF.Common.CommentUserInfo).CommentID, this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber.ToString());
4801
                
4711 4802
                ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
4712 4803
                {
4713 4804
                    ViewerDataModel.Instance.UndoDataList.Remove(i);
......
5568 5659
            ViewerDataModel.Instance.UndoDataList.Add(UndoData);
5569 5660

  
5570 5661
            //List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList();
5571

  
5572
            temp.AddTemp(currentControl, pageNavigator.CurrentPage.PageNumber);
5573 5662
        }
5574

  
5575 5663
        
5576 5664
        public Multi_Undo_data Control_Style(CommentUserInfo control)
5577 5665
        {
......
5622 5710
                        foreach (var item in undo.Markup_List)
5623 5711
                        {
5624 5712
                            ViewerDataModel.Instance.MarkupControls_USER.Remove((item.Markup));
5625
                            //임시파일에서도 삭제한다.
5626
                            temp.DataDel(item.Markup.CommentID);
5627 5713
                        }
5628 5714
                    }
5629 5715
                    break;
......
5740 5826
           });
5741 5827
        }
5742 5828

  
5829

  
5830
        
5743 5831
        public void Redo()
5744 5832
        {
5745 5833
            if (ViewerDataModel.Instance.IsPressCtrl)
......
5760 5848
                        foreach (var item in redo.Markup_List)
5761 5849
                        {
5762 5850
                            ViewerDataModel.Instance.MarkupControls_USER.Add(item.Markup);
5763
                            temp.AddTemp(item.Markup, pageNavigator.CurrentPage.PageNumber);
5851
                            //temp.AddTemp(redo, pageNavigator.CurrentPage.PageNumber, 0, 0);
5764 5852
                        }
5765 5853
                    }
5766 5854
                    break;
......
6135 6223
                    final.MoveAdorner(new System.Windows.Controls.Primitives.DragDeltaEventArgs(0.001, 0.001)); //dummy
6136 6224
                }
6137 6225
                /// up to here
6138
                
6226

  
6139 6227
                ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final);
6140 6228
            }
6141 6229
        }

내보내기 Unified diff

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