프로젝트

일반

사용자정보

개정판 873011c4

ID873011c45de2dc9166fab8ef8a85a0fa394a0d84
상위 47048310
하위 37eadd3f

백흠경이(가) 9달 전에 추가함

Fix: Undo/Redo 수정 진행

Change-Id: I3392d0ebc877626804a7c5d139d0b31a1942df7d

차이점 보기:

KCOM/Events/UndoCommand.cs
49 49
        /// <param name="comments"></param>
50 50
        //public void Push(ICollection<CommentUserInfo> comments, double dAngle, double dBeforeAngle = 0.0, List<Point> lstBeforePointSet = null)
51 51
        //{
52
        //    Undo_data UndoData = new Undo_data()
52
        //    UndoData UndoData = new UndoData()
53 53
        //    {
54 54
        //        IsUndo = false,
55
        //        Event = Event_Type.Thumb,
55
        //        Event = EventType.Thumb,
56 56
        //        EventTime = DateTime.Now,
57
        //        Markup_List = new List<Multi_Undo_data>(),
57
        //        MarkupDataColl = new List<Multi_UndoData>(),
58 58
        //    };
59 59

  
60
        //    Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
60
        //    Multi_UndoData multi_UndoData = new Multi_UndoData();
61 61

  
62 62
        //    foreach (var comment in comments)
63 63
        //    {
64
        //        multi_Undo_Data.PointSet = new List<Point>();
64
        //        multi_UndoData.PointSet = new List<Point>();
65 65
        //        var p_set = new List<Point>();
66 66

  
67 67
        //        if (comment is TextControl)
68 68
        //        {
69
        //            multi_Undo_Data.PointSet.Add((comment as TextControl).StartPoint);
70
        //            multi_Undo_Data.PointSet.Add((comment as TextControl).EndPoint);
69
        //            multi_UndoData.PointSet.Add((comment as TextControl).StartPoint);
70
        //            multi_UndoData.PointSet.Add((comment as TextControl).EndPoint);
71 71
        //        }
72 72

  
73 73
        //        foreach (var point in (comment as IPath).PointSet)
74 74
        //        {
75
        //            multi_Undo_Data.PointSet.Add(point);
75
        //            multi_UndoData.PointSet.Add(point);
76 76
        //        }
77 77

  
78 78
        //        if (lstBeforePointSet != null)
79
        //            multi_Undo_Data.BeforePointSet = lstBeforePointSet;
79
        //            multi_UndoData.BeforePointSet = lstBeforePointSet;
80 80

  
81 81
        //        if (comment is ArrowTextControl)
82 82
        //        {
83
        //            //multi_Undo_Data.Angle = dAngle = (comment as ArrowTextControl).CommentAngle;
84
        //            multi_Undo_Data.Angle = dAngle;
85
        //            multi_Undo_Data.BeforeAngle = dBeforeAngle;
83
        //            //multi_UndoData.Angle = dAngle = (comment as ArrowTextControl).CommentAngle;
84
        //            multi_UndoData.Angle = dAngle;
85
        //            multi_UndoData.BeforeAngle = dBeforeAngle;
86 86
        //        }
87 87
        //        else
88 88
        //        {
89
        //            multi_Undo_Data.Angle = dAngle;
90
        //            multi_Undo_Data.BeforeAngle = dBeforeAngle;
89
        //            multi_UndoData.Angle = dAngle;
90
        //            multi_UndoData.BeforeAngle = dBeforeAngle;
91 91
        //        }
92 92

  
93
        //        multi_Undo_Data.Markup = comment;
94
        //        UndoData.Markup_List.Add(multi_Undo_Data);
93
        //        multi_UndoData.Markup = comment;
94
        //        UndoData.MarkupDataColl.Add(multi_UndoData);
95 95
        //        ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate(
96
        //                    MarkupParser.MarkupToString(multi_Undo_Data.Markup, App.ViewInfo.UserID), Event_Type.Thumb, null, null);
96
        //                    MarkupParser.MarkupToString(multi_UndoData.Markup, App.ViewInfo.UserID), EventType.Thumb, null, null);
97 97

  
98
        //        multi_Undo_Data = new Multi_Undo_data();                
98
        //        multi_UndoData = new Multi_UndoData();                
99 99
        //    }
100 100
        //    ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
101 101
        //    {
......
107 107

  
108 108
        public void Push(ICollection<CommentUserInfo> comments)
