프로젝트

일반

사용자정보

개정판 ac4f1e13

IDac4f1e13b52e9641951fd7437ded61125f1b4e0b
상위 c8b87260
하위 72424099

김태성이(가) 약 5년 전에 추가함

Markup load 비동기로 변경

Change-Id: I471906b1090f7f3f0fd18e97d88a54f75fd1f673

차이점 보기:

KCOM/Common/Converter/MarkupDataToConverter.cs
4 4
using System.Globalization;
5 5
using System.Linq;
6 6
using System.Text;
7
using System.Threading.Tasks;
7 8
using System.Windows.Data;
8 9

  
9 10
namespace KCOM.Common.Converter
......
16 17
            {
17 18
                if (value is string)
18 19
                {
19
                    return MarkupParser.GetMemo(value.ToString());
20
                    var task =  MarkupParser.GetMemoAsync(value.ToString()).ConfigureAwait(true);
21

  
22
                    return task.GetAwaiter().GetResult();
20 23
                }
21 24
            }
22 25
            else
KCOM/Common/TempFile.cs
377 377
                        // Temp Object add               
378 378
                        if (Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber == PageNumber)
379 379
                        {
380
                            TempControlLoad();
380
                            TempControlLoadAsync();
381 381
                        }
382 382
                        tempLoadData.Clear();
383 383
                    }
......
391 391

  
392 392

  
393 393
        //Temp Control Load
394
        public static void TempControlLoad()
394
        public static async void TempControlLoadAsync()
395 395
        {
396 396
            List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>();
397 397

  
......
413 413
                        }
414 414

  
415 415
                        //Control                   
416
                        item = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, tempLoadData[k].ConvertData, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", tempLoadData[k].MarkupInfoID, tempLoadData[k].CommentID);
416
                        item = await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, tempLoadData[k].ConvertData, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", tempLoadData[k].MarkupInfoID, tempLoadData[k].CommentID);
417 417

  
418 418
                        UndoData = new Undo_data()
419 419
                        {
......
439 439
                        }
440 440

  
441 441
                        //Control                   
442
                        item = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, tempLoadData[k].ConvertData, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", tempLoadData[k].MarkupInfoID, tempLoadData[k].CommentID);
442
                        item = await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, tempLoadData[k].ConvertData, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", tempLoadData[k].MarkupInfoID, tempLoadData[k].CommentID);
443 443

  
444 444
                        UndoData = new Undo_data()
