프로젝트

일반

사용자정보

개정판 6b5d33c6

ID6b5d33c6771a5d58dd8ec854602f70c75eba23a6
상위 6a419948
하위 384903aa, df0f521e

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

issue #1002 comment 선택 시 control 객체의 focus event 로 인한 문제로 event 호출 위치및 순서를 정리.

Change-Id: Ie8752339ac93bab04e24f94dbc9a61d0db8f93bd

차이점 보기:

KCOM/Services/BaseServices.cs
478 478
            }
479 479
            else //파라미터로 넘어온 사용자가 걸리지 않은 경우
480 480
            {
481
                MarkupUserListDisplay();
481
                EmptyControlCheck();
482
                List<MarkupInfoItem> gridItem = gridViewMarkup.Items.Cast<MarkupInfoItem>().ToList(); //전체 마크업
483
                List<MarkupInfoItem> gridSelectionItem = gridViewMarkup.SelectedItems.Cast<MarkupInfoItem>().ToList(); //선택 된 마크업
484
                List<MarkupInfoItem> gridNonSelectionItem = gridItem.Except(gridSelectionItem).ToList(); //선택 되지 않은 마크업
485
                MarkupToPDF.Controls.Parsing.LayerControl layerControl = new MarkupToPDF.Controls.Parsing.LayerControl();
486
                layerControl.ProjectNo = App.ViewInfo.ProjectNO;
487
                #region 코멘트 보기
488
                if (e.AddedItems.Count() > 0)
489
                {
490
                    foreach (var item in gridSelectionItem)
491
                    {
492
                        if ((item.UserID == App.ViewInfo.UserID) && (this.pageNavigator.CurrentPage != null))
493
                        {
494

  
495
                            var instance = ViewerDataModel.Instance.MarkupList_USER.Where(d => d.PageNumber == pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList();
496
                            var my_item = Common.ViewerDataModel.Instance.MarkupControls_USER.FirstOrDefault();
497
                            Common.ViewerDataModel.Instance.current_page_commentcnt = Common.ViewerDataModel.Instance.MarkupList_USER.Where(data => data.PageNumber == pageNavigator.CurrentPage.PageNumber && data.MarkupInfoID == item.MarkupInfoID).ToList().Count;
498
                            if (my_item == null)
499
                            {
500
                                foreach (var markup in instance)
501
                                {
502
                                    layerControl.markupParseEx(markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", item.MarkupInfoID, markup.ID);
503
                                }
504
                            }
505
                            else
506
                            {
507
                                var test = instance.Where(data => data.MarkupInfoID == my_item.MarkupInfoID).FirstOrDefault();
508

  
509
                                if (test == null)
510
                                {
511
                                    foreach (var markup in instance)
512
                                    {
513
                                        layerControl.markupParseEx(markup.Data, Common.ViewerDataModel.Instance.MarkupControls_USER, item.DisplayColor, "", item.MarkupInfoID, markup.ID);
514
                                    }
515
                                }
516
                            }
517
                        }
518
                        else if (this.pageNavigator.CurrentPage != null)
519
                        {
520
                            var instance = ViewerDataModel.Instance.MarkupList_Pre.Where(d => d.PageNumber == pageNavigator.CurrentPage.PageNumber && d.MarkupInfoID == item.MarkupInfoID).ToList();
521
                            foreach (var markup in instance)
522
                            {
523
                                layerControl.markupParse(markup.Data, Common.ViewerDataModel.Instance.MarkupControls, item.DisplayColor, "", item.MarkupInfoID);
524
                            }
525
                        }
526
                    }
527
                    //}
528
                }
529
                #endregion
530
                #region 코멘트 숨기기
531
                else if (e.RemovedItems.Count > 0)
532
                {
533
                    var _infoItem = e.RemovedItems.Cast<MarkupInfoItem>().ToList();
534

  
535
                    (from A in _infoItem
536
                     from B in Common.ViewerDataModel.Instance.MarkupControls
537
                     where A.MarkupInfoID == B.MarkupInfoID
538
                     select B).ToList().ForEach(data =>
539
                     {
540
                         Common.ViewerDataModel.Instance.MarkupControls.Remove(data);
541
                     });
542

  
543
                    //var myComment = _infoItem.Where(d => d.MarkupInfoID == App.Custom_ViewInfoId).FirstOrDefault();
544
                    var myComment = _infoItem.Where(d => d.UserID == App.ViewInfo.UserID).FirstOrDefault();
545
                    if (myComment != null)
546
                    {
547
                        ChangeCommentReact();
548
                        Common.ViewerDataModel.Instance.MarkupControls_USER.ToList().ForEach(delegate (MarkupToPDF.Common.CommentUserInfo markupitem)
549
                        {
550
                            if (markupitem.IsNew)
551
                            {
552
                                var root = layerControl.MarkupToString(markupitem, App.ViewInfo.UserID);
553
                                ViewerDataModel.Instance.MarkupList_USER.Add(new MarkupItemEx
554
                                {
555
                                    ID = markupitem.CommentID,
556
                                    Data = root.ConvertData,
557
                                    Data_Type = root.DATA_TYPE,
558
                                    MarkupInfoID = markupitem.MarkupInfoID,
559
                                    PageNumber = this.pageNavigator.CurrentPage.PageNumber,
560
                                });
561
                            }
562
                            Common.ViewerDataModel.Instance.MarkupControls_USER.Remove(markupitem);
563
                        });
564
                    }
565
                }
566
                #endregion
482 567
            }
483 568
        }
484 569

  
KCOM/Views/MainMenu.xaml.cs
4762 4762
                                    currentControl.SetValue(Canvas.ZIndexProperty, 2);
4763 4763
                                    currentControl.SetValue(TextControl.CanvasXProperty, canvasDrawingMouseDownPoint.X);
4764 4764
                                    currentControl.SetValue(TextControl.CanvasYProperty, canvasDrawingMouseDownPoint.Y);
4765
                                    currentControl.Focus();
4766
                                    (currentControl as TextControl).ApplyOverViewData();
4765
                                    
4767 4766
                                    (currentControl as TextControl).ControlType_No = 0;
4768 4767
                                    (currentControl as TextControl).Angle -= rotate.Angle;
4769 4768
                                    (currentControl as TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape;
4769
                                    (currentControl as TextControl).ApplyTemplate();
4770
                                    (currentControl as TextControl).Base_TextBox.Focus();
4770 4771

  
4771 4772
                                    CreateControl();
4772 4773

  
4773
                                    //currentControl = null;
4774 4774
                                }
4775 4775
                            }
