개정판 34ac8db7
Fix: Delete에 대한 Undo/Redo 기능 수정
Change-Id: I55592f4822b661ed7f61c714382bd8d988145ef7
KCOM/Events/UndoCommand.cs | ||
---|---|---|
47 | 47 |
/// <author>humkyung</author> |
48 | 48 |
/// <date>2019.06.14, 2024.04.26</date> |
49 | 49 |
/// <param name="comments"></param> |
50 |
public void Push(ICollection<CommentUserInfo> comments) |
|
50 |
public void Push(EventType _EventType, ICollection<CommentUserInfo> comments)
|
|
51 | 51 |
{ |
52 | 52 |
UndoDataGroup UndoData = new UndoDataGroup() |
53 | 53 |
{ |
54 | 54 |
IsUndo = false, |
55 |
Event = EventType.Operation,
|
|
55 |
Event = _EventType,
|
|
56 | 56 |
EventTime = DateTime.Now, |
57 | 57 |
MarkupDataColl = new List<UndoData>(), |
58 | 58 |
}; |
59 | 59 |
|
60 | 60 |
foreach (var comment in comments) |
61 | 61 |
{ |
62 |
UndoData _UndoData = new UndoData(); |
|
63 |
_UndoData.Markup = comment; |
|
62 |
UndoData _UndoData = new UndoData() |
|
63 |
{ |
|
64 |
Markup = comment |
|
65 |
}; |
|
64 | 66 |
_UndoData.Clone = comment.Clone(); |
65 |
|
|
66 | 67 |
UndoData.MarkupDataColl.Add(_UndoData); |
67 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
|
68 |
MarkupParser.MarkupToString(_UndoData.Markup, App.ViewInfo.UserID), EventType.Operation, null, null); |
|
68 |
|
|
69 |
if (_EventType == EventType.Delete) |
|
70 |
{ |
|
71 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(comment); |
|
72 |
ViewerDataModel.Instance.MarkupControls.Remove(comment); |
|
73 |
|
|
74 |
var Item_ = ViewerDataModel.Instance.MyMarkupList.Find(d => d.ID == comment.CommentID); |
|
75 |
ViewerDataModel.Instance.MyMarkupList.Remove(Item_); |
|
76 |
|
|
77 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
|
78 |
null, EventType.Delete, MarkupParser.MarkupToString(_UndoData.Markup, App.ViewInfo.UserID).CommentID, null); |
|
79 |
} |
|
80 |
else |
|
81 |
{ |
|
82 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
|
83 |
MarkupParser.MarkupToString(_UndoData.Markup, App.ViewInfo.UserID), EventType.Operation, null, null); |
|
84 |
} |
|
69 | 85 |
} |
70 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
|
86 |
|
|
87 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo).ToList().ForEach(i => |
|
71 | 88 |
{ |
72 | 89 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
73 | 90 |
}); |
74 |
|
|
75 | 91 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
76 | 92 |
} |
77 | 93 |
|
... | ... | |
83 | 99 |
AdornerFinal final; |
84 | 100 |
SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu); |
85 | 101 |
|
86 |
UndoDataGroup undo = ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == false).ToList()
|
|
102 |
UndoDataGroup undo = ViewerDataModel.Instance.UndoDataList.Where(data => !data.IsUndo).ToList()
|
|
87 | 103 |
.OrderByDescending(order => order.EventTime).FirstOrDefault(); |
88 | 104 |
if (undo == null) return; |
89 | 105 |
|
... | ... | |
94 | 110 |
foreach (var item in undo.MarkupDataColl) |
95 | 111 |
{ |
96 | 112 |
ViewerDataModel.Instance.MarkupControls_USER.Remove((item.Markup)); |
113 |
|
|
97 | 114 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
98 | 115 |
null, EventType.Delete, item.Markup.CommentID, null); |
99 | 116 |
} |
... | ... | |
101 | 118 |
break; |
102 | 119 |
case (EventType.Delete): |
103 | 120 |
{ |
121 |
List<CommentUserInfo> comment = new List<CommentUserInfo>(); |
|
104 | 122 |
foreach (var item in undo.MarkupDataColl) |
105 | 123 |
{ |
106 |
//var markupitem = MarkupParser.MarkupToString(item.Markup, App.ViewInfo.UserID); |
|
107 |
|
|
108 |
//if (markupitem != null) |
|
109 |
//{ |
|
110 |
// IKCOM.MarkupItemEx markup = new IKCOM.MarkupItemEx |
|
111 |
// { |
|
112 |
// Data = markupitem.ConvertData, |
|
113 |
// Data_Type = markupitem.DATA_TYPE, |
|
114 |
// ID = markupitem.CommentID, |
|
115 |
// IsUpdate = false, |
|
116 |
// MarkupInfoID = App.Custom_ViewInfoId, |
|
117 |
// PageNumber = ViewerDataModel.Instance.PageNumber, |
|
118 |
// //Symbol_ID = p.Symbol_ID, |
|
119 |
// //Group_ID = p.Group_ID |
|
120 |
// }; |
|
121 |
|
|
122 |
// ViewerDataModel.Instance.MyMarkupList.Add(markup); |
|
123 |
//} |
|
124 |
|
|
125 |
//ViewerDataModel.Instance.MarkupControls.Add(item.Markup); |
|
124 |
ViewerDataModel.Instance.MarkupControls_USER.Add(item.Markup); |
|
126 | 125 |
item.Markup.Load(); |
126 |
item.Markup.UpdateControl(); |
|
127 |
comment.Add(item.Markup); |
|
127 | 128 |
|
128 |
ViewerDataModel.Instance.MarkupControls_USER.Add(item.Markup); |
|
129 |
ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
|
130 |
MarkupParser.MarkupToString(item.Markup, App.ViewInfo.UserID), EventType.Create, null, null); |
|
129 |
///ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
|
130 |
///MarkupParser.MarkupToString(item.Markup, App.ViewInfo.UserID), EventType.Create, null, null); |
|
131 | 131 |
} |
132 |
|
|
133 |
final = new AdornerFinal(comment); |
|
134 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
|
132 | 135 |
} |
133 | 136 |
break; |
134 | 137 |
case (EventType.Operation): |
... | ... | |
148 | 151 |
} |
149 | 152 |
final = new AdornerFinal(comment); |
150 | 153 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
151 |
SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu); |
|
152 |
} |
|
153 |
break; |
|
154 |
/* |
|
155 |
case (EventType.Select): |
|
156 |
{ |
|
157 |
List<CommentUserInfo> comment = new List<CommentUserInfo>(); |
|
158 |
|
|
159 |
foreach (var item in undo.MarkupDataColl) |
|
160 |
{ |
|
161 |
ViewerDataModel.Instance.MarkupControls_USER.Remove((item.Markup)); |
|
162 |
|
|
163 |
if ((item.Markup as IPath) != null) |
|
164 |
{ |
|
165 |
(item.Markup as IPath).LineSize = item.LineSize; |
|
166 |
} |
|
167 |
if ((item.Markup as UIElement) != null) |
|
168 |
{ |
|
169 |
(item.Markup as UIElement).Opacity = item.Opacity; |
|
170 |
} |
|
171 |
if ((item.Markup as IDashControl) != null) |
|
172 |
{ |
|
173 |
(item.Markup as IDashControl).DashSize = item.DashSize; |
|
174 |
} |
|
175 |
if ((item.Markup as IShapeControl) != null) |
|
176 |
{ |
|
177 |
(item.Markup as IShapeControl).Paint = item.paint; |
|
178 |
} |
|
179 |
|
|
180 |
comment.Add(item.Markup); |
|
181 |
} |
|
182 |
|
|
183 |
final = new AdornerFinal(comment); |
|
184 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
|
154 |
///SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu); |
|
185 | 155 |
} |
186 | 156 |
break; |
187 |
*/ |
|
188 | 157 |
} |
158 |
|
|
189 | 159 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.EventTime == undo.EventTime).ToList() |
190 | 160 |
.OrderByDescending(order => order.EventTime).ToList().ForEach(i => |
191 | 161 |
{ |
내보내기 Unified diff