445 445
                        {
KCOM/Controls/Sample.xaml.cs
161 161
        /// </summary>
162 162
        /// <param name="sender"></param>
163 163
        /// <param name="e"></param>
164
        private void ImgListbox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
164
        private async void ImgListbox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
165 165
        {
166 166
            if(e.AddedItems.Count > 0)
167 167
            {
168
                var number = (e.AddedItems[0] as KCOM.Common.ThumbnailItem).PageNumber;
168
                await ImgListbox.Dispatcher.InvokeAsync(() =>
169
                {
170
                    var number = (e.AddedItems[0] as KCOM.Common.ThumbnailItem).PageNumber;
169 171

  
170
                ViewerDataModel.Instance.SystemMain.dzTopMenu._SaveEvent(null, null);   /// save controls
172
                    ViewerDataModel.Instance.SystemMain.dzTopMenu._SaveEvent(null, null);   /// save controls
171 173

  
172
                this.CurrentPage = e.AddedItems[0] as KCOM.Common.ThumbnailItem;
174
                    this.CurrentPage = e.AddedItems[0] as KCOM.Common.ThumbnailItem;
175

  
176
                    PageChanging(this, new PageChangeEventArgs
177
                    {
178
                        CurrentPage = this._PageList.Where(p => p.PAGE_NUMBER == number).First(),
179
                        PageNumber = number,
180
                        PageUri = null
181
                    });
173 182

  
174
                PageChanging(this, new PageChangeEventArgs
175
                {
176
                    CurrentPage = this._PageList.Where(p => p.PAGE_NUMBER == number).First(),
177
                    PageNumber = number,
178
                    PageUri = null
179 183
                });
180 184
            }
181 185
            
......
675 679
            }
676 680
        }
677 681

  
678
        private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
682
        private async void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
679 683
        {
680 684
            if (e.ClickCount >= 2)
681 685
            {
682 686
                var selectItem = MarkupList.SelectedItem as IKCOM.MarkupItem;
687

  
683 688
                GotoPage(selectItem.PageNumber);
684
                var result = MarkupParser.GetBaseControl(selectItem.Data);
689

  
690
                var result = await MarkupParser.GetBaseControlAsync(selectItem.Data);
691

  
685 692
                Rect rect = new Rect(new Point(result.StartPoint.X - 100, result.StartPoint.Y - 100), new Point(result.EndPoint.X + 100, result.EndPoint.Y + 100));
686 693
                this.ParentOfType<KCOM.Views.MainMenu>().zoomAndPanControl.ZoomTo(rect);
687 694
                //bool isGO = false;
......
739 746
        /// </summary>
740 747
        /// <param name="sender"></param>
741 748
        /// <param name="e"></param>
742
        private void RadButton_Click_OLD(object sender, RoutedEventArgs e)
749
        private async void RadButton_Click_OLD(object sender, RoutedEventArgs e)
743 750
        {
744 751
            var clickButtonItem = sender as RadButton;
745 752
            if (clickButtonItem != null && clickButtonItem.CommandParameter != null)
......
753 760
                    MarkupInfoItemSmall gaza = clickButtonItem.CommandParameter as MarkupInfoItemSmall;
754 761
                    GotoPage(Convert.ToInt32(gaza.PageNumber));
755 762

  
756
                    var data = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString(gaza.Data.ToString()); //언패킹작업
763
                    var data = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(gaza.Data.ToString()); //언패킹작업
757 764
                    switch (Enum.Parse(typeof(MarkupToPDF.Controls.Common.ControlType), gaza.Data_Type.ToString()))
758 765
                    {
759 766
                        case MarkupToPDF.Controls.Common.ControlType.TextControl:
......
1241 1248
            ViewerDataModel.Instance.SystemMain.dzTopMenu.PanoramaShow();
1242 1249
        }
1243 1250

  
1244
        private void btnSearch_Click(object sender, RoutedEventArgs e)
1251
        private async void btnSearch_Click(object sender, RoutedEventArgs e)
1245 1252
        {
1246 1253
            string search_str = txtSearch.Text;
1247 1254

  
......
1269 1276
            }
1270 1277
            foreach (var item in list)
1271 1278
            {
1272
                var data = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString(item.Data.ToString());
1279
                var data = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(item.Data.ToString());
1273 1280

  
1274 1281
                switch (Enum.Parse(typeof(MarkupToPDF.Controls.Common.ControlType), item.Data_Type.ToString()))
1275 1282
                {
KCOM/Controls/Symbol.xaml.cs
162 162
            lstSymbolPublic.ItemsSource = Custom_List;
163 163
        }
164 164

  
165
        public PngBitmapEncoder symImage(string data)
165
        public async Task<PngBitmapEncoder> symImageAsync(string data)
166 166
        {
167 167

  
168 168
            Canvas _canvas = new Canvas();
169 169
            _canvas.Background = Brushes.White;
170 170
            _canvas.Width = finalItem.BorderSize.Width;
171 171
            _canvas.Height = finalItem.BorderSize.Height;
172
            MarkupParser.Parse(App.ViewInfo.ProjectNO, data, _canvas, "#FFFF0000", "");
172
            await MarkupParser.ParseAsync(App.ViewInfo.ProjectNO, data, _canvas, "#FFFF0000", "");
173 173

  
174 174
            BitmapEncoder encoder = new PngBitmapEncoder();
175 175

  
......
287 287
                {
288 288
                    if (args.DialogResult.Value)
289 289
                    {
290
                        PngBitmapEncoder _Encoder = symImage(data);
290
                        PngBitmapEncoder _Encoder = await symImageAsync(data);
291 291

  
292 292
                        System.IO.MemoryStream fs = new System.IO.MemoryStream();
293 293
                        _Encoder.Save(fs);
......
418 418
        /// </summary>
419 419
        /// <date>2018.06.14</date>
420 420
        /// <param name="id"></param>
421
        private void PlaceSymbol(string id,Point CurrentMousePoint)
421
        private async void PlaceSymbol(string id,Point CurrentMousePoint)
422 422
        {
423 423
            string Data_ = "";
424 424

  
......
474 474
                    {
475 475
                        if (parse != "")
476 476
                        {
477
                            System.Windows.Controls.Control item = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, parse, ViewerDataModel.Instance.MarkupControls_USER, string.Empty, string.Empty);
477
                            System.Windows.Controls.Control item = await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, parse, ViewerDataModel.Instance.MarkupControls_USER, string.Empty, string.Empty);
478 478
                            (item as MarkupToPDF.Common.CommentUserInfo).CommentID = Commons.shortGuid();
479 479
                            (item as MarkupToPDF.Common.CommentUserInfo).SymbolID = id;
480 480
                            //(item as MarkupToPDF.Common.CommentUserInfo).GroupID = group_id;
KCOM/Events/Implementation/TopMenuEvent.cs
2445 2445
             public double height { get; set; }
2446 2446
         }
2447 2447
         */
2448
        private void CollapsedButton_Click()
2448
        private async void CollapsedButton_Click()
2449 2449
        {
2450 2450
            this.ParentOfType<MainWindow>().dzTopMenu._SaveEvent(null, null); // 저장하지 못한 데이터가 있다면 저장
2451 2451

  
......
2465 2465
                    data = new string[instance.Count];
2466 2466
                    foreach (var markup in instance)
2467 2467
                    {
2468
                        data[cnt++] = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString(markup.Data);
2468
                        data[cnt++] = await MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressStringAsync(markup.Data);
2469 2469
                    }
2470 2470
                }
2471 2471
            }
......
2721 2721
            }
2722 2722
        }
2723 2723

  
2724
        public void Paste_Start()
2724
        public async void Paste_Start()
2725 2725
        {
2726 2726
            //마크업 붙여넣기
2727 2727
            if (Clipboard.GetText().Contains("|OR||DZ|"))
......
2753 2753
                {
2754 2754
                    if (parse != "")
2755 2755
                    {
2756
                        System.Windows.Controls.Control item = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, parse, ViewerDataModel.Instance.MarkupControls_USER, string.Empty, string.Empty);
2756
                        System.Windows.Controls.Control item = await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, parse, ViewerDataModel.Instance.MarkupControls_USER, string.Empty, string.Empty);
2757 2757
                        (item as MarkupToPDF.Common.CommentUserInfo).CommentID = Commons.shortGuid();
2758 2758

  
2759 2759
                        ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo);
KCOM/Events/Load.cs
42 42
        }
43 43

  
44 44
        //마크업 불러오기
45
        public void Markup_Load(Canvas printCanvas)
45
        public async void Markup_Load(Canvas printCanvas)
46 46
        {
47 47
            List<string> markupdata = new List<string>();
48 48

  
......
60 60

  
61 61
            foreach (string data in markupdata)
62 62
            {                
63
                MarkupParser.Parse(App.ViewInfo.ProjectNO, data, printCanvas, DisplayColor, "");
63
                await MarkupParser.ParseAsync(App.ViewInfo.ProjectNO, data, printCanvas, DisplayColor, "");
64 64
            }
65 65
        }
66 66
    }
KCOM/Events/PasteCommand.cs
56 56
        /// <author>humkyung</author>
57 57
        /// <date>2019.06.18</date>
58 58
        /// <param name="comments"></param>
59
        public void Execute()
59
        public async void Execute()
60 60
        {
61 61
            if (Clipboard.GetText().Contains("|OR||DZ|"))
62 62
            {
......
90 90
                        string[] data2 = new string[2];
91 91
                        data2 = parse.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
92 92

  
93
                        System.Windows.Controls.Control item = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, data2[0], ViewerDataModel.Instance.MarkupControls_USER, string.Empty, string.Empty);
93
                        System.Windows.Controls.Control item = await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, data2[0], ViewerDataModel.Instance.MarkupControls_USER, string.Empty, string.Empty);
94 94
                        (item as MarkupToPDF.Common.CommentUserInfo).CommentID = Commons.shortGuid();
95 95
                        if (data2.Length >= 2)
96 96
                        {
KCOM/Services/BaseServices.cs
442 442
            }
443 443
        }
444 444

  
445
        private void gridViewRevMarkup_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
445
        private async void gridViewRevMarkup_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
446 446
        {
447 447
            List<MarkupInfoItem> gridSelectionItem = gridViewRevMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
448 448
            //if (ViewerDataModel.Instance.PageBalanceNumber == 0)
......
462 462
                    //{
463 463
                    //    layerControl.markupParse(markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID);
464 464
                    //});
465
                    item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageNumber).ToList().ForEach(delegate (MarkupItem markupitem)
465

  
466
                    var pageItems = item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageNumber).ToList();
467

  
468
                    foreach (var markupitem in pageItems)
466 469
                    {
467
                        MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID);
468
                    });
470
                       await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID);