4776 4776
                        }
......
4794 4794
                                    currentControl.SetValue(Canvas.ZIndexProperty, 3);
4795 4795
                                    currentControl.SetValue(TextControl.CanvasXProperty, canvasDrawingMouseDownPoint.X);
4796 4796
                                    currentControl.SetValue(TextControl.CanvasYProperty, canvasDrawingMouseDownPoint.Y);
4797
                                    currentControl.Focus();
4797
                                    
4798 4798
                                    (currentControl as TextControl).ControlType_No = 1;
4799 4799
                                    (currentControl as TextControl).Angle = Ang;
4800 4800
                                    (currentControl as TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape;
4801
                                    (currentControl as TextControl).ApplyTemplate();
4802
                                    (currentControl as TextControl).Base_TextBox.Focus();
4801 4803
                                    CreateControl();
4802 4804

  
4803 4805
                                    //currentControl = null;
......
4824 4826

  
4825 4827
                                    currentControl.SetValue(Canvas.ZIndexProperty, 3);
4826 4828
                                    currentControl.SetValue(TextControl.CanvasXProperty, canvasDrawingMouseDownPoint.X);
4827
                                    currentControl.SetValue(TextControl.CanvasYProperty, canvasDrawingMouseDownPoint.Y);
4828
                                    currentControl.Focus();
4829
                                    currentControl.SetValue(TextControl.CanvasYProperty, canvasDrawingMouseDownPoint.Y);                                    
4829 4830

  
4830 4831
                                    (currentControl as TextControl).Angle = Ang;
4831 4832
                                    (currentControl as TextControl).ControlType_No = 2;
4832 4833
                                    (currentControl as TextControl).IsHighLight = ViewerDataModel.Instance.checkHighShape;
4833

  
4834
                                    (currentControl as TextControl).ApplyTemplate();
4835
                                    (currentControl as TextControl).Base_TextBox.Focus();
4834 4836
                                    CreateControl();
4835 4837
                                    //currentControl = null;
4836 4838
                                }