109 109
        {
110
            Undo_data UndoData = new Undo_data()
110
            UndoDataGroup UndoData = new UndoDataGroup()
111 111
            {
112 112
                IsUndo = false,
113
                Event = Event_Type.Thumb,
113
                Event = EventType.Operation,
114 114
                EventTime = DateTime.Now,
115
                Markup_List = new List<Multi_Undo_data>(),
115
                MarkupDataColl = new List<Multi_UndoData>(),
116 116
            };
117 117

  
118
            Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
119

  
120 118
            foreach (var comment in comments)
121 119
            {
122
                multi_Undo_Data.PointSet = new List<Point>();
120
                Multi_UndoData multi_UndoData = new Multi_UndoData();
121
                multi_UndoData.Markup = comment;
122
                multi_UndoData.Clone = comment.Clone();
123
                /*
124
                multi_UndoData.PointSet = new List<Point>();
123 125
                var p_set = new List<Point>();
124 126

  
125 127
                if (comment is TextControl)
126 128
                {
127
                    multi_Undo_Data.PointSet.Add((comment as TextControl).StartPoint);
128
                    multi_Undo_Data.PointSet.Add((comment as TextControl).EndPoint);
129
                    multi_UndoData.PointSet.Add((comment as TextControl).StartPoint);
130
                    multi_UndoData.PointSet.Add((comment as TextControl).EndPoint);
129 131
                }
130 132

  
131 133
                foreach (var point in (comment as IPath).PointSet)
132 134
                {
133
                    multi_Undo_Data.PointSet.Add(point);
135
                    multi_UndoData.PointSet.Add(point);
134 136
                }
135 137

  
136 138

  
......
139 141
                {
140 142
                    points.Add(point);
141 143
                }
142
                multi_Undo_Data.PointSet = points;
144
                multi_UndoData.PointSet = points;
143 145

  
144 146
                if (comment is ArrowTextControl)
145 147
                {
146
                    //multi_Undo_Data.Angle = dAngle = (comment as ArrowTextControl).CommentAngle;
147
                    multi_Undo_Data.Angle = comment.CommentAngle;
148
                    //multi_UndoData.Angle = dAngle = (comment as ArrowTextControl).CommentAngle;
149
                    multi_UndoData.Angle = comment.CommentAngle;
148 150
                }
149 151
                else
150 152
                {
151
                    multi_Undo_Data.Angle = comment.CommentAngle;
153
                    multi_UndoData.Angle = comment.CommentAngle;
152 154
                }
153 155

  
154
                multi_Undo_Data.Markup = comment;
155
                UndoData.Markup_List.Add(multi_Undo_Data);
156
                multi_UndoData.Markup = comment;
157
                */
158
                UndoData.MarkupDataColl.Add(multi_UndoData);
156 159
                ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate(
157
                            MarkupParser.MarkupToString(multi_Undo_Data.Markup, App.ViewInfo.UserID), Event_Type.Thumb, null, null);
158

  
159
                multi_Undo_Data = new Multi_Undo_data();
160
                            MarkupParser.MarkupToString(multi_UndoData.Markup, App.ViewInfo.UserID), EventType.Operation, null, null);
160 161
            }
161 162
            ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
162 163
            {
......
174 175
            AdornerFinal final;
175 176
            SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu);
176 177

  
177
            Undo_data undo = ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == false).ToList()
178
            UndoDataGroup undo = ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == false).ToList()
178 179
                .OrderByDescending(order => order.EventTime).FirstOrDefault();
179 180
            if (undo == null) return;
180 181

  
181 182
            switch (undo.Event)
182 183
            {
183
                case (Event_Type.Create):
184
                case (EventType.Create):
184 185
                    {
185
                        foreach (var item in undo.Markup_List)
186
                        foreach (var item in undo.MarkupDataColl)
186 187
                        {
187 188
                            ViewerDataModel.Instance.MarkupControls_USER.Remove((item.Markup));
188 189
                            ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate(
189
                            null, Event_Type.Delete, item.Markup.CommentID, null);
190
                            null, EventType.Delete, item.Markup.CommentID, null);
190 191
                        }
191 192
                    }
192 193
                    break;
193
                case (Event_Type.Delete):
194
                case (EventType.Delete):
