markus / MarkupToPDF / Controls / Parsing / MarkupCopy.cs @ b200de5a
이력 | 보기 | 이력해설 | 다운로드 (93.2 KB)
1 | 787a4489 | KangIngu | using System; |
---|---|---|---|
2 | using System.Net; |
||
3 | using System.Windows; |
||
4 | using System.Windows.Controls; |
||
5 | using System.Windows.Documents; |
||
6 | using System.Windows.Ink; |
||
7 | using System.Windows.Input; |
||
8 | using System.Windows.Media; |
||
9 | using System.Windows.Media.Animation; |
||
10 | using System.Windows.Shapes; |
||
11 | using MarkupToPDF.Controls; |
||
12 | using MarkupToPDF.Controls.Line; |
||
13 | using MarkupToPDF.Controls.Shape; |
||
14 | using MarkupToPDF.Controls.Polygon; |
||
15 | using MarkupToPDF.Controls.Text; |
||
16 | using MarkupToPDF.Controls.Etc; |
||
17 | using MarkupToPDF.Controls.Common.ValueConverter; |
||
18 | using MarkupToPDF.Serialize.S_Control; |
||
19 | using MarkupToPDF.Serialize.Core; |
||
20 | using System.Collections.Generic; |
||
21 | using System.Collections.ObjectModel; |
||
22 | using System.Text; |
||
23 | using MarkupToPDF.Controls.Common; |
||
24 | using MarkupToPDF.Common; |
||
25 | |||
26 | namespace MarkupToPDF.Controls.Parsing |
||
27 | { |
||
28 | //public partial class LayerControl : Control |
||
29 | //{ |
||
30 | //public class MarkupReturn |
||
31 | //{ |
||
32 | // public string ConvertData { get; set; } |
||
33 | // public int DATA_TYPE { get; set; } |
||
34 | //} |
||
35 | |||
36 | //public string MarkupToString(ObservableCollection<CommentUserInfo> baseLayer, string UserId) |
||
37 | //{ |
||
38 | |||
39 | // String ConvertData = ""; |
||
40 | |||
41 | // #region ######### 마크업 파싱########## |
||
42 | // foreach (UIElement item in baseLayer) |
||
43 | // { |
||
44 | // switch (item.GetType().Name.ToString()) |
||
45 | // { |
||
46 | // #region Arrow_Multi |
||
47 | // case "ArrowControl_Multi": |
||
48 | // using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi()) |
||
49 | // { |
||
50 | // var instance = item as ArrowControl_Multi; |
||
51 | // STemp.TransformPoint = "0|0"; |
||
52 | // STemp.PointSet = instance.PointSet; |
||
53 | // STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
54 | // STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
55 | // STemp.StartPoint = instance.StartPoint; |
||
56 | // STemp.EndPoint = instance.EndPoint; |
||
57 | // STemp.UserID = UserId; |
||
58 | // STemp.Opac = instance.Opacity; |
||
59 | // STemp.DashSize = instance.DashSize; |
||
60 | // STemp.MidPoint = instance.MiddlePoint; |
||
61 | // STemp.Name = instance.GetType().Name.ToString(); |
||
62 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
63 | // }; |
||
64 | // break; |
||
65 | // #endregion |
||
66 | // #region ArrowText |
||
67 | // case "ArrowTextControl": |
||
68 | // using (S_ArrowTextControl STemp = new S_ArrowTextControl()) |
||
69 | // { |
||
70 | // var instance = item as ArrowTextControl; |
||
71 | // STemp.TransformPoint = "0|0"; |
||
72 | // STemp.PointSet = instance.PointSet; |
||
73 | // STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
74 | // STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
75 | // STemp.StartPoint = instance.StartPoint; |
||
76 | // STemp.ArrowStyle = instance.ArrowTextStyle; |
||
77 | // STemp.UserID = UserId; |
||
78 | // STemp.ArrowText = instance.Base_TextBox.Text; |
||
79 | // STemp.BorderSize = instance.BorderSize; |
||
80 | // STemp.isHighLight = instance.isHighLight; |
||
81 | // STemp.BoxHeight = instance.BoxHeight; |
||
82 | // STemp.BoxWidth = instance.BoxWidth; |
||
83 | // STemp.Opac = instance.Opacity; |
||
84 | // STemp.EndPoint = instance.EndPoint; |
||
85 | // STemp.isFixed = instance.isFixed; |
||
86 | // //STemp.DashSize = instance.DashSize; |
||
87 | // STemp.Name = instance.GetType().Name.ToString(); |
||
88 | // STemp.isTrans = instance.isTrans; |
||
89 | // STemp.MidPoint = instance.MidPoint; |
||
90 | // STemp.Angle = instance.Angle; |
||
91 | // STemp.fontConfig = new List<string>() |
||
92 | // { |
||
93 | // instance.TextFamily.ToString(), |
||
94 | // instance.TextStyle.ToString(), |
||
95 | // instance.TextWeight.ToString(), |
||
96 | // instance.TextSize.ToString(), |
||
97 | // }; |
||
98 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
99 | // }; |
||
100 | // break; |
||
101 | // #endregion |
||
102 | // #region Line |
||
103 | // case "LineControl": |
||
104 | // using (S_LineControl STemp = new S_LineControl()) |
||
105 | // { |
||
106 | // var instance = item as LineControl; |
||
107 | // STemp.TransformPoint = "0|0"; |
||
108 | // STemp.PointSet = instance.PointSet; |
||
109 | // STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
110 | // STemp.LineStyleSet = instance.LineStyleSet; |
||
111 | // STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
112 | // STemp.StartPoint = instance.StartPoint; |
||
113 | // STemp.EndPoint = instance.EndPoint; |
||
114 | // STemp.UserID = UserId; |
||
115 | // STemp.Opac = instance.Opacity; |
||
116 | // STemp.DashSize = instance.DashSize; |
||
117 | // STemp.Interval = instance.Interval; |
||
118 | // STemp.DimSize = instance.DimSize; |
||
119 | // STemp.Name = instance.GetType().Name.ToString(); |
||
120 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
121 | // }; |
||
122 | // break; |
||
123 | // #endregion |
||
124 | // #region Arc |
||
125 | // case "ArcControl": |
||
126 | // using (S_ArcControl STemp = new S_ArcControl()) |
||
127 | // { |
||
128 | // var instance = item as ArcControl; |
||
129 | // STemp.TransformPoint = "0|0"; |
||
130 | // STemp.PointSet = instance.PointSet; |
||
131 | // STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
132 | // STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
133 | // STemp.StartPoint = instance.StartPoint; |
||
134 | // STemp.UserID = UserId; |
||
135 | // STemp.Opac = instance.Opacity; |
||
136 | // STemp.MidPoint = instance.MidPoint; |
||
137 | // STemp.EndPoint = instance.EndPoint; |
||
138 | // STemp.IsTransOn = instance.isTransOn; |
||
139 | // STemp.DashSize = instance.DashSize; |
||
140 | // STemp.Clock = instance.Clock; |
||
141 | // //STemp.ArcStyleSet = instance.ControlType; |
||
142 | // STemp.Name = instance.GetType().Name.ToString(); |
||
143 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
144 | // }; |
||
145 | // break; |
||
146 | // #endregion |
||
147 | // #region RectCloud |
||
148 | // case "RectCloudControl": |
||
149 | // { |
||
150 | // using (S_RectCloudControl STemp = new S_RectCloudControl()) |
||
151 | // { |
||
152 | // var instance = item as RectCloudControl; |
||
153 | // STemp.TransformPoint = "0|0"; |
||
154 | // STemp.PointSet = instance.PointSet; |
||
155 | // STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
156 | // STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
157 | // STemp.StartPoint = instance.StartPoint; |
||
158 | // STemp.UserID = UserId; |
||
159 | // STemp.Opac = instance.Opacity; |
||
160 | // STemp.TR = instance.TopRightPoint; |
||
161 | // STemp.LB = instance.LeftBottomPoint; |
||
162 | // STemp.EndPoint = instance.EndPoint; |
||
163 | // STemp.PaintState = instance.Paint; |
||
164 | // STemp.DashSize = instance.DashSize; |
||
165 | // STemp.Name = instance.GetType().Name.ToString(); |
||
166 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
167 | // } |
||
168 | // } |
||
169 | // break; |
||
170 | // #endregion |
||
171 | // #region Circle |
||
172 | // case "CircleControl": |
||
173 | // using (S_CircleControl STemp = new S_CircleControl()) |
||
174 | // { |
||
175 | // var instance = item as CircleControl; |
||
176 | // STemp.TransformPoint = "0|0"; |
||
177 | // STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
178 | // STemp.PaintState = instance.Paint; |
||
179 | // STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
180 | // if (instance.FillColor != null) |
||
181 | // { |
||
182 | // STemp.FillColor = instance.FillColor.Color.ToString(); |
||
183 | // } |
||
184 | // STemp.StartPoint = instance.StartPoint; |
||
185 | // STemp.UserID = UserId; |
||
186 | // STemp.EndPoint = instance.EndPoint; |
||
187 | // STemp.TRP = instance.TopRightPoint; |
||
188 | // STemp.LBP = instance.LeftBottomPoint; |
||
189 | // STemp.Opac = instance.Opacity; |
||
190 | // STemp.Angle = instance.Angle; |
||
191 | // STemp.PointSet = instance.PointSet; |
||
192 | // STemp.DashSize = instance.DashSize; |
||
193 | // STemp.Name = instance.GetType().Name.ToString(); |
||
194 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
195 | // }; |
||
196 | // break; |
||
197 | // #endregion |
||
198 | // #region Rectangle |
||
199 | // case "RectangleControl": |
||
200 | // using (S_RectControl STemp = new S_RectControl()) |
||
201 | // { |
||
202 | // var instance = item as RectangleControl; |
||
203 | // STemp.TransformPoint = "0|0"; |
||
204 | // STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
205 | // STemp.PaintState = instance.Paint; |
||
206 | // STemp.PointSet = instance.PointSet; |
||
207 | // STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
208 | // if (instance.FillColor != null) |
||
209 | // { |
||
210 | // STemp.FillColor = instance.FillColor.Color.ToString(); |
||
211 | // } |
||
212 | // STemp.StartPoint = instance.StartPoint; |
||
213 | // STemp.UserID = instance.Uid; |
||
214 | // //STemp.Angle = instance.a; |
||
215 | // STemp.EndPoint = instance.EndPoint; |
||
216 | // STemp.LB = instance.LeftBottomPoint; |
||
217 | // STemp.TR = instance.TopRightPoint; |
||
218 | // //STemp.DashSize = instance.DashSize; |
||
219 | // STemp.Opac = instance.Opacity; |
||
220 | // STemp.Name = instance.GetType().Name.ToString(); |
||
221 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
222 | // }; |
||
223 | // break; |
||
224 | // #endregion |
||
225 | // #region Triangle |
||
226 | // case "TriControl": |
||
227 | // using (S_TriControl STemp = new S_TriControl()) |
||
228 | // { |
||
229 | // var instance = item as TriControl; |
||
230 | // STemp.TransformPoint = "0|0"; |
||
231 | // STemp.Paint = instance.Paint; |
||
232 | // STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
233 | // STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
234 | // if (instance.FillColor != null) |
||
235 | // { |
||
236 | // STemp.FillColor = instance.FillColor.Color.ToString(); |
||
237 | // } |
||
238 | // STemp.StartPoint = instance.StartPoint; |
||
239 | // STemp.EndPoint = instance.EndPoint; |
||
240 | // STemp.MidPoint = instance.MidPoint; |
||
241 | // STemp.Opac = instance.Opacity; |
||
242 | // STemp.UserID = UserId; |
||
243 | // STemp.PointSet = instance.PointSet; |
||
244 | // STemp.Angle = instance.Angle; |
||
245 | // STemp.DashSize = instance.DashSize; |
||
246 | // STemp.Name = instance.GetType().Name.ToString(); |
||
247 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
248 | // } |
||
249 | // break; |
||
250 | // #endregion |
||
251 | // #region Poly |
||
252 | // case "PolygonControl": |
||
253 | // using (S_PolyControl STemp = new S_PolyControl()) |
||
254 | // { |
||
255 | // var instance = item as PolygonControl; |
||
256 | |||
257 | // STemp.TransformPoint = "0|0"; |
||
258 | // STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
259 | // //STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
260 | // STemp.Name = instance.GetType().Name.ToString(); |
||
261 | // //STemp.Toler = instance.Toler; |
||
262 | // //STemp.PaintState = instance.Paint; |
||
263 | // STemp.Opac = instance.Opacity; |
||
264 | // STemp.UserID = UserId; |
||
265 | // //STemp.IsTrans = instance.isTransOn; |
||
266 | // //STemp.IsChain = instance.isChain; |
||
267 | // STemp.PointSet = new List<Point>(); |
||
268 | // //STemp.DashSize = instance.DashSize; |
||
269 | // STemp.IsCompleted = instance.IsCompleted; |
||
270 | // foreach (var point in instance.PointSet) |
||
271 | // { |
||
272 | // STemp.PointSet.Add(point); |
||
273 | // } |
||
274 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
275 | // }; |
||
276 | // break; |
||
277 | // #endregion |
||
278 | // #region Cloud |
||
279 | // case "CloudControl": |
||
280 | // using (S_CloudControl STemp = new S_CloudControl()) |
||
281 | // { |
||
282 | // var instance = item as CloudControl; |
||
283 | |||
284 | // STemp.TransformPoint = "0|0"; |
||
285 | // STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
286 | // STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
287 | // STemp.Name = instance.GetType().Name.ToString(); |
||
288 | // STemp.Toler = instance.Toler; |
||
289 | // STemp.PaintState = instance.Paint; |
||
290 | // STemp.Opac = instance.Opacity; |
||
291 | // STemp.UserID = UserId; |
||
292 | // STemp.IsTrans = instance.isTransOn; |
||
293 | // STemp.IsChain = instance.isChain; |
||
294 | // STemp.PointSet = new List<Point>(); |
||
295 | // STemp.DashSize = instance.DashSize; |
||
296 | // foreach (var point in instance.PointSet) |
||
297 | // { |
||
298 | // STemp.PointSet.Add(point); |
||
299 | // } |
||
300 | |||
301 | // //STemp.CloudFill = instance.Fill; |
||
302 | // STemp.ArcLength = instance.ArcLength; |
||
303 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
304 | // } |
||
305 | // break; |
||
306 | // #endregion |
||
307 | // #region Sign |
||
308 | // case "SignControl": |
||
309 | // { |
||
310 | // using (S_SignControl STemp = new S_SignControl()) |
||
311 | // { |
||
312 | // //SignControl instance = item as SignControl; |
||
313 | // //STemp.Angle = instance.Angle; |
||
314 | // //STemp.EndPoint = instance.EndPoint; |
||
315 | // //STemp.UserID = UserId; |
||
316 | // //STemp.LB = instance.LeftBottomPoint; |
||
317 | // //STemp.Name = instance.GetType().Name; |
||
318 | // //STemp.PointSet = instance.PointSet; |
||
319 | // //STemp.StartPoint = instance.StartPoint; |
||
320 | // //STemp.Opac = instance.Opacity; |
||
321 | // //STemp.TR = instance.TopRightPoint; |
||
322 | // //STemp.UserNumber = instance.UserNumber; |
||
323 | // //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
324 | // } |
||
325 | // } |
||
326 | // break; |
||
327 | // #endregion |
||
328 | // #region Ink |
||
329 | // case "InkPresenter": |
||
330 | // { |
||
331 | // var instance = item as InkPresenter; |
||
332 | // if (instance.Strokes.Count >= 1) |
||
333 | // { |
||
334 | // using (S_PensilControl STemp = new S_PensilControl()) |
||
335 | // { |
||
336 | // bool isRealData = true; |
||
337 | // foreach (var strokeData in instance.Strokes) |
||
338 | // { |
||
339 | // if (strokeData.StylusPoints.Count == 0) |
||
340 | // { |
||
341 | // isRealData = false; |
||
342 | // } |
||
343 | // } |
||
344 | // if (isRealData) |
||
345 | // { |
||
346 | // if (instance.Tag != null) |
||
347 | // { |
||
348 | // STemp.UserID = instance.Tag.ToString(); |
||
349 | // } |
||
350 | // STemp.SCC = instance.Strokes; |
||
351 | // STemp.Name = instance.GetType().Name; |
||
352 | // STemp.Opac = instance.Opacity; |
||
353 | // STemp.TransformPoint = "0|0"; |
||
354 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
355 | // } |
||
356 | // } |
||
357 | // } |
||
358 | // } |
||
359 | // break; |
||
360 | // #endregion |
||
361 | // #region Text |
||
362 | // case "TextControl": |
||
363 | // using (S_TextControl STemp = new S_TextControl()) |
||
364 | // { |
||
365 | |||
366 | // var instance = item as TextControl; |
||
367 | // STemp.TransformPoint = "0|0"; |
||
368 | // STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString()); |
||
369 | // STemp.Text = instance.Text; |
||
370 | // STemp.UserID = UserId; |
||
371 | // STemp.FontColor = instance.FontColor.Color.ToString(); |
||
372 | // //STemp.EndPoint = instance.EndPoint; |
||
373 | // STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY); |
||
374 | // STemp.Opac = instance.Opacity; |
||
375 | // //STemp.StartPoint = instance.StartPoint; |
||
376 | // STemp.PointSet = instance.PointSet; |
||
377 | // STemp.Angle = instance.Angle; |
||
378 | // STemp.paintMethod = instance.ControlType_No; |
||
379 | // STemp.BoxW = instance.BoxWidth; |
||
380 | // STemp.BoxH = instance.BoxHeight; |
||
381 | // STemp.isHighLight = instance.IsHighLight; |
||
382 | // STemp.Name = instance.GetType().Name.ToString(); |
||
383 | // STemp.fontConfig = new List<string>() |
||
384 | // { |
||
385 | // instance.TextFamily.ToString(), |
||
386 | // instance.TextStyle.ToString(), |
||
387 | // instance.TextWeight.ToString(), |
||
388 | // }; |
||
389 | |||
390 | |||
391 | |||
392 | // if (instance.UnderLine != null) |
||
393 | // { |
||
394 | // STemp.fontConfig.Add("true"); |
||
395 | // } |
||
396 | |||
397 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
398 | // } |
||
399 | // break; |
||
400 | // #endregion |
||
401 | // #region Date |
||
402 | // case "DateControl": |
||
403 | // { |
||
404 | // using (S_DateControl STemp = new S_DateControl()) |
||
405 | // { |
||
406 | // DateControl instance = item as DateControl; |
||
407 | // STemp.Angle = instance.Angle; |
||
408 | // STemp.EndPoint = instance.EndPoint; |
||
409 | // STemp.UserID = UserId; |
||
410 | // STemp.LB = instance.LeftBottomPoint; |
||
411 | // STemp.Name = instance.GetType().Name; |
||
412 | // STemp.PointSet = instance.PointSet; |
||
413 | // STemp.StartPoint = instance.StartPoint; |
||
414 | // STemp.Opac = instance.Opacity; |
||
415 | // STemp.TR = instance.TopRightPoint; |
||
416 | // STemp.TransformPoint = "0|0"; |
||
417 | // STemp.FontColor = instance.FontColor.Color.ToString(); |
||
418 | // STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
419 | // STemp.Text = instance.Text; |
||
420 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
421 | // } |
||
422 | // } |
||
423 | // break; |
||
424 | // #endregion |
||
425 | // #region Symbol |
||
426 | // case "SymControl": |
||
427 | // using (S_SymControl STemp = new S_SymControl()) |
||
428 | // { |
||
429 | // //var instance = item as SymControl; |
||
430 | // //STemp.TransformPoint = "0|0"; |
||
431 | // //STemp.PointSet = instance.PointSet; |
||
432 | // //STemp.UserID = UserId; |
||
433 | // //STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString()); |
||
434 | // //STemp.PaintState = instance.Paint; |
||
435 | // //STemp.PathInfo = instance.PathData.ToString(); |
||
436 | // //STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
437 | // //STemp.StartPoint = instance.StartPoint; |
||
438 | // //STemp.Angle = instance.Angle; |
||
439 | // //STemp.EndPoint = instance.EndPoint; |
||
440 | // //STemp.LB = instance.LeftBottomPoint; |
||
441 | // //STemp.TR = instance.TopRightPoint; |
||
442 | // //STemp.Opac = instance.Opacity; |
||
443 | // //STemp.Name = instance.GetType().Name.ToString(); |
||
444 | // //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
445 | // } |
||
446 | // break; |
||
447 | // #endregion |
||
448 | // #region SymbolN |
||
449 | // case "SymControlN": |
||
450 | // using (S_SymControlN STemp = new S_SymControlN()) |
||
451 | // { |
||
452 | // //var instance = item as SymControlN; |
||
453 | // //STemp.TransformPoint = "0|0"; |
||
454 | // //STemp.PointSet = instance.PointSet; |
||
455 | // ////STemp.XamlData = instance.PathXathData; |
||
456 | // //STemp.UserID = UserId; |
||
457 | // //STemp.DBData = JsonSerializerHelper.CompressString(instance.PathXathData); |
||
458 | // ////STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
459 | // //STemp.StartPoint = instance.StartPoint; |
||
460 | // //STemp.Angle = instance.Angle; |
||
461 | // //STemp.EndPoint = instance.EndPoint; |
||
462 | // //STemp.LB = instance.LeftBottomPoint; |
||
463 | // //STemp.TR = instance.TopRightPoint; |
||
464 | // //STemp.Opac = instance.Opacity; |
||
465 | // //STemp.Name = instance.GetType().Name.ToString(); |
||
466 | // //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
467 | // } |
||
468 | // break; |
||
469 | // #endregion |
||
470 | // #region Image |
||
471 | // case "ImgControl": |
||
472 | // using (S_ImgControl STemp = new S_ImgControl()) |
||
473 | // { |
||
474 | // ImgControl instance = item as ImgControl; |
||
475 | // STemp.Angle = instance.Angle; |
||
476 | // STemp.EndPoint = instance.EndPoint; |
||
477 | // STemp.LB = instance.LeftBottomPoint; |
||
478 | // STemp.Name = instance.GetType().Name; |
||
479 | // STemp.PointSet = instance.PointSet; |
||
480 | // STemp.StartPoint = instance.StartPoint; |
||
481 | // STemp.UserID = UserId; |
||
482 | // STemp.Opac = instance.Opacity; |
||
483 | // STemp.TR = instance.TopRightPoint; |
||
484 | // STemp.ImagePath = instance.FilePath; |
||
485 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
486 | // } |
||
487 | // break; |
||
488 | // #endregion |
||
489 | // default: |
||
490 | // break; |
||
491 | // } |
||
492 | // } |
||
493 | // #endregion |
||
494 | |||
495 | // return ConvertData; |
||
496 | //} |
||
497 | |||
498 | public partial class LayerControl : Control |
||
499 | { |
||
500 | |||
501 | public MarkupReturn MarkupToString(CommentUserInfo Control, string UserId) |
||
502 | { |
||
503 | MarkupReturn Data = new MarkupReturn(); |
||
504 | Data.ConvertData = ""; |
||
505 | Data.DATA_TYPE = 0; |
||
506 | Data.CommentID = Control.CommentID; |
||
507 | if(Data.CommentID == null) |
||
508 | { |
||
509 | Data.CommentID = shortGuid(); |
||
510 | } |
||
511 | |||
512 | String ConvertData = ""; |
||
513 | //int DATA_TYPE = 0; |
||
514 | |||
515 | #region ######### 마크업 파싱########## |
||
516 | |||
517 | switch (Control.GetType().Name.ToString()) |
||
518 | { |
||
519 | #region Line |
||
520 | #region Arrow_Multi |
||
521 | case "ArrowControl_Multi": |
||
522 | using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi()) |
||
523 | { |
||
524 | var instance = Control as ArrowControl_Multi; |
||
525 | STemp.TransformPoint = "0|0"; |
||
526 | STemp.PointSet = instance.PointSet; |
||
527 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
528 | //STemp.StrokeColor = "#FF00FF00"; |
||
529 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
530 | STemp.StartPoint = instance.StartPoint; |
||
531 | STemp.EndPoint = instance.EndPoint; |
||
532 | STemp.UserID = UserId; |
||
533 | STemp.Opac = instance.Opacity; |
||
534 | STemp.DashSize = instance.DashSize; |
||
535 | STemp.MidPoint = instance.MiddlePoint; |
||
536 | STemp.Name = instance.GetType().Name.ToString(); |
||
537 | |||
538 | ///강인구 추가(2017.11.02) |
||
539 | ///Memo 추가 |
||
540 | STemp.Memo = instance.Memo; |
||
541 | |||
542 | ///강인구 추가(2017.11.02) |
||
543 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
544 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
545 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
546 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
547 | }; |
||
548 | break; |
||
549 | #endregion |
||
550 | #region Line |
||
551 | case "LineControl": |
||
552 | using (S_LineControl STemp = new S_LineControl()) |
||
553 | { |
||
554 | var instance = Control as LineControl; |
||
555 | |||
556 | STemp.TransformPoint = "0|0"; |
||
557 | STemp.PointSet = instance.PointSet; |
||
558 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
559 | STemp.LineStyleSet = instance.LineStyleSet; |
||
560 | //STemp.StrokeColor = "#FF00FF00"; |
||
561 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
562 | STemp.StartPoint = instance.StartPoint; |
||
563 | STemp.EndPoint = instance.EndPoint; |
||
564 | STemp.UserID = UserId; |
||
565 | STemp.Opac = instance.Opacity; |
||
566 | STemp.DashSize = instance.DashSize; |
||
567 | STemp.Interval = instance.Interval; |
||
568 | STemp.DimSize = instance.DimSize; |
||
569 | STemp.Name = instance.GetType().Name.ToString(); |
||
570 | |||
571 | ///강인구 추가(2017.11.02) |
||
572 | ///Memo 추가 |
||
573 | STemp.Memo = instance.Memo; |
||
574 | |||
575 | ///강인구 추가(2017.11.02) |
||
576 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
577 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
578 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
579 | |||
580 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
581 | |||
582 | //var item = JsonSerializerHelper.UnCompressString(Data.ConvertData); //언패킹작업 |
||
583 | //using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item)) |
||
584 | //{ |
||
585 | // LineControl ins = new LineControl() |
||
586 | // { |
||
587 | // Memo = s.Memo |
||
588 | // }; |
||
589 | //} |
||
590 | |||
591 | }; |
||
592 | break; |
||
593 | #endregion |
||
594 | #region Arc |
||
595 | case "ArcControl": |
||
596 | using (S_ArcControl STemp = new S_ArcControl()) |
||
597 | { |
||
598 | var instance = Control as ArcControl; |
||
599 | STemp.TransformPoint = "0|0"; |
||
600 | STemp.PointSet = instance.PointSet; |
||
601 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
602 | //STemp.StrokeColor = "#FF000FFF"; |
||
603 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
604 | STemp.StartPoint = instance.StartPoint; |
||
605 | STemp.UserID = UserId; |
||
606 | STemp.Opac = instance.Opacity; |
||
607 | STemp.MidPoint = instance.MidPoint; |
||
608 | STemp.EndPoint = instance.EndPoint; |
||
609 | STemp.IsTransOn = instance.isTransOn; |
||
610 | STemp.DashSize = instance.DashSize; |
||
611 | STemp.Clock = instance.Clock; |
||
612 | //STemp.ArcStyleSet = instance.ControlType; |
||
613 | STemp.Name = instance.GetType().Name.ToString(); |
||
614 | |||
615 | ///강인구 추가(2017.11.02) |
||
616 | ///Memo 추가 |
||
617 | STemp.Memo = instance.Memo; |
||
618 | |||
619 | ///강인구 추가(2017.11.02) |
||
620 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
621 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
622 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
623 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
624 | |||
625 | }; |
||
626 | break; |
||
627 | #endregion |
||
628 | #endregion |
||
629 | |||
630 | #region Shape |
||
631 | #region RectCloud |
||
632 | case "RectCloudControl": |
||
633 | { |
||
634 | using (S_RectCloudControl STemp = new S_RectCloudControl()) |
||
635 | { |
||
636 | var instance = Control as RectCloudControl; |
||
637 | STemp.TransformPoint = "0|0"; |
||
638 | STemp.PointSet = instance.PointSet; |
||
639 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
640 | //STemp.StrokeColor = "#FF00FF00"; |
||
641 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
642 | STemp.StartPoint = instance.StartPoint; |
||
643 | STemp.UserID = UserId; |
||
644 | STemp.Opac = instance.Opacity; |
||
645 | STemp.TR = instance.TopRightPoint; |
||
646 | STemp.LB = instance.LeftBottomPoint; |
||
647 | STemp.EndPoint = instance.EndPoint; |
||
648 | STemp.PaintState = instance.Paint; |
||
649 | STemp.DashSize = instance.DashSize; |
||
650 | 53393bae | KangIngu | STemp.ArcLength = instance.ArcLength; |
651 | 787a4489 | KangIngu | STemp.Name = instance.GetType().Name.ToString(); |
652 | ///강인구 추가(2017.11.02) |
||
653 | ///Memo 추가 |
||
654 | STemp.Memo = instance.Memo; |
||
655 | |||
656 | ///강인구 추가(2017.11.02) |
||
657 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
658 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
659 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
660 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
661 | } |
||
662 | } |
||
663 | break; |
||
664 | #endregion |
||
665 | #region Circle |
||
666 | case "CircleControl": |
||
667 | using (S_CircleControl STemp = new S_CircleControl()) |
||
668 | { |
||
669 | var instance = Control as CircleControl; |
||
670 | STemp.TransformPoint = "0|0"; |
||
671 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
672 | STemp.PaintState = instance.Paint; |
||
673 | //STemp.StrokeColor = "#FF00FF00"; |
||
674 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
675 | if (instance.FillColor != null) |
||
676 | { |
||
677 | STemp.FillColor = instance.FillColor.Color.ToString(); |
||
678 | } |
||
679 | STemp.StartPoint = instance.StartPoint; |
||
680 | STemp.UserID = UserId; |
||
681 | STemp.EndPoint = instance.EndPoint; |
||
682 | STemp.TRP = instance.TopRightPoint; |
||
683 | STemp.LBP = instance.LeftBottomPoint; |
||
684 | STemp.Opac = instance.Opacity; |
||
685 | STemp.Angle = instance.Angle; |
||
686 | STemp.PointSet = instance.PointSet; |
||
687 | STemp.DashSize = instance.DashSize; |
||
688 | STemp.Name = instance.GetType().Name.ToString(); |
||
689 | ///강인구 추가(2017.11.02) |
||
690 | ///Memo 추가 |
||
691 | STemp.Memo = instance.Memo; |
||
692 | |||
693 | ///강인구 추가(2017.11.02) |
||
694 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
695 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
696 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
697 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
698 | }; |
||
699 | break; |
||
700 | #endregion |
||
701 | #region Rectangle |
||
702 | case "RectangleControl": |
||
703 | using (S_RectControl STemp = new S_RectControl()) |
||
704 | { |
||
705 | var instance = Control as RectangleControl; |
||
706 | STemp.TransformPoint = "0|0"; |
||
707 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
708 | STemp.PaintState = instance.Paint; |
||
709 | STemp.PointSet = instance.PointSet; |
||
710 | //STemp.StrokeColor = "#FF00FF00"; |
||
711 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
712 | if (instance.FillColor != null) |
||
713 | { |
||
714 | STemp.FillColor = instance.FillColor.Color.ToString(); |
||
715 | } |
||
716 | STemp.StartPoint = instance.StartPoint; |
||
717 | STemp.UserID = UserId; |
||
718 | //STemp.Angle = instance.a; |
||
719 | STemp.EndPoint = instance.EndPoint; |
||
720 | STemp.LB = instance.LeftBottomPoint; |
||
721 | STemp.TR = instance.TopRightPoint; |
||
722 | STemp.DashSize = instance.DashSize; |
||
723 | STemp.Opac = instance.Opacity; |
||
724 | STemp.Name = instance.GetType().Name.ToString(); |
||
725 | ///강인구 추가(2017.11.02) |
||
726 | ///Memo 추가 |
||
727 | STemp.Memo = instance.Memo; |
||
728 | |||
729 | ///강인구 추가(2017.11.02) |
||
730 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
731 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
732 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
733 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
734 | }; |
||
735 | break; |
||
736 | #endregion |
||
737 | #region Triangle |
||
738 | case "TriControl": |
||
739 | using (S_TriControl STemp = new S_TriControl()) |
||
740 | { |
||
741 | var instance = Control as TriControl; |
||
742 | STemp.TransformPoint = "0|0"; |
||
743 | STemp.Paint = instance.Paint; |
||
744 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
745 | //STemp.StrokeColor = "#FF00FF00"; |
||
746 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
747 | if (instance.FillColor != null) |
||
748 | { |
||
749 | STemp.FillColor = instance.FillColor.Color.ToString(); |
||
750 | } |
||
751 | STemp.StartPoint = instance.StartPoint; |
||
752 | STemp.EndPoint = instance.EndPoint; |
||
753 | STemp.MidPoint = instance.MidPoint; |
||
754 | STemp.Opac = instance.Opacity; |
||
755 | STemp.UserID = UserId; |
||
756 | STemp.PointSet = instance.PointSet; |
||
757 | STemp.Angle = instance.Angle; |
||
758 | STemp.DashSize = instance.DashSize; |
||
759 | STemp.Name = instance.GetType().Name.ToString(); |
||
760 | ///강인구 추가(2017.11.02) |
||
761 | ///Memo 추가 |
||
762 | STemp.Memo = instance.Memo; |
||
763 | |||
764 | ///강인구 추가(2017.11.02) |
||
765 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
766 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
767 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
768 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
769 | } |
||
770 | break; |
||
771 | #endregion |
||
772 | #endregion |
||
773 | |||
774 | #region Polygon |
||
775 | #region Poly |
||
776 | case "PolygonControl": |
||
777 | using (S_PolyControl STemp = new S_PolyControl()) |
||
778 | { |
||
779 | var instance = Control as PolygonControl; |
||
780 | |||
781 | STemp.TransformPoint = "0|0"; |
||
782 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
783 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
784 | //STemp.StrokeColor = "#FF000FFF"; |
||
785 | STemp.Name = instance.GetType().Name.ToString(); |
||
786 | //STemp.Toler = instance.Toler; |
||
787 | STemp.PaintState = instance.Paint; |
||
788 | STemp.Opac = instance.Opacity; |
||
789 | STemp.UserID = UserId; |
||
790 | STemp.PaintState = instance.Paint; |
||
791 | //강인구 추가(Chain인지 Polygon인지 구분) |
||
792 | STemp.Type = instance.ControlType; |
||
793 | //STemp.IsTrans = instance.isTransOn; |
||
794 | //STemp.IsChain = instance.isChain; |
||
795 | STemp.PointSet = new List<Point>(); |
||
796 | STemp.DashSize = instance.DashSize; |
||
797 | STemp.StartPoint = instance.StartPoint; |
||
798 | STemp.EndPoint = instance.EndPoint; |
||
799 | STemp.IsCompleted = instance.IsCompleted; |
||
800 | foreach (var point in instance.PointSet) |
||
801 | { |
||
802 | STemp.PointSet.Add(point); |
||
803 | } |
||
804 | ///강인구 추가(2017.11.02) |
||
805 | ///Memo 추가 |
||
806 | STemp.Memo = instance.Memo; |
||
807 | |||
808 | ///강인구 추가(2017.11.02) |
||
809 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
810 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
811 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
812 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
813 | }; |
||
814 | break; |
||
815 | #endregion |
||
816 | |||
817 | #region InkControl |
||
818 | case "InkControl": |
||
819 | using (S_PolyControl STemp = new S_PolyControl()) |
||
820 | { |
||
821 | var instance = Control as InkControl; |
||
822 | |||
823 | STemp.TransformPoint = "0|0"; |
||
824 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
825 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
826 | //STemp.StrokeColor = "#FF000FFF"; |
||
827 | STemp.Name = instance.GetType().Name.ToString(); |
||
828 | //STemp.Toler = instance.Toler; |
||
829 | STemp.PaintState = instance.Paint; |
||
830 | STemp.Opac = instance.Opacity; |
||
831 | STemp.UserID = UserId; |
||
832 | STemp.PaintState = instance.Paint; |
||
833 | //강인구 추가(Chain인지 Polygon인지 구분) |
||
834 | STemp.Type = instance.ControlType; |
||
835 | //STemp.IsTrans = instance.isTransOn; |
||
836 | //STemp.IsChain = instance.isChain; |
||
837 | STemp.PointSet = new List<Point>(); |
||
838 | STemp.DashSize = instance.DashSize; |
||
839 | STemp.IsCompleted = instance.IsCompleted; |
||
840 | STemp.StartPoint = instance.StartPoint; |
||
841 | STemp.EndPoint = instance.EndPoint; |
||
842 | foreach (var point in instance.PointSet) |
||
843 | { |
||
844 | STemp.PointSet.Add(point); |
||
845 | } |
||
846 | ///강인구 추가(2017.11.02) |
||
847 | ///Memo 추가 |
||
848 | STemp.Memo = instance.Memo; |
||
849 | |||
850 | ///강인구 추가(2017.11.02) |
||
851 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
852 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
853 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
854 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
855 | }; |
||
856 | break; |
||
857 | #endregion |
||
858 | |||
859 | #region Cloud |
||
860 | case "CloudControl": |
||
861 | using (S_CloudControl STemp = new S_CloudControl()) |
||
862 | { |
||
863 | var instance = Control as CloudControl; |
||
864 | |||
865 | STemp.TransformPoint = "0|0"; |
||
866 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
867 | //STemp.StrokeColor = "#FF000FFF"; |
||
868 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
869 | STemp.Name = instance.GetType().Name.ToString(); |
||
870 | STemp.Toler = instance.Toler; |
||
871 | STemp.PaintState = instance.Paint; |
||
872 | STemp.Opac = instance.Opacity; |
||
873 | STemp.UserID = UserId; |
||
874 | STemp.IsTrans = instance.isTransOn; |
||
875 | STemp.IsChain = instance.isChain; |
||
876 | STemp.PointSet = new List<Point>(); |
||
877 | STemp.DashSize = instance.DashSize; |
||
878 | STemp.StartPoint = instance.StartPoint; |
||
879 | STemp.EndPoint = instance.EndPoint; |
||
880 | 53393bae | KangIngu | STemp.ArcLength = instance.ArcLength; |
881 | 787a4489 | KangIngu | foreach (var point in instance.PointSet) |
882 | { |
||
883 | STemp.PointSet.Add(point); |
||
884 | } |
||
885 | |||
886 | //STemp.CloudFill = instance.Fill; |
||
887 | STemp.ArcLength = instance.ArcLength; |
||
888 | ///강인구 추가(2017.11.02) |
||
889 | ///Memo 추가 |
||
890 | STemp.Memo = instance.Memo; |
||
891 | |||
892 | ///강인구 추가(2017.11.02) |
||
893 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
894 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
895 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
896 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
897 | } |
||
898 | break; |
||
899 | #endregion |
||
900 | #endregion |
||
901 | |||
902 | #region Text |
||
903 | #region Text |
||
904 | case "TextControl": |
||
905 | using (S_TextControl STemp = new S_TextControl()) |
||
906 | { |
||
907 | |||
908 | var instance = Control as TextControl; |
||
909 | STemp.TransformPoint = "0|0"; |
||
910 | STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString()); |
||
911 | STemp.Text = instance.Text; |
||
912 | STemp.UserID = UserId; |
||
913 | STemp.FontColor = instance.FontColor.Color.ToString(); |
||
914 | //STemp.FontColor = "#FFFFFF00"; |
||
915 | |||
916 | if(instance.StartPoint == new Point()) |
||
917 | STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY); |
||
918 | else |
||
919 | STemp.StartPoint = instance.StartPoint; |
||
920 | |||
921 | STemp.EndPoint = instance.EndPoint; |
||
922 | STemp.Opac = instance.Opacity; |
||
923 | STemp.PointSet = instance.PointSet; |
||
924 | STemp.Angle = instance.Angle; |
||
925 | STemp.paintMethod = instance.ControlType_No; |
||
926 | STemp.BoxW = instance.BoxWidth; |
||
927 | STemp.BoxH = instance.BoxHeight; |
||
928 | STemp.isHighLight = instance.IsHighLight; |
||
929 | STemp.Name = instance.GetType().Name.ToString(); |
||
930 | STemp.fontConfig = new List<string>() |
||
931 | { |
||
932 | instance.TextFamily.ToString(), |
||
933 | instance.TextStyle.ToString(), |
||
934 | instance.TextWeight.ToString(), |
||
935 | }; |
||
936 | |||
937 | |||
938 | |||
939 | if (instance.UnderLine != null) |
||
940 | { |
||
941 | STemp.fontConfig.Add("true"); |
||
942 | } |
||
943 | |||
944 | ///강인구 추가(2017.11.02) |
||
945 | ///Memo 추가 |
||
946 | STemp.Memo = instance.Memo; |
||
947 | |||
948 | ///강인구 추가(2017.11.02) |
||
949 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
950 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
951 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
952 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
953 | } |
||
954 | break; |
||
955 | #endregion |
||
956 | #region ArrowText |
||
957 | case "ArrowTextControl": |
||
958 | using (S_ArrowTextControl STemp = new S_ArrowTextControl()) |
||
959 | { |
||
960 | var instance = Control as ArrowTextControl; |
||
961 | |||
962 | STemp.TransformPoint = "0|0"; |
||
963 | STemp.PointSet = instance.PointSet; |
||
964 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
965 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
966 | STemp.StartPoint = instance.StartPoint; |
||
967 | STemp.ArrowStyle = instance.ArrowTextStyle; |
||
968 | //STemp.StrokeColor = "#FF00FF00"; |
||
969 | STemp.UserID = UserId; |
||
970 | STemp.ArrowText = instance.Base_TextBox.Text; |
||
971 | STemp.BorderSize = instance.BorderSize; |
||
972 | STemp.isHighLight = instance.isHighLight; |
||
973 | STemp.BoxHeight = instance.BoxHeight; |
||
974 | STemp.BoxWidth = instance.BoxWidth; |
||
975 | STemp.Opac = instance.Opacity; |
||
976 | STemp.EndPoint = instance.EndPoint; |
||
977 | STemp.isFixed = instance.isFixed; |
||
978 | //STemp.DashSize = instance.DashSize; |
||
979 | STemp.Name = instance.GetType().Name.ToString(); |
||
980 | STemp.isTrans = instance.isTrans; |
||
981 | STemp.MidPoint = instance.MidPoint; |
||
982 | STemp.Angle = instance.Angle; |
||
983 | STemp.fontConfig = new List<string>() |
||
984 | { |
||
985 | instance.TextFamily.ToString(), |
||
986 | instance.TextStyle.ToString(), |
||
987 | instance.TextWeight.ToString(), |
||
988 | instance.TextSize.ToString(), |
||
989 | }; |
||
990 | e17af42b | KangIngu | |
991 | if (instance.UnderLine != null) |
||
992 | { |
||
993 | STemp.fontConfig.Add("true"); |
||
994 | } |
||
995 | |||
996 | 787a4489 | KangIngu | ///강인구 추가(2017.11.02) |
997 | ///Memo 추가 |
||
998 | STemp.Memo = instance.Memo; |
||
999 | |||
1000 | ///강인구 추가(2017.11.02) |
||
1001 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
1002 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1003 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
1004 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1005 | }; |
||
1006 | break; |
||
1007 | #endregion |
||
1008 | #endregion |
||
1009 | |||
1010 | #region ETC |
||
1011 | #region Sign |
||
1012 | case "SignControl": |
||
1013 | { |
||
1014 | //강인구 추가 |
||
1015 | using (S_SignControl STemp = new S_SignControl()) |
||
1016 | { |
||
1017 | SignControl instance = Control as SignControl; |
||
1018 | STemp.Angle = instance.Angle; |
||
1019 | STemp.EndPoint = instance.EndPoint; |
||
1020 | STemp.UserID = UserId; |
||
1021 | STemp.LB = instance.LeftBottomPoint; |
||
1022 | STemp.Name = instance.GetType().Name; |
||
1023 | STemp.PointSet = instance.PointSet; |
||
1024 | STemp.StartPoint = instance.StartPoint; |
||
1025 | STemp.Opac = instance.Opacity; |
||
1026 | STemp.TR = instance.TopRightPoint; |
||
1027 | STemp.UserNumber = instance.UserNumber == null ? UserId : instance.UserNumber; |
||
1028 | |||
1029 | ///강인구 추가(2017.11.02) |
||
1030 | ///Memo 추가 |
||
1031 | STemp.Memo = instance.Memo; |
||
1032 | |||
1033 | ///강인구 추가(2017.11.02) |
||
1034 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
1035 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1036 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
1037 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1038 | } |
||
1039 | } |
||
1040 | break; |
||
1041 | #endregion |
||
1042 | |||
1043 | |||
1044 | //변경 필요 |
||
1045 | #region Ink |
||
1046 | case "InkPresenter": |
||
1047 | { |
||
1048 | //var instance = item as InkPresenter; |
||
1049 | //if (instance.Strokes.Count >= 1) |
||
1050 | //{ |
||
1051 | // using (S_PensilControl STemp = new S_PensilControl()) |
||
1052 | // { |
||
1053 | // bool isRealData = true; |
||
1054 | // foreach (var strokeData in instance.Strokes) |
||
1055 | // { |
||
1056 | // if (strokeData.StylusPoints.Count == 0) |
||
1057 | // { |
||
1058 | // isRealData = false; |
||
1059 | // } |
||
1060 | // } |
||
1061 | // if (isRealData) |
||
1062 | // { |
||
1063 | // if (instance.Tag != null) |
||
1064 | // { |
||
1065 | // STemp.UserID = instance.Tag.ToString(); |
||
1066 | // } |
||
1067 | // STemp.SCC = instance.Strokes; |
||
1068 | // STemp.Name = instance.GetType().Name; |
||
1069 | // STemp.Opac = instance.Opacity; |
||
1070 | // STemp.TransformPoint = "0|0"; |
||
1071 | // ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1072 | // } |
||
1073 | // } |
||
1074 | //} |
||
1075 | } |
||
1076 | break; |
||
1077 | #endregion |
||
1078 | #region Date |
||
1079 | case "DateControl": |
||
1080 | { |
||
1081 | using (S_DateControl STemp = new S_DateControl()) |
||
1082 | { |
||
1083 | DateControl instance = Control as DateControl; |
||
1084 | STemp.Angle = instance.Angle; |
||
1085 | STemp.EndPoint = instance.EndPoint; |
||
1086 | STemp.UserID = UserId; |
||
1087 | STemp.LB = instance.LeftBottomPoint; |
||
1088 | STemp.Name = instance.GetType().Name; |
||
1089 | STemp.PointSet = instance.PointSet; |
||
1090 | STemp.StartPoint = instance.StartPoint; |
||
1091 | STemp.Opac = instance.Opacity; |
||
1092 | STemp.TR = instance.TopRightPoint; |
||
1093 | STemp.TransformPoint = "0|0"; |
||
1094 | STemp.FontColor = instance.FontColor.Color.ToString(); |
||
1095 | //STemp.FontColor = "#FFFFFF00"; |
||
1096 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1097 | STemp.Text = instance.Text; |
||
1098 | ///강인구 추가(2017.11.02) |
||
1099 | ///Memo 추가 |
||
1100 | STemp.Memo = instance.Memo; |
||
1101 | |||
1102 | ///강인구 추가(2017.11.02) |
||
1103 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
1104 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1105 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
1106 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1107 | } |
||
1108 | } |
||
1109 | break; |
||
1110 | #endregion |
||
1111 | #region Symbol |
||
1112 | case "SymControl": |
||
1113 | using (S_SymControl STemp = new S_SymControl()) |
||
1114 | { |
||
1115 | var instance = Control as SymControl; |
||
1116 | STemp.TransformPoint = "0|0"; |
||
1117 | STemp.PointSet = instance.PointSet; |
||
1118 | STemp.UserID = UserId; |
||
1119 | STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString()); |
||
1120 | STemp.PaintState = instance.Paint; |
||
1121 | STemp.PathInfo = instance.PathData.ToString(); |
||
1122 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1123 | STemp.StartPoint = instance.StartPoint; |
||
1124 | STemp.Angle = instance.Angle; |
||
1125 | STemp.EndPoint = instance.EndPoint; |
||
1126 | STemp.LB = instance.LeftBottomPoint; |
||
1127 | STemp.TR = instance.TopRightPoint; |
||
1128 | STemp.Opac = instance.Opacity; |
||
1129 | STemp.Name = instance.GetType().Name.ToString(); |
||
1130 | |||
1131 | ///강인구 추가(2017.11.02) |
||
1132 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
1133 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1134 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
1135 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1136 | } |
||
1137 | break; |
||
1138 | #endregion |
||
1139 | #region SymbolN |
||
1140 | case "SymControlN": |
||
1141 | using (S_SymControlN STemp = new S_SymControlN()) |
||
1142 | { |
||
1143 | var instance = Control as SymControlN; |
||
1144 | STemp.TransformPoint = "0|0"; |
||
1145 | STemp.PointSet = instance.PointSet; |
||
1146 | //STemp.XamlData = instance.PathXathData; |
||
1147 | STemp.UserID = UserId; |
||
1148 | b200de5a | KangIngu | STemp.DBData = instance.PathXathData; |
1149 | 787a4489 | KangIngu | //STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1150 | STemp.StartPoint = instance.StartPoint; |
||
1151 | STemp.Angle = instance.Angle; |
||
1152 | STemp.EndPoint = instance.EndPoint; |
||
1153 | STemp.LB = instance.LeftBottomPoint; |
||
1154 | STemp.TR = instance.TopRightPoint; |
||
1155 | STemp.Opac = instance.Opacity; |
||
1156 | STemp.Name = instance.GetType().Name.ToString(); |
||
1157 | |||
1158 | ///강인구 추가(2017.11.02) |
||
1159 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
1160 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1161 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
1162 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1163 | } |
||
1164 | break; |
||
1165 | #endregion |
||
1166 | #region Image |
||
1167 | case "ImgControl": |
||
1168 | using (S_ImgControl STemp = new S_ImgControl()) |
||
1169 | { |
||
1170 | ImgControl instance = Control as ImgControl; |
||
1171 | STemp.Angle = instance.Angle; |
||
1172 | STemp.EndPoint = instance.EndPoint; |
||
1173 | STemp.LB = instance.LeftBottomPoint; |
||
1174 | STemp.Name = instance.GetType().Name; |
||
1175 | STemp.PointSet = instance.PointSet; |
||
1176 | STemp.StartPoint = instance.StartPoint; |
||
1177 | STemp.UserID = UserId; |
||
1178 | STemp.Opac = instance.Opacity; |
||
1179 | STemp.TR = instance.TopRightPoint; |
||
1180 | STemp.ImagePath = instance.FilePath; |
||
1181 | ///강인구 추가(2017.11.02) |
||
1182 | ///Memo 추가 |
||
1183 | STemp.Memo = instance.Memo; |
||
1184 | |||
1185 | ///강인구 추가(2017.11.02) |
||
1186 | ///DATA_TYPE추가로 인한 클래스 변수 대입 |
||
1187 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1188 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
1189 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1190 | } |
||
1191 | break; |
||
1192 | #endregion |
||
1193 | #endregion |
||
1194 | default: |
||
1195 | break; |
||
1196 | } |
||
1197 | |||
1198 | #endregion |
||
1199 | |||
1200 | //return ConvertData; |
||
1201 | return Data; |
||
1202 | } |
||
1203 | |||
1204 | public MarkupReturn MarkupToString(ObservableCollection<Control> baseLayer, string UserId) |
||
1205 | { |
||
1206 | MarkupReturn Data = new MarkupReturn(); |
||
1207 | Data.ConvertData = ""; |
||
1208 | Data.DATA_TYPE = 0; |
||
1209 | |||
1210 | String ConvertData = ""; |
||
1211 | //int DATA_TYPE = 0; |
||
1212 | |||
1213 | #region ######### 마크업 파싱########## |
||
1214 | foreach (UIElement item in baseLayer) |
||
1215 | { |
||
1216 | switch (item.GetType().Name.ToString()) |
||
1217 | { |
||
1218 | #region Line |
||
1219 | #region Arrow_Multi |
||
1220 | case "ArrowControl_Multi": |
||
1221 | using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi()) |
||
1222 | { |
||
1223 | var instance = item as ArrowControl_Multi; |
||
1224 | STemp.TransformPoint = "0|0"; |
||
1225 | STemp.PointSet = instance.PointSet; |
||
1226 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1227 | //STemp.StrokeColor = "#FF00FF00"; |
||
1228 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1229 | STemp.StartPoint = instance.StartPoint; |
||
1230 | STemp.EndPoint = instance.EndPoint; |
||
1231 | STemp.UserID = UserId; |
||
1232 | STemp.Opac = instance.Opacity; |
||
1233 | STemp.DashSize = instance.DashSize; |
||
1234 | STemp.MidPoint = instance.MiddlePoint; |
||
1235 | STemp.Name = instance.GetType().Name.ToString(); |
||
1236 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1237 | }; |
||
1238 | break; |
||
1239 | #endregion |
||
1240 | #region Line |
||
1241 | case "LineControl": |
||
1242 | using (S_LineControl STemp = new S_LineControl()) |
||
1243 | { |
||
1244 | var instance = item as LineControl; |
||
1245 | |||
1246 | //Data Type 테스트 |
||
1247 | Data.DATA_TYPE = (int)(instance.ControlType); |
||
1248 | |||
1249 | STemp.TransformPoint = "0|0"; |
||
1250 | STemp.PointSet = instance.PointSet; |
||
1251 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1252 | STemp.LineStyleSet = instance.LineStyleSet; |
||
1253 | //STemp.StrokeColor = "#FF00FF00"; |
||
1254 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1255 | STemp.StartPoint = instance.StartPoint; |
||
1256 | STemp.EndPoint = instance.EndPoint; |
||
1257 | STemp.UserID = UserId; |
||
1258 | STemp.Opac = instance.Opacity; |
||
1259 | STemp.DashSize = instance.DashSize; |
||
1260 | STemp.Interval = instance.Interval; |
||
1261 | STemp.DimSize = instance.DimSize; |
||
1262 | STemp.Name = instance.GetType().Name.ToString(); |
||
1263 | |||
1264 | Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1265 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1266 | }; |
||
1267 | break; |
||
1268 | #endregion |
||
1269 | #region Arc |
||
1270 | case "ArcControl": |
||
1271 | using (S_ArcControl STemp = new S_ArcControl()) |
||
1272 | { |
||
1273 | var instance = item as ArcControl; |
||
1274 | STemp.TransformPoint = "0|0"; |
||
1275 | STemp.PointSet = instance.PointSet; |
||
1276 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1277 | //STemp.StrokeColor = "#FF000FFF"; |
||
1278 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1279 | STemp.StartPoint = instance.StartPoint; |
||
1280 | STemp.UserID = UserId; |
||
1281 | STemp.Opac = instance.Opacity; |
||
1282 | STemp.MidPoint = instance.MidPoint; |
||
1283 | STemp.EndPoint = instance.EndPoint; |
||
1284 | STemp.IsTransOn = instance.isTransOn; |
||
1285 | STemp.DashSize = instance.DashSize; |
||
1286 | STemp.Clock = instance.Clock; |
||
1287 | //STemp.ArcStyleSet = instance.ControlType; |
||
1288 | STemp.Name = instance.GetType().Name.ToString(); |
||
1289 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1290 | }; |
||
1291 | break; |
||
1292 | #endregion |
||
1293 | #endregion |
||
1294 | |||
1295 | #region Shape |
||
1296 | #region RectCloud |
||
1297 | case "RectCloudControl": |
||
1298 | { |
||
1299 | using (S_RectCloudControl STemp = new S_RectCloudControl()) |
||
1300 | { |
||
1301 | var instance = item as RectCloudControl; |
||
1302 | STemp.TransformPoint = "0|0"; |
||
1303 | STemp.PointSet = instance.PointSet; |
||
1304 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1305 | //STemp.StrokeColor = "#FF00FF00"; |
||
1306 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1307 | STemp.StartPoint = instance.StartPoint; |
||
1308 | STemp.UserID = UserId; |
||
1309 | STemp.Opac = instance.Opacity; |
||
1310 | STemp.TR = instance.TopRightPoint; |
||
1311 | STemp.LB = instance.LeftBottomPoint; |
||
1312 | STemp.EndPoint = instance.EndPoint; |
||
1313 | STemp.PaintState = instance.Paint; |
||
1314 | STemp.DashSize = instance.DashSize; |
||
1315 | STemp.Name = instance.GetType().Name.ToString(); |
||
1316 | 53393bae | KangIngu | STemp.ArcLength = instance.ArcLength; |
1317 | 787a4489 | KangIngu | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1318 | } |
||
1319 | } |
||
1320 | break; |
||
1321 | #endregion |
||
1322 | #region Circle |
||
1323 | case "CircleControl": |
||
1324 | using (S_CircleControl STemp = new S_CircleControl()) |
||
1325 | { |
||
1326 | var instance = item as CircleControl; |
||
1327 | STemp.TransformPoint = "0|0"; |
||
1328 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1329 | STemp.PaintState = instance.Paint; |
||
1330 | //STemp.StrokeColor = "#FF00FF00"; |
||
1331 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1332 | if (instance.FillColor != null) |
||
1333 | { |
||
1334 | STemp.FillColor = instance.FillColor.Color.ToString(); |
||
1335 | } |
||
1336 | STemp.StartPoint = instance.StartPoint; |
||
1337 | STemp.UserID = UserId; |
||
1338 | STemp.EndPoint = instance.EndPoint; |
||
1339 | STemp.TRP = instance.TopRightPoint; |
||
1340 | STemp.LBP = instance.LeftBottomPoint; |
||
1341 | STemp.Opac = instance.Opacity; |
||
1342 | STemp.Angle = instance.Angle; |
||
1343 | STemp.PointSet = instance.PointSet; |
||
1344 | STemp.DashSize = instance.DashSize; |
||
1345 | STemp.Name = instance.GetType().Name.ToString(); |
||
1346 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1347 | }; |
||
1348 | break; |
||
1349 | #endregion |
||
1350 | #region Rectangle |
||
1351 | case "RectangleControl": |
||
1352 | using (S_RectControl STemp = new S_RectControl()) |
||
1353 | { |
||
1354 | var instance = item as RectangleControl; |
||
1355 | STemp.TransformPoint = "0|0"; |
||
1356 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1357 | STemp.PaintState = instance.Paint; |
||
1358 | STemp.PointSet = instance.PointSet; |
||
1359 | //STemp.StrokeColor = "#FF00FF00"; |
||
1360 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1361 | if (instance.FillColor != null) |
||
1362 | { |
||
1363 | STemp.FillColor = instance.FillColor.Color.ToString(); |
||
1364 | } |
||
1365 | STemp.StartPoint = instance.StartPoint; |
||
1366 | STemp.UserID = UserId; |
||
1367 | STemp.Angle = instance.Angle; |
||
1368 | STemp.EndPoint = instance.EndPoint; |
||
1369 | STemp.LB = instance.LeftBottomPoint; |
||
1370 | STemp.TR = instance.TopRightPoint; |
||
1371 | STemp.DashSize = instance.DashSize; |
||
1372 | STemp.Opac = instance.Opacity; |
||
1373 | STemp.Name = instance.GetType().Name.ToString(); |
||
1374 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1375 | }; |
||
1376 | break; |
||
1377 | #endregion |
||
1378 | #region Triangle |
||
1379 | case "TriControl": |
||
1380 | using (S_TriControl STemp = new S_TriControl()) |
||
1381 | { |
||
1382 | var instance = item as TriControl; |
||
1383 | STemp.TransformPoint = "0|0"; |
||
1384 | STemp.Paint = instance.Paint; |
||
1385 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1386 | //STemp.StrokeColor = "#FF00FF00"; |
||
1387 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1388 | if (instance.FillColor != null) |
||
1389 | { |
||
1390 | STemp.FillColor = instance.FillColor.Color.ToString(); |
||
1391 | } |
||
1392 | STemp.StartPoint = instance.StartPoint; |
||
1393 | STemp.EndPoint = instance.EndPoint; |
||
1394 | STemp.MidPoint = instance.MidPoint; |
||
1395 | STemp.Opac = instance.Opacity; |
||
1396 | STemp.UserID = UserId; |
||
1397 | STemp.PointSet = instance.PointSet; |
||
1398 | STemp.Angle = instance.Angle; |
||
1399 | STemp.DashSize = instance.DashSize; |
||
1400 | STemp.Name = instance.GetType().Name.ToString(); |
||
1401 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1402 | } |
||
1403 | break; |
||
1404 | #endregion |
||
1405 | #endregion |
||
1406 | |||
1407 | #region Polygon |
||
1408 | |||
1409 | #region Poly |
||
1410 | case "PolygonControl": |
||
1411 | using (S_PolyControl STemp = new S_PolyControl()) |
||
1412 | { |
||
1413 | var instance = item as PolygonControl; |
||
1414 | |||
1415 | STemp.TransformPoint = "0|0"; |
||
1416 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1417 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1418 | //STemp.StrokeColor = "#FF000FFF"; |
||
1419 | STemp.Name = instance.GetType().Name.ToString(); |
||
1420 | //STemp.Toler = instance.Toler; |
||
1421 | STemp.PaintState = instance.Paint; |
||
1422 | STemp.Opac = instance.Opacity; |
||
1423 | STemp.UserID = UserId; |
||
1424 | //강인구 추가(Chain인지 Polygon인지 구분) |
||
1425 | STemp.Type = instance.ControlType; |
||
1426 | //STemp.IsTrans = instance.isTransOn; |
||
1427 | //STemp.IsChain = instance.isChain; |
||
1428 | STemp.PointSet = new List<Point>(); |
||
1429 | STemp.DashSize = instance.DashSize; |
||
1430 | STemp.IsCompleted = instance.IsCompleted; |
||
1431 | STemp.StartPoint = instance.StartPoint; |
||
1432 | STemp.EndPoint = instance.EndPoint; |
||
1433 | foreach (var point in instance.PointSet) |
||
1434 | { |
||
1435 | STemp.PointSet.Add(point); |
||
1436 | } |
||
1437 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1438 | }; |
||
1439 | break; |
||
1440 | #endregion |
||
1441 | |||
1442 | #region Inkcontrol |
||
1443 | case "InkControl": |
||
1444 | using (S_PolyControl STemp = new S_PolyControl()) |
||
1445 | { |
||
1446 | var instance = item as InkControl; |
||
1447 | |||
1448 | STemp.TransformPoint = "0|0"; |
||
1449 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1450 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1451 | //STemp.StrokeColor = "#FF000FFF"; |
||
1452 | STemp.Name = instance.GetType().Name.ToString(); |
||
1453 | //STemp.Toler = instance.Toler; |
||
1454 | STemp.PaintState = instance.Paint; |
||
1455 | STemp.Opac = instance.Opacity; |
||
1456 | STemp.UserID = UserId; |
||
1457 | //강인구 추가(Chain인지 Polygon인지 구분) |
||
1458 | STemp.Type = instance.ControlType; |
||
1459 | //STemp.IsTrans = instance.isTransOn; |
||
1460 | //STemp.IsChain = instance.isChain; |
||
1461 | STemp.PointSet = new List<Point>(); |
||
1462 | STemp.DashSize = instance.DashSize; |
||
1463 | STemp.IsCompleted = instance.IsCompleted; |
||
1464 | STemp.StartPoint = instance.StartPoint; |
||
1465 | STemp.EndPoint = instance.EndPoint; |
||
1466 | foreach (var point in instance.PointSet) |
||
1467 | { |
||
1468 | STemp.PointSet.Add(point); |
||
1469 | } |
||
1470 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1471 | }; |
||
1472 | break; |
||
1473 | #endregion |
||
1474 | |||
1475 | #region Cloud |
||
1476 | case "CloudControl": |
||
1477 | using (S_CloudControl STemp = new S_CloudControl()) |
||
1478 | { |
||
1479 | var instance = item as CloudControl; |
||
1480 | |||
1481 | STemp.TransformPoint = "0|0"; |
||
1482 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1483 | //STemp.StrokeColor = "#FF000FFF"; |
||
1484 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1485 | STemp.Name = instance.GetType().Name.ToString(); |
||
1486 | STemp.Toler = instance.Toler; |
||
1487 | STemp.PaintState = instance.Paint; |
||
1488 | STemp.Opac = instance.Opacity; |
||
1489 | STemp.UserID = UserId; |
||
1490 | STemp.IsTrans = instance.isTransOn; |
||
1491 | STemp.IsChain = instance.isChain; |
||
1492 | STemp.PointSet = new List<Point>(); |
||
1493 | STemp.DashSize = instance.DashSize; |
||
1494 | STemp.StartPoint = instance.StartPoint; |
||
1495 | STemp.EndPoint = instance.EndPoint; |
||
1496 | 53393bae | KangIngu | STemp.ArcLength = instance.ArcLength; |
1497 | |||
1498 | 787a4489 | KangIngu | foreach (var point in instance.PointSet) |
1499 | { |
||
1500 | STemp.PointSet.Add(point); |
||
1501 | } |
||
1502 | |||
1503 | //STemp.CloudFill = instance.Fill; |
||
1504 | STemp.ArcLength = instance.ArcLength; |
||
1505 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1506 | } |
||
1507 | break; |
||
1508 | #endregion |
||
1509 | |||
1510 | #endregion |
||
1511 | |||
1512 | #region Text |
||
1513 | #region Text |
||
1514 | case "TextControl": |
||
1515 | using (S_TextControl STemp = new S_TextControl()) |
||
1516 | { |
||
1517 | |||
1518 | var instance = item as TextControl; |
||
1519 | STemp.TransformPoint = "0|0"; |
||
1520 | STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString()); |
||
1521 | STemp.Text = instance.Text; |
||
1522 | STemp.UserID = UserId; |
||
1523 | STemp.FontColor = instance.FontColor.Color.ToString(); |
||
1524 | //STemp.FontColor = "#FFFFFF00"; |
||
1525 | //STemp.EndPoint = instance.EndPoint; |
||
1526 | STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY); |
||
1527 | STemp.Opac = instance.Opacity; |
||
1528 | //STemp.StartPoint = instance.StartPoint; |
||
1529 | STemp.PointSet = instance.PointSet; |
||
1530 | STemp.Angle = instance.Angle; |
||
1531 | STemp.paintMethod = instance.ControlType_No; |
||
1532 | STemp.BoxW = instance.BoxWidth; |
||
1533 | STemp.BoxH = instance.BoxHeight; |
||
1534 | STemp.isHighLight = instance.IsHighLight; |
||
1535 | STemp.Name = instance.GetType().Name.ToString(); |
||
1536 | STemp.fontConfig = new List<string>() |
||
1537 | { |
||
1538 | instance.TextFamily.ToString(), |
||
1539 | instance.TextStyle.ToString(), |
||
1540 | instance.TextWeight.ToString(), |
||
1541 | }; |
||
1542 | |||
1543 | |||
1544 | |||
1545 | if (instance.UnderLine != null) |
||
1546 | { |
||
1547 | STemp.fontConfig.Add("true"); |
||
1548 | } |
||
1549 | |||
1550 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1551 | } |
||
1552 | break; |
||
1553 | #endregion |
||
1554 | #region ArrowText |
||
1555 | case "ArrowTextControl": |
||
1556 | using (S_ArrowTextControl STemp = new S_ArrowTextControl()) |
||
1557 | { |
||
1558 | var instance = item as ArrowTextControl; |
||
1559 | |||
1560 | STemp.TransformPoint = "0|0"; |
||
1561 | STemp.PointSet = instance.PointSet; |
||
1562 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1563 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1564 | STemp.StartPoint = instance.StartPoint; |
||
1565 | STemp.ArrowStyle = instance.ArrowTextStyle; |
||
1566 | //STemp.StrokeColor = "#FF00FF00"; |
||
1567 | STemp.UserID = UserId; |
||
1568 | STemp.ArrowText = instance.Base_TextBox.Text; |
||
1569 | STemp.BorderSize = instance.BorderSize; |
||
1570 | STemp.isHighLight = instance.isHighLight; |
||
1571 | STemp.BoxHeight = instance.BoxHeight; |
||
1572 | STemp.BoxWidth = instance.BoxWidth; |
||
1573 | STemp.Opac = instance.Opacity; |
||
1574 | STemp.EndPoint = instance.EndPoint; |
||
1575 | STemp.isFixed = instance.isFixed; |
||
1576 | //STemp.DashSize = instance.DashSize; |
||
1577 | STemp.Name = instance.GetType().Name.ToString(); |
||
1578 | STemp.isTrans = instance.isTrans; |
||
1579 | STemp.MidPoint = instance.MidPoint; |
||
1580 | STemp.Angle = instance.Angle; |
||
1581 | STemp.fontConfig = new List<string>() |
||
1582 | { |
||
1583 | instance.TextFamily.ToString(), |
||
1584 | instance.TextStyle.ToString(), |
||
1585 | instance.TextWeight.ToString(), |
||
1586 | instance.TextSize.ToString(), |
||
1587 | }; |
||
1588 | e17af42b | KangIngu | |
1589 | if (instance.UnderLine != null) |
||
1590 | { |
||
1591 | STemp.fontConfig.Add("true"); |
||
1592 | } |
||
1593 | |||
1594 | 787a4489 | KangIngu | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1595 | }; |
||
1596 | break; |
||
1597 | #endregion |
||
1598 | #endregion |
||
1599 | |||
1600 | #region ETC |
||
1601 | #region Sign |
||
1602 | case "SignControl": |
||
1603 | { |
||
1604 | using (S_SignControl STemp = new S_SignControl()) |
||
1605 | { |
||
1606 | //SignControl instance = item as SignControl; |
||
1607 | //STemp.Angle = instance.Angle; |
||
1608 | //STemp.EndPoint = instance.EndPoint; |
||
1609 | //STemp.UserID = UserId; |
||
1610 | //STemp.LB = instance.LeftBottomPoint; |
||
1611 | //STemp.Name = instance.GetType().Name; |
||
1612 | //STemp.PointSet = instance.PointSet; |
||
1613 | //STemp.StartPoint = instance.StartPoint; |
||
1614 | //STemp.Opac = instance.Opacity; |
||
1615 | //STemp.TR = instance.TopRightPoint; |
||
1616 | //STemp.UserNumber = instance.UserNumber; |
||
1617 | //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1618 | } |
||
1619 | } |
||
1620 | break; |
||
1621 | #endregion |
||
1622 | #region Ink |
||
1623 | case "InkPresenter": |
||
1624 | { |
||
1625 | var instance = item as InkPresenter; |
||
1626 | if (instance.Strokes.Count >= 1) |
||
1627 | { |
||
1628 | using (S_PensilControl STemp = new S_PensilControl()) |
||
1629 | { |
||
1630 | bool isRealData = true; |
||
1631 | foreach (var strokeData in instance.Strokes) |
||
1632 | { |
||
1633 | if (strokeData.StylusPoints.Count == 0) |
||
1634 | { |
||
1635 | isRealData = false; |
||
1636 | } |
||
1637 | } |
||
1638 | if (isRealData) |
||
1639 | { |
||
1640 | if (instance.Tag != null) |
||
1641 | { |
||
1642 | STemp.UserID = instance.Tag.ToString(); |
||
1643 | } |
||
1644 | STemp.SCC = instance.Strokes; |
||
1645 | STemp.Name = instance.GetType().Name; |
||
1646 | STemp.Opac = instance.Opacity; |
||
1647 | STemp.TransformPoint = "0|0"; |
||
1648 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1649 | } |
||
1650 | } |
||
1651 | } |
||
1652 | } |
||
1653 | break; |
||
1654 | #endregion |
||
1655 | #region Date |
||
1656 | case "DateControl": |
||
1657 | { |
||
1658 | using (S_DateControl STemp = new S_DateControl()) |
||
1659 | { |
||
1660 | DateControl instance = item as DateControl; |
||
1661 | STemp.Angle = instance.Angle; |
||
1662 | STemp.EndPoint = instance.EndPoint; |
||
1663 | STemp.UserID = UserId; |
||
1664 | STemp.LB = instance.LeftBottomPoint; |
||
1665 | STemp.Name = instance.GetType().Name; |
||
1666 | STemp.PointSet = instance.PointSet; |
||
1667 | STemp.StartPoint = instance.StartPoint; |
||
1668 | STemp.Opac = instance.Opacity; |
||
1669 | STemp.TR = instance.TopRightPoint; |
||
1670 | STemp.TransformPoint = "0|0"; |
||
1671 | STemp.FontColor = instance.FontColor.Color.ToString(); |
||
1672 | //STemp.FontColor = "#FFFFFF00"; |
||
1673 | STemp.SizeSet = String.Format("{0}", instance.LineSize); |
||
1674 | STemp.Text = instance.Text; |
||
1675 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1676 | } |
||
1677 | } |
||
1678 | break; |
||
1679 | #endregion |
||
1680 | #region Symbol |
||
1681 | case "SymControl": |
||
1682 | using (S_SymControl STemp = new S_SymControl()) |
||
1683 | { |
||
1684 | var instance = item as SymControl; |
||
1685 | STemp.TransformPoint = "0|0"; |
||
1686 | STemp.PointSet = instance.PointSet; |
||
1687 | STemp.UserID = UserId; |
||
1688 | STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString()); |
||
1689 | STemp.PaintState = instance.Paint; |
||
1690 | STemp.PathInfo = instance.PathData.ToString(); |
||
1691 | STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
||
1692 | STemp.StartPoint = instance.StartPoint; |
||
1693 | STemp.Angle = instance.Angle; |
||
1694 | STemp.EndPoint = instance.EndPoint; |
||
1695 | STemp.LB = instance.LeftBottomPoint; |
||
1696 | STemp.TR = instance.TopRightPoint; |
||
1697 | STemp.Opac = instance.Opacity; |
||
1698 | STemp.Name = instance.GetType().Name.ToString(); |
||
1699 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1700 | } |
||
1701 | break; |
||
1702 | #endregion |
||
1703 | #region SymbolN |
||
1704 | case "SymControlN": |
||
1705 | using (S_SymControlN STemp = new S_SymControlN()) |
||
1706 | { |
||
1707 | var instance = item as SymControlN; |
||
1708 | STemp.TransformPoint = "0|0"; |
||
1709 | STemp.PointSet = instance.PointSet; |
||
1710 | //STemp.XamlData = instance.PathXathData; |
||
1711 | STemp.UserID = UserId; |
||
1712 | b200de5a | KangIngu | STemp.DBData = instance.PathXathData; |
1713 | 787a4489 | KangIngu | //STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1714 | STemp.StartPoint = instance.StartPoint; |
||
1715 | STemp.Angle = instance.Angle; |
||
1716 | STemp.EndPoint = instance.EndPoint; |
||
1717 | STemp.LB = instance.LeftBottomPoint; |
||
1718 | STemp.TR = instance.TopRightPoint; |
||
1719 | STemp.Opac = instance.Opacity; |
||
1720 | STemp.Name = instance.GetType().Name.ToString(); |
||
1721 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1722 | } |
||
1723 | break; |
||
1724 | #endregion |
||
1725 | #region Image |
||
1726 | case "ImgControl": |
||
1727 | using (S_ImgControl STemp = new S_ImgControl()) |
||
1728 | { |
||
1729 | ImgControl instance = item as ImgControl; |
||
1730 | STemp.Angle = instance.Angle; |
||
1731 | STemp.EndPoint = instance.EndPoint; |
||
1732 | STemp.LB = instance.LeftBottomPoint; |
||
1733 | STemp.Name = instance.GetType().Name; |
||
1734 | STemp.PointSet = instance.PointSet; |
||
1735 | STemp.StartPoint = instance.StartPoint; |
||
1736 | STemp.UserID = UserId; |
||
1737 | STemp.Opac = instance.Opacity; |
||
1738 | STemp.TR = instance.TopRightPoint; |
||
1739 | STemp.ImagePath = instance.FilePath; |
||
1740 | ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
1741 | } |
||
1742 | break; |
||
1743 | #endregion |
||
1744 | #endregion |
||
1745 | default: |
||
1746 | break; |
||
1747 | } |
||
1748 | } |
||
1749 | #endregion |
||
1750 | |||
1751 | //return ConvertData; |
||
1752 | return Data; |
||
1753 | } |
||
1754 | |||
1755 | |||
1756 | //GUID생성(최민수 사원 수정) |
||
1757 | public string shortGuid() |
||
1758 | { |
||
1759 | byte[] bytes = new byte[16]; |
||
1760 | using (var provider = System.Security.Cryptography.RandomNumberGenerator.Create()) |
||
1761 | { |
||
1762 | provider.GetBytes(bytes); |
||
1763 | } |
||
1764 | |||
1765 | var guid = new Guid(bytes); |
||
1766 | |||
1767 | return Convert.ToBase64String(guid.ToByteArray()) |
||
1768 | .Substring(0, 10) |
||
1769 | .Replace("/", "") |
||
1770 | .Replace("+", "") + DateTime.UtcNow.Ticks.ToString("x"); |
||
1771 | } |
||
1772 | |||
1773 | //GUID생성 |
||
1774 | //안쓰는 내용 |
||
1775 | public Guid GetUniqueGuid() |
||
1776 | { |
||
1777 | char[] chars = "ABCDEF1234567890".ToCharArray(); |
||
1778 | byte[] data = new byte[1]; |
||
1779 | System.Security.Cryptography.RNGCryptoServiceProvider crypto = new System.Security.Cryptography.RNGCryptoServiceProvider(); |
||
1780 | crypto.GetNonZeroBytes(data); |
||
1781 | data = new byte[32]; |
||
1782 | crypto.GetNonZeroBytes(data); |
||
1783 | StringBuilder result = new StringBuilder(32); |
||
1784 | |||
1785 | foreach (byte b in data) |
||
1786 | { |
||
1787 | result.Append(chars[b % (chars.Length - 1)]); |
||
1788 | } |
||
1789 | |||
1790 | return Guid.ParseExact(result.ToString(0, 8) + "-" + result.ToString(8, 4) + "-" + result.ToString(11, 4) + "-" |
||
1791 | + result.ToString(16, 4) + "-" + result.ToString(20, 12), "D"); |
||
1792 | } |
||
1793 | |||
1794 | ///강인구 추가(2017.11.02) |
||
1795 | ///DATA_TYPE추가로 인한 클래스 변수 추가 |
||
1796 | //markup_Data.DATA = MarkupString; |
||
1797 | public class MarkupReturn |
||
1798 | { |
||
1799 | public string ConvertData { get; set; } |
||
1800 | public int DATA_TYPE { get; set; } |
||
1801 | |||
1802 | public string CommentID { get; set; } |
||
1803 | } |
||
1804 | |||
1805 | //GUID생성 |
||
1806 | //public Guid GetUniqueGuid() |
||
1807 | //{ |
||
1808 | // char[] chars = "ABCDEF1234567890".ToCharArray(); |
||
1809 | // byte[] data = new byte[1]; |
||
1810 | // System.Security.Cryptography.RNGCryptoServiceProvider crypto = new System.Security.Cryptography.RNGCryptoServiceProvider(); |
||
1811 | // crypto.GetNonZeroBytes(data); |
||
1812 | // data = new byte[32]; |
||
1813 | // crypto.GetNonZeroBytes(data); |
||
1814 | // StringBuilder result = new StringBuilder(32); |
||
1815 | |||
1816 | // foreach (byte b in data) |
||
1817 | // { |
||
1818 | // result.Append(chars[b % (chars.Length - 1)]); |
||
1819 | // } |
||
1820 | |||
1821 | // return Guid.ParseExact(result.ToString(0, 8) + "-" + result.ToString(8, 4) + "-" + result.ToString(11, 4) + "-" |
||
1822 | // + result.ToString(16, 4) + "-" + result.ToString(20, 12), "D"); |
||
1823 | //} |
||
1824 | } |
||
1825 | } |