MarkupToPDF/Controls/Parsing/MarkupParse.cs
3185 3185

  
3186 3186
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3187 3187
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3188
                                    instance.DrawingCloud();
3189
                                    instance.SetText();
3188
                                    //instance.DrawingCloud();
3189
                                    //instance.SetText();
3190 3190
                                }
3191 3191
                            }
3192 3192
                            break;
......
3924 3924
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
3925 3925
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3926 3926
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3927
                                    instance.DrawingCloud();
3928
                                    instance.SetText();
3927
                                    //instance.DrawingCloud();
3928
                                    //instance.SetText();
3929 3929
                                }
3930 3930
                            }
3931 3931
                            break;
......
4770 4770
                                if (instance.Text != null)
4771 4771
                                {
4772 4772
                                    //Layer.Children.Add(instance);
4773
                                    instance.CommentID = commentId;
4774 4773
                                    instance.MarkupInfoID = markupInfoID;
4775
                                    baseLayer.Add(instance);
4776
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
4777
                                    instance.ApplyTemplate();
4774
                                    instance.CommentID = commentId;
4778 4775
                                    instance.Memo = s.Memo;
4776
                                    baseLayer.Add(instance);                                    
4777
                                    instance.ApplyTemplate();
4778
                                    
4779 4779
                                    if (s.fontConfig.Count() == 4)
4780 4780
                                    {
4781 4781
                                        instance.UnderLine = TextDecorations.Underline;
......
4788 4788
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
4789 4789
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
4790 4790

  
4791
                                    //instance.DrawingCloud();
4791 4792
                                    
4792
                                    instance.DrawingCloud();
4793
                                    instance.SetText();
4794 4793
                                }
4795 4794
                            }
4796 4795
                            break;
......
6404 6403
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
6405 6404

  
6406 6405
                                    instance.CommentID = commentId;
6407
                                    instance.DrawingCloud();
6408
                                    instance.SetText();
6406
                                    //instance.DrawingCloud();
6407
                                    //instance.SetText();
6409 6408
                                    return_control = instance;
6410 6409
                                }
6411 6410
                            }
MarkupToPDF/Controls/Text/TextControl.cs
59 59

  
60 60
        public TextControl()
61 61
        {
62
            this.DefaultStyleKey = typeof(TextControl);
62
            this.DefaultStyleKey = typeof(TextControl);           
63 63
        }
64 64

  
65 65
        static TextControl()
......
68 68
            ResourceDictionary dictionary = new ResourceDictionary();
69 69
            dictionary.Source = new Uri("/MarkupToPDF;component/Themes/generic.xaml", UriKind.RelativeOrAbsolute);
70 70
            Application.Current.Resources.MergedDictionaries.Add(dictionary);
71
            
71 72
        }
72

  
73
        
74
        
73 75
        public override void OnApplyTemplate()
