프로젝트

일반

사용자정보

개정판 ac4f1e13

IDac4f1e13b52e9641951fd7437ded61125f1b4e0b
상위 c8b87260
하위 72424099

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

Markup load 비동기로 변경

Change-Id: I471906b1090f7f3f0fd18e97d88a54f75fd1f673

차이점 보기:

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
                    }

내보내기 Unified diff

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