markus / KCOM / Events / PasteCommand.cs @ 8118ba81
이력 | 보기 | 이력해설 | 다운로드 (20.9 KB)
1 | b37ef4b3 | humkyung | using KCOM.Common; |
---|---|---|---|
2 | using KCOM.Controls; |
||
3 | using KCOM.Views; |
||
4 | using MarkupToPDF.Common; |
||
5 | using MarkupToPDF.Controls.Parsing; |
||
6 | using Newtonsoft.Json; |
||
7 | using Newtonsoft.Json.Converters; |
||
8 | using Newtonsoft.Json.Linq; |
||
9 | using Newtonsoft.Json.Serialization; |
||
10 | using System; |
||
11 | using System.Collections; |
||
12 | using System.Collections.Generic; |
||
13 | using System.ComponentModel; |
||
14 | using System.Data; |
||
15 | using System.IO; |
||
16 | using System.Linq; |
||
17 | using System.Reflection; |
||
18 | using System.Runtime.Serialization.Formatters; |
||
19 | using System.Runtime.Serialization.Formatters.Binary; |
||
20 | using System.Runtime.Serialization.Json; |
||
21 | using System.Text; |
||
22 | using System.Windows; |
||
23 | using System.Windows.Media; |
||
24 | using System.Windows.Media.Imaging; |
||
25 | using System.Xml; |
||
26 | using System.Xml.Serialization; |
||
27 | |||
28 | namespace KCOM |
||
29 | { |
||
30 | public class PasteCommand |
||
31 | { |
||
32 | private static readonly PasteCommand _instance = new PasteCommand(); |
||
33 | |||
34 | // Explicit static constructor to tell C# compiler |
||
35 | // not to mark type as beforefieldinit |
||
36 | static PasteCommand() |
||
37 | { |
||
38 | } |
||
39 | |||
40 | private PasteCommand() |
||
41 | { |
||
42 | } |
||
43 | |||
44 | public static PasteCommand Instance |
||
45 | { |
||
46 | get |
||
47 | { |
||
48 | return _instance; |
||
49 | } |
||
50 | } |
||
51 | /// <summary> |
||
52 | /// paste controls |
||
53 | /// </summary> |
||
54 | /// <author>humkyung</author> |
||
55 | /// <date>2019.06.18</date> |
||
56 | /// <param name="comments"></param> |
||
57 | ac4f1e13 | taeseongkim | public async void Execute() |
58 | b37ef4b3 | humkyung | { |
59 | 5b48dae7 | taeseongkim | var markupData = Clipboard.GetData(DataFormats.StringFormat); |
60 | |||
61 | if (markupData?.ToString().Contains("|OR||DZ|") == true) |
||
62 | b37ef4b3 | humkyung | { |
63 | 26ec6226 | taeseongkim | string[] delimiterChars = { "|OR|" }; |
64 | string[] delimiterChars2 = { "|OR|", "|SymbolID|" }; |
||
65 | 5b48dae7 | taeseongkim | string[] data = markupData.ToString().Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries); |
66 | 26ec6226 | taeseongkim | |
67 | if (data.Count() > 0) |
||
68 | { |
||
69 | List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>(); |
||
70 | |||
71 | b79d6e7f | humkyung | UndoData multi_UndoData = new UndoData(); |
72 | 26ec6226 | taeseongkim | |
73 | //강인구 Undo/Redo 보류 |
||
74 | 873011c4 | humkyung | MarkupToPDF.Common.UndoDataGroup UndoData = new UndoDataGroup() |
75 | 26ec6226 | taeseongkim | { |
76 | IsUndo = false, |
||
77 | 873011c4 | humkyung | Event = EventType.Create, |
78 | 26ec6226 | taeseongkim | EventTime = DateTime.Now, |
79 | b79d6e7f | humkyung | MarkupDataColl = new List<UndoData>() |
80 | 26ec6226 | taeseongkim | }; |
81 | |||
82 | foreach (string parse in data) |
||
83 | { |
||
84 | if (parse != "") |
||
85 | { |
||
86 | string[] data2 = new string[2]; |
||
87 | data2 = parse.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
||
88 | |||
89 | 58dd9e89 | humkyung | System.Windows.Controls.Control item = await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, data2[0], ViewerDataModel.Instance.MarkupControls_USER, ViewerDataModel.Instance.PageAngle, "#FFFF0000", string.Empty, |
90 | STAMP_Contents: App.SystemInfo.STAMP_CONTENTS); |
||
91 | 26ec6226 | taeseongkim | |
92 | var control = (item as MarkupToPDF.Common.CommentUserInfo); |
||
93 | |||
94 | 5a223b60 | humkyung | control.CommentID = Commons.ShortGuid(); |
95 | 26ec6226 | taeseongkim | control.MarkupInfoID = App.Custom_ViewInfoId; |
96 | control.IsNew = true; |
||
97 | |||
98 | if (data2.Length >= 2) |
||
99 | { |
||
100 | control.SymbolID = data2[1]; |
||
101 | } |
||
102 | |||
103 | //CreateCommand.Instance.Execute(control); |
||
104 | adornerSet.Add(control); |
||
105 | 873011c4 | humkyung | multi_UndoData = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(control); |
106 | UndoData.MarkupDataColl.Add(multi_UndoData); |
||
107 | 26ec6226 | taeseongkim | ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
108 | |||
109 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.UpdateMyMarkupList(); |
||
110 | //ViewerDataModel.Instance.MarkupControls_USER.Remove(control); |
||
111 | |||
112 | ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
||
113 | 873011c4 | humkyung | MarkupParser.MarkupToString(multi_UndoData.Markup, App.ViewInfo.UserID), EventType.Create, null, null); |
114 | 26ec6226 | taeseongkim | } |
115 | } |
||
116 | |||
117 | Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet); |
||
118 | |||
119 | /// place controls at current mouse position |
||
120 | var diff = Point.Subtract(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, final.Centeroid); |
||
121 | final.TranslateItems(diff.X, diff.Y); |
||
122 | |||
123 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
||
124 | } |
||
125 | } |
||
126 | /// 외부 이미지 붙여넣기 |
||
127 | else if (Clipboard.GetImage() != null) |
||
128 | { |
||
129 | try |
||
130 | { |
||
131 | b79d6e7f | humkyung | UndoData multi_UndoData = new UndoData(); |
132 | 26ec6226 | taeseongkim | |
133 | 873011c4 | humkyung | MarkupToPDF.Common.UndoDataGroup UndoData = new UndoDataGroup() |
134 | 26ec6226 | taeseongkim | { |
135 | IsUndo = false, |
||
136 | 873011c4 | humkyung | Event = EventType.Create, |
137 | 26ec6226 | taeseongkim | EventTime = DateTime.Now, |
138 | b79d6e7f | humkyung | MarkupDataColl = new List<UndoData>() |
139 | 26ec6226 | taeseongkim | }; |
140 | |||
141 | string temppath = System.IO.Path.GetTempPath(); |
||
142 | 5a223b60 | humkyung | string filename = Commons.ShortFileKey(); |
143 | 26ec6226 | taeseongkim | |
144 | System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage(); |
||
145 | clipboardImage.Save(Path.Combine(temppath, filename)); |
||
146 | |||
147 | /// upload image file to server |
||
148 | System.IO.FileInfo fileInfo = new System.IO.FileInfo(Path.Combine(temppath, filename)); |
||
149 | String strFile = System.IO.Path.GetFileName(fileInfo.FullName); |
||
150 | long numByte = fileInfo.Length; |
||
151 | double dLen = Convert.ToDouble(fileInfo.Length / 1000000); |
||
152 | kr.co.devdoftech.cloud.FileUpload fileUploader = App.FileUploader; |
||
153 | if (dLen < 4) |
||
154 | { |
||
155 | System.IO.FileStream fStream = new System.IO.FileStream(fileInfo.FullName, |
||
156 | System.IO.FileMode.Open, System.IO.FileAccess.Read, FileShare.Read); |
||
157 | System.IO.BinaryReader br = new System.IO.BinaryReader(fStream); |
||
158 | byte[] data = br.ReadBytes((int)numByte); |
||
159 | |||
160 | filename = fileUploader.Run(App.ViewInfo.ProjectNO, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile + ".png", data); |
||
161 | Check_Uri.UriCheck(filename); |
||
162 | |||
163 | br.Close(); |
||
164 | fStream.Close(); |
||
165 | fStream.Dispose(); |
||
166 | } |
||
167 | else |
||
168 | { |
||
169 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert"); |
||
170 | return; |
||
171 | } |
||
172 | |||
173 | fileInfo.Delete(); |
||
174 | |||
175 | System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(clipboardImage); |
||
176 | IntPtr hBitmap = bmp.GetHbitmap(); |
||
177 | System.Windows.Media.ImageSource WpfBitmap = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions()); |
||
178 | System.Windows.Controls.Image img = new System.Windows.Controls.Image(); |
||
179 | if (filename.Contains(".svg")) |
||
180 | { |
||
181 | SharpVectors.Converters.SvgImageExtension svgImage = new SharpVectors.Converters.SvgImageExtension(filename); |
||
182 | img.Source = (DrawingImage)svgImage.ProvideValue(null); |
||
183 | } |
||
184 | else |
||
185 | { |
||
186 | img.Source = new BitmapImage(new Uri(filename)); |
||
187 | } |
||
188 | |||
189 | |||
190 | var vecSize = new Vector(clipboardImage.Width, clipboardImage.Height); |
||
191 | var EndPoint = Point.Add(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, vecSize); |
||
192 | var currentControl = new MarkupToPDF.Controls.Etc.ImgControl |
||
193 | { |
||
194 | PointSet = new List<Point>(), |
||
195 | FilePath = filename, |
||
196 | ImageData = img.Source, |
||
197 | StartPoint = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, |
||
198 | EndPoint = Point.Add(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, vecSize), |
||
199 | TopRightPoint = new Point(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.X + vecSize.X, |
||
200 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.Y), |
||
201 | LeftBottomPoint = new Point(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.X, |
||
202 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.Y + vecSize.Y) |
||
203 | }; |
||
204 | |||
205 | currentControl.PointSet = new List<Point> |
||
206 | { |
||
207 | currentControl.StartPoint, |
||
208 | currentControl.LeftBottomPoint, |
||
209 | currentControl.EndPoint, |
||
210 | currentControl.TopRightPoint, |
||
211 | }; |
||
212 | |||
213 | 873011c4 | humkyung | multi_UndoData = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
214 | UndoData.MarkupDataColl.Add(multi_UndoData); |
||
215 | 26ec6226 | taeseongkim | ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
216 | |||
217 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
218 | 5a223b60 | humkyung | currentControl.CommentID = Commons.ShortGuid(); |
219 | 26ec6226 | taeseongkim | |
220 | currentControl.ApplyTemplate(); |
||
221 | currentControl.SetImage(); |
||
222 | |||
223 | ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
224 | Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
225 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
||
226 | |||
227 | ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
||
228 | 873011c4 | humkyung | MarkupParser.MarkupToString(multi_UndoData.Markup, App.ViewInfo.UserID), EventType.Create, null, null); |
229 | 26ec6226 | taeseongkim | } |
230 | catch (Exception ex) |
||
231 | { |
||
232 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.DialogMessage_Alert("" + ex, "Alert"); |
||
233 | } |
||
234 | } |
||
235 | } |
||
236 | /// <summary> |
||
237 | /// paste controls |
||
238 | /// </summary> |
||
239 | /// <author>humkyung</author> |
||
240 | /// <date>2019.06.18</date> |
||
241 | /// <param name="comments"></param> |
||
242 | public async void Execute2() |
||
243 | { |
||
244 | if (Clipboard.GetText().Contains("|OR||DZ|")) |
||
245 | { |
||
246 | b37ef4b3 | humkyung | List<MarkupToPDF.Common.CommentUserInfo> adornerSet = new List<MarkupToPDF.Common.CommentUserInfo>(); |
247 | |||
248 | SelectionSet.Instance.UnSelect(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu); |
||
249 | |||
250 | b79d6e7f | humkyung | UndoData multi_UndoData = new UndoData(); |
251 | b37ef4b3 | humkyung | |
252 | //강인구 Undo/Redo 보류 |
||
253 | 873011c4 | humkyung | MarkupToPDF.Common.UndoDataGroup UndoData = new UndoDataGroup() |
254 | b37ef4b3 | humkyung | { |
255 | IsUndo = false, |
||
256 | 873011c4 | humkyung | Event = EventType.Create, |
257 | b37ef4b3 | humkyung | EventTime = DateTime.Now, |
258 | b79d6e7f | humkyung | MarkupDataColl = new List<UndoData>() |
259 | b37ef4b3 | humkyung | }; |
260 | |||
261 | ViewerDataModel.Instance.UndoDataList.Where(data1 => data1.IsUndo == true).ToList().ForEach(i => |
||
262 | { |
||
263 | ViewerDataModel.Instance.UndoDataList.Remove(i); |
||
264 | }); |
||
265 | |||
266 | string[] delimiterChars = { "|OR|" }; |
||
267 | string[] delimiterChars2 = { "|OR|", "|SymbolID|" }; |
||
268 | string[] data = Clipboard.GetText().Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries); |
||
269 | foreach (string parse in data) |
||
270 | { |
||
271 | if (parse != "") |
||
272 | { |
||
273 | string[] data2 = new string[2]; |
||
274 | data2 = parse.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
||
275 | |||
276 | 58dd9e89 | humkyung | System.Windows.Controls.Control item = await MarkupParser.ParseExAsync(App.BaseAddress, ViewerDataModel.Instance.NewMarkupCancelToken(), App.ViewInfo.ProjectNO, data2[0], ViewerDataModel.Instance.MarkupControls_USER, ViewerDataModel.Instance.PageAngle, "#FFFF0000", string.Empty, |
277 | STAMP_Contents: App.SystemInfo.STAMP_CONTENTS); |
||
278 | 5a223b60 | humkyung | (item as MarkupToPDF.Common.CommentUserInfo).CommentID = Commons.ShortGuid(); |
279 | b37ef4b3 | humkyung | if (data2.Length >= 2) |
280 | { |
||
281 | (item as MarkupToPDF.Common.CommentUserInfo).SymbolID = data2[1]; |
||
282 | } |
||
283 | 26ec6226 | taeseongkim | |
284 | b37ef4b3 | humkyung | ViewerDataModel.Instance.MarkupControls.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
285 | ViewerDataModel.Instance.MarkupControls_USER.Remove(item as MarkupToPDF.Common.CommentUserInfo); |
||
286 | |||
287 | adornerSet.Add(item as MarkupToPDF.Common.CommentUserInfo); |
||
288 | |||
289 | 873011c4 | humkyung | multi_UndoData = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(item as MarkupToPDF.Common.CommentUserInfo); |
290 | b37ef4b3 | humkyung | |
291 | 873011c4 | humkyung | UndoData.MarkupDataColl.Add(multi_UndoData); |
292 | b37ef4b3 | humkyung | ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
293 | 4eb052e4 | ljiyeon | |
294 | 39f0624f | ljiyeon | ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
295 | 873011c4 | humkyung | MarkupParser.MarkupToString(multi_UndoData.Markup, App.ViewInfo.UserID), EventType.Create, null, null); |
296 | 26ec6226 | taeseongkim | |
297 | (item as MarkupToPDF.Common.CommentUserInfo).ApplyOverViewData(); |
||
298 | b37ef4b3 | humkyung | } |
299 | } |
||
300 | Controls.AdornerFinal final = new Controls.AdornerFinal(adornerSet); |
||
301 | |||
302 | 025ebf74 | humkyung | /// place controls at current mouse position |
303 | var diff = Point.Subtract(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, final.Centeroid); |
||
304 | final.TranslateItems(diff.X, diff.Y); |
||
305 | |||
306 | b37ef4b3 | humkyung | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
307 | 105359ce | ljiyeon | |
308 | b37ef4b3 | humkyung | } |
309 | /// 외부 이미지 붙여넣기 |
||
310 | else if (Clipboard.GetImage() != null) |
||
311 | { |
||
312 | try |
||
313 | { |
||
314 | b79d6e7f | humkyung | UndoData multi_UndoData = new UndoData(); |
315 | b37ef4b3 | humkyung | |
316 | 873011c4 | humkyung | MarkupToPDF.Common.UndoDataGroup UndoData = new UndoDataGroup() |
317 | b37ef4b3 | humkyung | { |
318 | IsUndo = false, |
||
319 | 873011c4 | humkyung | Event = EventType.Create, |
320 | b37ef4b3 | humkyung | EventTime = DateTime.Now, |
321 | b79d6e7f | humkyung | MarkupDataColl = new List<UndoData>() |
322 | b37ef4b3 | humkyung | }; |
323 | |||
324 | string temppath = System.IO.Path.GetTempPath(); |
||
325 | 5a223b60 | humkyung | string filename = Commons.ShortFileKey(); |
326 | b37ef4b3 | humkyung | |
327 | System.Drawing.Image clipboardImage = System.Windows.Forms.Clipboard.GetImage(); |
||
328 | clipboardImage.Save(Path.Combine(temppath , filename)); |
||
329 | |||
330 | /// upload image file to server |
||
331 | System.IO.FileInfo fileInfo = new System.IO.FileInfo(Path.Combine(temppath , filename)); |
||
332 | String strFile = System.IO.Path.GetFileName(fileInfo.FullName); |
||
333 | long numByte = fileInfo.Length; |
||
334 | double dLen = Convert.ToDouble(fileInfo.Length / 1000000); |
||
335 | 76dc223b | taeseongkim | kr.co.devdoftech.cloud.FileUpload fileUploader = App.FileUploader; |
336 | b37ef4b3 | humkyung | if (dLen < 4) |
337 | { |
||
338 | System.IO.FileStream fStream = new System.IO.FileStream(fileInfo.FullName, |
||
339 | 43e1d368 | taeseongkim | System.IO.FileMode.Open, System.IO.FileAccess.Read,FileShare.Read); |
340 | b37ef4b3 | humkyung | System.IO.BinaryReader br = new System.IO.BinaryReader(fStream); |
341 | byte[] data = br.ReadBytes((int)numByte); |
||
342 | |||
343 | filename = fileUploader.Run(App.ViewInfo.ProjectNO, Common.ViewerDataModel.Instance.SystemMain.dzMainMenu._DocItem.DOCUMENT_NO, App.ViewInfo.UserID, strFile + ".png", data); |
||
344 | Check_Uri.UriCheck(filename); |
||
345 | |||
346 | br.Close(); |
||
347 | fStream.Close(); |
||
348 | fStream.Dispose(); |
||
349 | } |
||
350 | else |
||
351 | { |
||
352 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.DialogMessage_Alert("Available Memory less than 4 mega byte", "Alert"); |
||
353 | return; |
||
354 | } |
||
355 | |||
356 | fileInfo.Delete(); |
||
357 | |||
358 | System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(clipboardImage); |
||
359 | IntPtr hBitmap = bmp.GetHbitmap(); |
||
360 | System.Windows.Media.ImageSource WpfBitmap = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions()); |
||
361 | System.Windows.Controls.Image img = new System.Windows.Controls.Image(); |
||
362 | if (filename.Contains(".svg")) |
||
363 | { |
||
364 | f1f822e9 | taeseongkim | SharpVectors.Converters.SvgImageExtension svgImage = new SharpVectors.Converters.SvgImageExtension(filename); |
365 | img.Source = (DrawingImage)svgImage.ProvideValue(null); |
||
366 | b37ef4b3 | humkyung | } |
367 | else |
||
368 | { |
||
369 | img.Source = new BitmapImage(new Uri(filename)); |
||
370 | } |
||
371 | 2184f659 | humkyung | |
372 | |||
373 | var vecSize = new Vector(clipboardImage.Width, clipboardImage.Height); |
||
374 | var EndPoint = Point.Add(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, vecSize); |
||
375 | b37ef4b3 | humkyung | var currentControl = new MarkupToPDF.Controls.Etc.ImgControl |
376 | { |
||
377 | PointSet = new List<Point>(), |
||
378 | FilePath = filename, |
||
379 | ImageData = img.Source, |
||
380 | 2184f659 | humkyung | StartPoint = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, |
381 | EndPoint = Point.Add(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint, vecSize), |
||
382 | TopRightPoint = new Point(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.X + vecSize.X, |
||
383 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.Y), |
||
384 | LeftBottomPoint = new Point(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.X, |
||
385 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.getCurrentPoint.Y + vecSize.Y) |
||
386 | b37ef4b3 | humkyung | }; |
387 | |||
388 | currentControl.PointSet = new List<Point> |
||
389 | 2184f659 | humkyung | { |
390 | currentControl.StartPoint, |
||
391 | currentControl.LeftBottomPoint, |
||
392 | currentControl.EndPoint, |
||
393 | currentControl.TopRightPoint, |
||
394 | }; |
||
395 | b37ef4b3 | humkyung | |
396 | 873011c4 | humkyung | multi_UndoData = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(currentControl as MarkupToPDF.Common.CommentUserInfo); |
397 | UndoData.MarkupDataColl.Add(multi_UndoData); |
||
398 | b37ef4b3 | humkyung | ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
399 | |||
400 | ViewerDataModel.Instance.MarkupControls_USER.Add(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
401 | 5a223b60 | humkyung | currentControl.CommentID = Commons.ShortGuid(); |
402 | b37ef4b3 | humkyung | |
403 | currentControl.ApplyTemplate(); |
||
404 | currentControl.SetImage(); |
||
405 | |||
406 | ViewerDataModel.Instance.MarkupControls_USER.Remove(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
407 | Controls.AdornerFinal final = new Controls.AdornerFinal(currentControl as MarkupToPDF.Common.CommentUserInfo); |
||
408 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.SelectLayer.Children.Add(final); |
||
409 | 4eb052e4 | ljiyeon | |
410 | 39f0624f | ljiyeon | ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate( |
411 | 873011c4 | humkyung | MarkupParser.MarkupToString(multi_UndoData.Markup, App.ViewInfo.UserID), EventType.Create, null, null); |
412 | b37ef4b3 | humkyung | } |
413 | catch (Exception ex) |
||
414 | { |
||
415 | Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.DialogMessage_Alert("" + ex, "Alert"); |
||
416 | } |
||
417 | } |
||
418 | } |
||
419 | } |
||
420 | } |