471
                    }
469 472
                }
470 473
            }
471 474
            else if (e.RemovedItems.Count > 0)
......
487 490
        /// </summary>
488 491
        /// <param name="sender"></param>
489 492
        /// <param name="e"></param>
490
        private void gridViewMarkup_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
493
        private async void gridViewMarkup_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
491 494
        {
492 495
            SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu);
493 496

  
......
566 569
                            if (controls.Count == 0)
567 570
                            {
568 571
                                var instance = ViewerDataModel.Instance.MyMarkupList.Where(d => d.PageNumber == this.pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList();
572

  
569 573
                                foreach (var markup in instance)
570 574
                                {
571
                                    MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", 
575
                                    await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", 
572 576
                                        item.MarkupInfoID, markup.ID);
573 577
                                }
574 578
                            }
......
588 592
                                var instance = ViewerDataModel.Instance.MarkupList_Pre.Where(d => d.PageNumber == this.pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList();
589 593
                                foreach (var markup in instance)
590 594
                                {
591
                                    MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "",
595
                                    await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "",
592 596
                                        item.MarkupInfoID, markup.ID);
593 597
                                }
594 598
                            }
......
852 856
            //hubConnection.Stop();
853 857
        }
854 858

  
855
        public void MarkupUserListDisplay()
859
        public async void MarkupUserListDisplay()