74 76
        {
75
            base.OnApplyTemplate();
76
            
77
            base.OnApplyTemplate();            
77 78

  
78 79
            Base_TextPath = GetTemplateChild(PART_TextPath) as Path;
79 80
            Base_TextBox = GetTemplateChild(PART_TextBox) as TextBox;
......
81 82
            Base_Grid = GetTemplateChild(PART_Grid) as Grid;
82 83
            Base_Border = GetTemplateChild(PART_Border) as Border;
83 84

  
84

  
85
            //Base_TextPrefixBlock = GetTemplateChild(PART_TextPrefix) as TextBlock;
86

  
87
            //Canvas.SetLeft(this, this.StartPoint.X);
88
            //Canvas.SetTop(this, this.StartPoint.Y);
89

  
90
            //CanvasX = StartPoint.X;
91
            //CanvasY = StartPoint.Y;
92

  
93
            //this.LostFocus += new RoutedEventHandler(TextControl_LostFocus);
94
            //this.GotFocus += new RoutedEventHandler(TextControl_GotFocus);
95 85
            this.Base_TextBox.SizeChanged += new SizeChangedEventHandler(Base_TextBox_SizeChanged);
96
            this.Base_TextBlock.SizeChanged += Base_TextBlock_SizeChanged;
97

  
98
            this.Base_TextBox.LostFocus += Base_TextBox_LostFocus;
99
            //this.MouseDown += TextControl_MouseDown;
100

  
101

  
102

  
86
            this.Base_TextBlock.SizeChanged += new SizeChangedEventHandler(Base_TextBlock_SizeChanged);
87
            this.Base_TextBox.GotFocus += new RoutedEventHandler(TextControl_GotFocus);
88
            this.Base_TextBox.LostFocus += new RoutedEventHandler(TextControl_LostFocus);            
89
                        
90
            DrawingCloud();
103 91
            SetText();
104
            Base_TextBox.Focus();
105

  
106
            this.Focusable = false;
107
            if (!String.IsNullOrEmpty(this.Text))
108
            {
109
                Base_TextBlock.Visibility = Visibility.Visible;
110
                Base_TextBox.Visibility = Visibility.Collapsed;
111
            }
112
        }
113

  
114
        private void Base_TextBox_LostFocus(object sender, EventArgs e)
115
        {
116
            IsEditing = false;
117
            UnEditingMode();
118
            ApplyOverViewData();
119 92
        }
93
               
120 94

  
121 95
        public void ApplyOverViewData()
122 96
        {
......
211 185

  
212 186
        public void EditingMode()
213 187
        {
188
            //this.Base_TextBox.Focus();
214 189
            //System.Diagnostics.Debug.WriteLine(DateTime.Now.ToLongTimeString());
215 190
            TextBoxVisibility = Visibility.Visible;
216 191
            //Base_TextBox.Visibility = System.Windows.Visibility.Visible;
......
288 263
            {
289 264
                Base_TextPath.StrokeThickness = LineSize.Left;
290 265
            }
291

  
292
            OverViewPathData = PathData;
293
            OverViewText = Text;
294 266
        }
295 267

  
296 268
        public void DrawingCloud()
297 269
        {
298 270
            this.ApplyTemplate();
299

  
271
            
300 272
            List<Point> pCloud = new List<Point>
301 273
            {
302 274
                new Point(0, 0),
......
337 309
                }
338 310
            }
339 311

  
340
            SetText();
312
            //SetText();
341 313
        }
342 314
        #endregion Internal Method
343 315

  
......
1136 1108
            if (e.OldValue != e.NewValue && instance.Base_TextBlock != null)
1137 1109
            {
1138 1110
                instance.SetValue(e.Property, e.NewValue);
1139
                instance.SetText();
1111
                //instance.DrawingCloud();
1140 1112
            }
1141 1113
        }
1142 1114

  
......
1146 1118
            if (e.OldValue != e.NewValue && instance.Base_TextBlock != null)
1147 1119
            {
1148 1120
                instance.SetValue(e.Property, e.NewValue);
1149
                instance.SetText();
1121
                //instance.DrawingCloud();
1150 1122
            }
1151 1123
        }
1152 1124

  
......
1156 1128
            if (e.OldValue != e.NewValue && instance!= null)
1157 1129
            {
1158 1130
                instance.SetValue(e.Property, e.NewValue);
1159
                instance.SetText();
1131
                //instance.DrawingCloud();
1160 1132
            }
1161 1133
        }
1162 1134
            

내보내기 Unified diff

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