194 195
                    {
195
                        foreach (var item in undo.Markup_List)
196
                        foreach (var item in undo.MarkupDataColl)
196 197
                        {
197 198
                            //var markupitem = MarkupParser.MarkupToString(item.Markup, App.ViewInfo.UserID);
198 199

  
......
218 219

  
219 220
                            ViewerDataModel.Instance.MarkupControls_USER.Add(item.Markup);
220 221
                            ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate(
221
                            MarkupParser.MarkupToString(item.Markup, App.ViewInfo.UserID), Event_Type.Create, null, null);
222
                            MarkupParser.MarkupToString(item.Markup, App.ViewInfo.UserID), EventType.Create, null, null);
222 223
                        }
223 224
                    }
224 225
                    break;
225
                case (Event_Type.Thumb):
226
                case (EventType.Operation):
226 227
                    {
227 228
                        List<CommentUserInfo> comment = new List<CommentUserInfo>();
228 229

  
229
                        foreach (var item in undo.Markup_List)
230
                        foreach (var item in undo.MarkupDataColl)
230 231
                        {
231 232
                            double dOriAngle = 0.0;
232 233
                            List<Point> lstOriPointSet = new List<Point>();
......
239 240
                                (item.Markup as IViewBox).CommentAngle = item.Angle;
240 241
                                item.Angle = dOriAngle;
241 242
                            }
242
                            if ((item.Markup as TextControl) != null)
243
                            {
244
                                dOriAngle = (item.Markup as TextControl).CommentAngle;
245
                                (item.Markup as TextControl).CommentAngle = item.Angle;
246
                                item.Angle = dOriAngle;
247
                                //(item.Markup as TextControl).CommentAngle = item.BeforeAngle;
248
                                if (item.PointSet.Count > 0)
249
                                {
250
                                    foreach(var point in (item.Markup as IPath).PointSet)
251
                                    {
252
                                        lstOriPointSet.Add(point);
253
                                    }
254
                                    Canvas.SetLeft((item.Markup as TextControl), item.PointSet[0].X);
255
                                    Canvas.SetTop((item.Markup as TextControl), item.PointSet[0].Y);
256
                                    item.PointSet = lstOriPointSet;
257
                                }
258
                            }
259 243
                            else
260 244
                            {
261
                                dOriAngle = (item.Markup).CommentAngle;
262
                                (item.Markup).CommentAngle = item.Angle;
263
                                foreach (var point in (item.Markup as IPath).PointSet)
264
                                {
265
                                    lstOriPointSet.Add(point);
266
                                }
267
                                (item.Markup as IPath).PointSet = item.PointSet;
268
                                item.PointSet = lstOriPointSet;
245
                                ///(item.Markup).CommentAngle = item.Angle;
246
                                ///(item.Markup as IPath).PointSet = item.PointSet;
269 247
                                ///(item.Markup as IPath).PointSet = item.BeforePointSet != null ? item.BeforePointSet : new List<Point>();
248
                                item.Markup.Copy(item.Clone);
270 249
                                (item.Markup as CommentUserInfo).UpdateControl();
271 250
                            }
272 251

  
......
277 256
                        SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu);
278 257
                    }
279 258
                    break;
280
                case (Event_Type.Select):
259
                    /*
260
                case (EventType.Select):
281 261
                    {
282 262
                        List<CommentUserInfo> comment = new List<CommentUserInfo>();
283 263

  
284
                        foreach (var item in undo.Markup_List)
264
                        foreach (var item in undo.MarkupDataColl)
285 265
                        {
286 266
                            ViewerDataModel.Instance.MarkupControls_USER.Remove((item.Markup));
287 267

  
......
309 289
                        Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final);
310 290
                    }
311 291
                    break;
312
                case (Event_Type.Option):
292
                case (EventType.Option):
313 293
                    {
314 294
                        List<CommentUserInfo> comment = new List<CommentUserInfo>();
315 295

  
316
                        foreach (var item in undo.Markup_List)
296
                        foreach (var item in undo.MarkupDataColl)
317 297
                        {
318 298
                            ViewerDataModel.Instance.MarkupControls_USER.Remove(item.Markup);
319 299

  
......
343 323
                        Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final);
344 324
                    }
345 325
                    break;
326
                    */
346 327
            }
347 328
            ViewerDataModel.Instance.UndoDataList.Where(data => data.EventTime == undo.EventTime).ToList()
348 329
                .OrderByDescending(order => order.EventTime).ToList().ForEach(i =>

내보내기 Unified diff

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