856 860
        {
857 861
            List<MarkupInfoItem> gridItem = gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList(); //전체 마크업
858 862
            List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
......
894 898

  
895 899
            foreach (var item in gridSelectionItem)
896 900
            {
901

  
897 902
                if (item.UserID == App.ViewInfo.UserID)
898 903
                {
899
                    ViewerDataModel.Instance.MyMarkupList.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem)
904
                    var markupItems = ViewerDataModel.Instance.MyMarkupList.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList();
905

  
906
                    foreach (var markupitem in markupItems)
900 907
                    {
901
                        MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", 
902
                            item.MarkupInfoID, markupitem.ID);
903
                    });
908
                        await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", 
909
                                item.MarkupInfoID, markupitem.ID);
910
                    }
904 911
                }
905 912
                else
906 913
                {
907
                    ViewerDataModel.Instance.MarkupList_Pre.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().ForEach(delegate (MarkupItemEx markupitem)
914
                    var markupItems = ViewerDataModel.Instance.MarkupList_Pre.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList();
915

  
916
                    foreach (var markupitem in markupItems)
908 917
                    {
909
                        MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "", item.MarkupInfoID);
910
                    });
918
                        await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "", item.MarkupInfoID);
919
                    }
911 920
                }
912 921
            }
913 922
        }
KCOM/Views/MainMenu.xaml.cs
809 809
            ViewerDataModel.Instance.LoadPageMarkup();
810 810
        }
811 811

  
812
        private void MarkupLoad(int pageNumber)
813
        { 
812
        private async void MarkupLoad(int pageNumber)
813
        {
814
            System.Diagnostics.Stopwatch stopwatch = new Stopwatch();
815
            stopwatch.Start();
816

  
814 817
            /// 컨트롤을 새로 생성한다.
815 818
            Common.ViewerDataModel.Instance.MarkupControls_USER.Clear();    //전체 제거
816 819
            Common.ViewerDataModel.Instance.MarkupControls.Clear();         //전체 제거
817 820

  
821
            System.Diagnostics.Debug.WriteLine("MarkupLoad - Clear " + new TimeSpan(stopwatch.ElapsedTicks).ToString());
822

  
818 823
            foreach (var markup in ViewerDataModel.Instance.MyMarkupList.Where(param => param.PageNumber == pageNumber))
819 824
            { 
820 825
                var info = ViewerDataModel.Instance._markupInfoList.Where(param => param.MarkupInfoID == markup.MarkupInfoID).FirstOrDefault();
......
823 828
                    string sColor = (info.UserID == App.ViewInfo.UserID) ? "#FFFF0000" : info.DisplayColor;
824 829
                    if (info.UserID == App.ViewInfo.UserID)
825 830
                    {
826
                        var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, sColor, "",
831
                        var control = await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, sColor, "",
827 832
                                        markup.MarkupInfoID, markup.ID);
828 833
                        control.Visibility = Visibility.Hidden;
829 834
                    }
830 835
                    else
831 836
                    {
832
                        var control = MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, sColor, "",
837
                        var control = await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markup.Data, Common.ViewerDataModel.Instance.MarkupControls, sColor, "",
833 838
                                                                markup.MarkupInfoID, markup.ID);
834 839
                        control.Visibility = Visibility.Hidden;
835 840
                    }
......
837 842
            };
838 843
            /// up to here
839 844

  
845
            System.Diagnostics.Debug.WriteLine("MarkupLoad - MarkupParser " + new TimeSpan(stopwatch.ElapsedTicks).ToString());
846

  
840 847
            /// fire selection event
841 848
            List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
842 849
            this.gridViewMarkup.UnselectAll();
......
854 861

  
855 862
                foreach (var item in gridSelectionRevItem)
856 863
                {
857
                    item.MarkupList.Where(pageItem => pageItem.PageNumber == pageNumber).ToList().ForEach(delegate (MarkupItem markupitem)
864
                    var markupitems = item.MarkupList.Where(pageItem => pageItem.PageNumber == pageNumber).ToList();
865

  
866
                    foreach (var markupitem in markupitems)
858 867
                    {
859
                        MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID);
860
                    });
868
                        await MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID);
869
                    }
861 870
                }
862 871
            }
863
            
872

  
873
            System.Diagnostics.Debug.WriteLine("MarkupLoad - MarkupParser 2 " + new TimeSpan(stopwatch.ElapsedTicks).ToString());
874

  
864 875
            SetCommentPages();
865 876

  
877
            System.Diagnostics.Debug.WriteLine("MarkupLoad - SetCommentPages " + new TimeSpan(stopwatch.ElapsedTicks).ToString());
866 878
        }
867 879

  
868 880
        public void SetCommentPages()
......
4382 4394
            BalanceMode.IsChecked = false;
4383 4395
        }
4384 4396

  
4385
        private void SyncPageChange_Click(object sender, RoutedEventArgs e)
4397
        private async void SyncPageChange_Click(object sender, RoutedEventArgs e)
4386 4398
        {
4387 4399
            if ((sender as System.Windows.Controls.Control).Tag != null)
4388 4400
            {
......
4478 4490

  
4479 4491
                    foreach (var item in gridSelectionRevItem)
4480 4492
                    {
4481
                        item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageNumber).ToList().ForEach(delegate (MarkupItem markupitem)
4493
                        var markupitems = item.MarkupList.Where(pageItem => pageItem.PageNumber == ViewerDataModel.Instance.PageNumber).ToList();
4494
                        foreach (var markupitem in markupitems)
4482 4495
                        {
4483
                            MarkupParser.ParseEx(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID);
4484
                        });
4496
                           await  MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, markupitem.Data, Common.ViewerDataModel.Instance.MarkupControls_Sync, item.DisplayColor, "", item.MarkupInfoID);
4497
                        }
4485 4498
                    }
4486 4499

  
4487 4500
                    //강인구 추가
......
5059 5072
            }
5060 5073
            
5061 5074
        }
5062
        private void MarkupNamePromptClose(string data, WindowClosedEventArgs args)
5075
        private async void MarkupNamePromptClose(string data, WindowClosedEventArgs args)
5063 5076
        {
5064 5077
            try
5065 5078
            {
......
5067 5080
                {
5068 5081
                    if (args.DialogResult.Value)
5069 5082
                    {
5070
                        PngBitmapEncoder _Encoder = symImage(data);
5083
                        PngBitmapEncoder _Encoder = await symImageAsync(data);
5071 5084

  
5072 5085
                        System.IO.MemoryStream fs = new System.IO.MemoryStream();
5073 5086
                        _Encoder.Save(fs);
......
5096 5109
            }
5097 5110
        }
5098 5111

  
5099
        public PngBitmapEncoder symImage(string data)
5112
        public async Task<PngBitmapEncoder> symImageAsync(string data)
5100 5113
        {
5101 5114

  
5102 5115
            Canvas _canvas = new Canvas();
5103 5116
            _canvas.Background = Brushes.White;
5104 5117
            _canvas.Width = adorner_.BorderSize.Width;
5105 5118
            _canvas.Height = adorner_.BorderSize.Height;
5106
            MarkupParser.Parse(App.ViewInfo.ProjectNO, data, _canvas, "#FFFF0000", "");
5119
            await MarkupParser.ParseAsync(App.ViewInfo.ProjectNO, data, _canvas, "#FFFF0000", "");
5107 5120

  
5108 5121
            BitmapEncoder encoder = new PngBitmapEncoder();
5109 5122

  
......
5385 5398
            return multi_Undo_Data;
5386 5399
        }
5387 5400

  
5388
        private void Comment_Move(object sender, MouseButtonEventArgs e)
5401
        private async void Comment_Move(object sender, MouseButtonEventArgs e)
5389 5402
        {
5390 5403
            string Select_ID = (((e.Source as Telerik.Windows.Controls.RadButton).DataContext) as IKCOM.MarkupInfoItem).UserID;
5391 5404
            foreach (var items in ViewerDataModel.Instance._markupInfoRevList)
......
5396 5409
                    {
5397 5410
                        if (item.PageNumber == pageNavigator.CurrentPage.PageNumber)
5398 5411
                        {
5399
                            MarkupParser.ParseEx(App.ViewInfo.ProjectNO, item.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", 
5412
                           await  MarkupParser.ParseExAsync(App.ViewInfo.ProjectNO, item.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, "#FFFF0000", "", 
5400 5413
                                items.MarkupInfoID, Commons.shortGuid());
5401 5414
                        }
5402 5415
                    }
KCOM_API/ServiceDeepView.svc.cs
2527 2527
        /// <returns></returns>
2528 2528
        private string getEnsembleSign(string user_id)
2529 2529
        {
2530
            string result = string.Empty;
2530
            string result = null;
2531 2531
            string soapurl = string.Empty;
2532

  
2532 2533
            try
2533 2534
            {
2534 2535
                string sConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
2535 2536
                using (KCOMEntities Entity = new KCOMEntities(sConnString))
2536 2537
                {
2537 2538
                    var item = Entity.PROPERTIES.Where(d => d.TYPE == "UpLoadServiceUrl").FirstOrDefault();
2538
                    soapurl = item.VALUE;
2539
                }
2540
                WebClient webClient = new WebClient();
2541
                string data = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ens=\"http://EnsemblePlus.Webservice\"> <soapenv:Header/> <soapenv:Body> <ens:checkoutSignImage>"
2542
                    + "<ens:sUserNo>" + user_id + "</ens:sUserNo>"
2543
                    + "</ens:checkoutSignImage> </soapenv:Body></soapenv:Envelope>";
2544
                webClient.Headers.Add(HttpRequestHeader.ContentType, "text/xml");
2545
                webClient.Headers.Add("SOAPAction", "http://EnsemblePlus.Webservice");
2546
                var _result = webClient.UploadString(new Uri(soapurl), data);
2547
                XmlDocument xmlDoc = new XmlDocument();
2548
                xmlDoc.LoadXml(_result);
2549
                XmlNodeList list = xmlDoc.GetElementsByTagName("checkoutSignImageResponse");
2550
                foreach (XmlNode xn in list)
2551
                {
2552
                    result = xn["checkoutSignImageReturn"].InnerText;
2553
                }
2554
                if (!result.Contains("No business object"))
2555
                {
2556
                    return result;
2557
                }
2558
                else
2559
                {
2560
                    return null;
2539

  
2540
                    if (item != null)
2541
                    {
2542
                        soapurl = item.VALUE;
2543

  
2544
                        WebClient webClient = new WebClient();
2545
                        string data = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ens=\"http://EnsemblePlus.Webservice\"> <soapenv:Header/> <soapenv:Body> <ens:checkoutSignImage>"
2546
                            + "<ens:sUserNo>" + user_id + "</ens:sUserNo>"
2547
                            + "</ens:checkoutSignImage> </soapenv:Body></soapenv:Envelope>";
2548
                        webClient.Headers.Add(HttpRequestHeader.ContentType, "text/xml");
2549
                        webClient.Headers.Add("SOAPAction", "http://EnsemblePlus.Webservice");
2550
                        var _result = webClient.UploadString(new Uri(soapurl), data);
2551
                        XmlDocument xmlDoc = new XmlDocument();
2552
                        xmlDoc.LoadXml(_result);
2553
                        XmlNodeList list = xmlDoc.GetElementsByTagName("checkoutSignImageResponse");
2554

  
2555
                        foreach (XmlNode xn in list)
2556
                        {
2557
                            result = xn["checkoutSignImageReturn"].InnerText;
2558
                        }
2559

  
2560
                        if (result.Contains("No business object"))
2561
                        {
2562
                            result = null;
2563
                        }
2564
                    }
2565
                    else
2566
                    {
2567
                        result = null;
2568
                    }
2561 2569
                }
2570
             
2562 2571
            }
2563 2572
            catch (Exception ex)
2564
            {
2565
                return null;
2573
            {   
2574
                result = null;
2566 2575
            }
2567 2576

  
2568

  
2577
            return result;
2569 2578
        }
2570 2579
        #endregion
2571 2580

  
KCOM_API/Web.config
10 10
    </sectionGroup>
11 11
  </configSections>
12 12
  <connectionStrings>
13
    <!--효성 Connection String-->
14 13
    <add name="ConnectionString"
15
      connectionString="metadata=res://*/DataModel.KCOM_Model.csdl|res://*/DataModel.KCOM_Model.ssdl|res://*/DataModel.KCOM_Model.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=10.11.252.2,9875;initial catalog=markus;persist security info=True;user id=ProjectPortalDBConn;password=ProjectPortalDBConn;multipleactiveresultsets=True;App=EntityFramework&quot;"
14
      connectionString="metadata=res://*/DataModel.KCOM_Model.csdl|res://*/DataModel.KCOM_Model.ssdl|res://*/DataModel.KCOM_Model.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=cloud.devdoftech.co.kr,7777;initial catalog=markus;persist security info=True;user id=doftech;password=dof1073#;multipleactiveresultsets=True;App=EntityFramework&quot;"
16 15
      providerName="System.Data.EntityClient"/>
17 16
    <add name="CIConnectionString"
18
      connectionString="metadata=res://*/DataModel.CIModel.csdl|res://*/DataModel.CIModel.ssdl|res://*/DataModel.CIModel.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=10.11.252.2,9875;initial catalog=markus;persist security info=True;user id=ProjectPortalDBConn;password=ProjectPortalDBConn;multipleactiveresultsets=True;App=EntityFramework&quot;"
17
      connectionString="metadata=res://*/DataModel.CIModel.csdl|res://*/DataModel.CIModel.ssdl|res://*/DataModel.CIModel.msl;provider=System.Data.SqlClient;provider=System.Data.SqlClient;provider connection string=&quot;data source=cloud.devdoftech.co.kr,7777;initial catalog=markus;persist security info=True;user id=doftech;password=dof1073#;multipleactiveresultsets=True;App=EntityFramework&quot;"
19 18
      providerName="System.Data.EntityClient"/>
20 19
  </connectionStrings>
21 20
  <!--
......
82 81
  <applicationSettings>
83 82
    <KCOM_API.Properties.Settings>
84 83
      <setting name="TileSoucePath" serializeAs="String">
85
        <value>http://10.11.252.3/TileSource/{0}_Tile/{1}/{2}/{3}.png</value>
84
        <value>http://192.168.0.67:5977/TileSource/{0}_Tile/{1}/{2}/{3}.png</value>
86 85
      </setting>
87 86
      <setting name="TileSoucePath_SUB" serializeAs="String">
88
        <value>http://10.11.252.3/TileSource/{0}_Tile/{1}/{2}/{3}.png</value>
87
        <value>http://192.168.0.67:5977/TileSource/{0}_Tile/{1}/{2}/{3}.png</value>
89 88
      </setting>
90 89
      <setting name="IsProjectNoPass" serializeAs="String">
91 90
        <value>True</value>
MarkupToPDF/Controls/Etc/SignControl.cs
463 463
                    {
464 464
                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
465 465

  
466
                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
467
                        stream.Write(imageBytes, 0, imageBytes.Length);
468
                        stream.Position = 0;
469
                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
470 466
                        BitmapImage returnImage = new BitmapImage();
471
                        returnImage.BeginInit();
472
                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
473
                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
474
                        ms.Seek(0, System.IO.SeekOrigin.Begin);
475
                        returnImage.StreamSource = ms;
476
                        returnImage.EndInit();
477
                        stream.Close();
467

  
468
                        using (System.IO.MemoryStream stream = new System.IO.MemoryStream())
469
                        {
470
                            stream.WriteAsync(imageBytes, 0, imageBytes.Length);
471
                            stream.Position = 0;
472
                            System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
473
                            returnImage.BeginInit();
474
                            System.IO.MemoryStream ms = new System.IO.MemoryStream();
475
                            img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
476
                            ms.Seek(0, System.IO.SeekOrigin.Begin);
477
                            returnImage.StreamSource = ms;
478
                            returnImage.EndInit();
479
                            stream.Close();
480
                        }
481

  
478 482
                        instance.SignImage = returnImage;
479 483
                    }
480 484
                }
MarkupToPDF/Controls/Parsing/MarkupParse.cs
29 29
using Svg2Xaml;
30 30
using MarkupToPDF.Controls.Cad;
31 31
using MarkupToPDF.Controls.Common;
32
using System.Threading.Tasks;
32 33

  
33 34
namespace MarkupToPDF.Controls.Parsing
34 35
{
......
207 208
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
208 209
        /// </summary>
209 210
        /// <param name="MarkupString"></param>
210
        public static void Parse(string sProjectNo, string MarkupString, Canvas Layer, string DisplayColor, string ToolTipMessage)
211
        public static async Task ParseAsync(string sProjectNo, string MarkupString, Canvas Layer, string DisplayColor, string ToolTipMessage)
211 212
        {
212 213
            if (MarkupString != "False")
213 214
            {
......
219 220

  
220 221
                foreach (var token in tokens)
221 222
                {
222
                    var item = JsonSerializerHelper.UnCompressString(token); //언패킹작업
223
                    var item = await JsonSerializerHelper.UnCompressStringAsync(token); //언패킹작업
223 224
                    CommentUserInfo control = MarkupParser.FromString(item, _SetColor, sProjectNo);
224 225
                    if (control != null)
225 226
                    {
......
269 270
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
270 271
        /// </summary>
271 272
        /// <param name="MarkupString"></param>
272
        public static Control ParseEx(string sProjectNo, string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID = null, string commentId = null)
273
        public static async Task<Control> ParseExAsync(string sProjectNo, string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID = null, string commentId = null)
273 274
        {
274 275
            Control res = null;
275 276

  
......
282 283

  
283 284
                foreach (var dataPease in data)
284 285
                {
285
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
286
                    var item = await JsonSerializerHelper.UnCompressStringAsync(dataPease); //언패킹작업
286 287
                    CommentUserInfo control = MarkupParser.FromString(item, _SetColor, sProjectNo);
287 288
                    res = control as Control;
288 289
                    if (control != null)
......
336 337
            return res;
337 338
        }
338 339

  
339
        public static S_BaseControl GetBaseControl(string MarkupString)
340
        public static async Task<S_BaseControl> GetBaseControlAsync(string MarkupString)
340 341
        {
341
            var item = JsonSerializerHelper.UnCompressString(MarkupString); //언패킹작업
342
            var item = await JsonSerializerHelper.UnCompressStringAsync(MarkupString); //언패킹작업
342 343
            var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
343 344
            return unknownData;
344 345
        }
345 346

  
346
        public static string GetMemo(string MarkupString)
347
        public static async Task<string> GetMemoAsync(string MarkupString)
347 348
        {
348
            var item = JsonSerializerHelper.UnCompressString(MarkupString); //언패킹작업
349
            var item = await JsonSerializerHelper.UnCompressStringAsync(MarkupString); //언패킹작업
349 350
            var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
350 351
            return unknownData.Memo;
351 352
        }
MarkupToPDF/Serialize/Core/JsonSerializerHelper.cs
13 13
using System.Runtime.Serialization.Json;
14 14
using System.Text;
15 15
using System.IO.Compression;
16
using System.Threading.Tasks;
16 17

  
17 18
namespace MarkupToPDF.Serialize.Core
18 19
{
......
95 96
        /// </summary>
96 97
        /// <param name="str">Base64인코딩 된 데이터를 넣어주세요</param>
97 98
        /// <returns></returns>
98
        public static string UnCompressString(string str)
99
        public static async Task<string> UnCompressStringAsync(string str)
99 100
        {
100 101
            str = str.Replace("|DZ|", ""); //|DZ|는 접두사입니다.
101 102

  
......
109 110
            using (GZipStream gzipStream = new GZipStream(inStream, CompressionMode.Decompress))
110 111
            using (MemoryStream outStream = new MemoryStream())
111 112
            {
112
                gzipStream.CopyTo(outStream);
113
                await gzipStream.CopyToAsync(outStream);
113 114
                //return Encoding.ASCII.GetString(outStream.ToArray());
114 115
                return Encoding.UTF8.GetString(outStream.ToArray());
115 116
            }

내보내기 Unified diff

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