markus / MarkupToPDF / Controls / Parsing / MarkupCopy.cs @ f8769f8a
이력 | 보기 | 이력해설 | 다운로드 (96.5 KB)
1 |
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 |
#region ArrowArc |
629 |
case "ArrowArcControl": |
630 |
using (S_ArrowArcControl STemp = new S_ArrowArcControl()) |
631 |
{ |
632 |
var instance = Control as ArrowArcControl; |
633 |
STemp.TransformPoint = "0|0"; |
634 |
STemp.PointSet = instance.PointSet; |
635 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
636 |
//STemp.StrokeColor = "#FF000FFF"; |
637 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
638 |
STemp.StartPoint = instance.StartPoint; |
639 |
STemp.UserID = UserId; |
640 |
STemp.Opac = instance.Opacity; |
641 |
STemp.MidPoint = instance.MidPoint; |
642 |
STemp.EndPoint = instance.EndPoint; |
643 |
STemp.IsTransOn = instance.isTransOn; |
644 |
STemp.DashSize = instance.DashSize; |
645 |
STemp.Clock = instance.Clock; |
646 |
//STemp.ArcStyleSet = instance.ControlType; |
647 |
STemp.Name = instance.GetType().Name.ToString(); |
648 |
|
649 |
///강인구 추가(2017.11.02) |
650 |
///Memo 추가 |
651 |
STemp.Memo = instance.Memo; |
652 |
|
653 |
///강인구 추가(2017.11.02) |
654 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
655 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
656 |
Data.DATA_TYPE = (int)(instance.ControlType); |
657 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
658 |
|
659 |
}; |
660 |
break; |
661 |
#endregion |
662 |
#endregion |
663 |
#region Shape |
664 |
#region RectCloud |
665 |
case "RectCloudControl": |
666 |
{ |
667 |
using (S_RectCloudControl STemp = new S_RectCloudControl()) |
668 |
{ |
669 |
var instance = Control as RectCloudControl; |
670 |
STemp.TransformPoint = "0|0"; |
671 |
STemp.PointSet = instance.PointSet; |
672 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
673 |
//STemp.StrokeColor = "#FF00FF00"; |
674 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
675 |
STemp.StartPoint = instance.StartPoint; |
676 |
STemp.UserID = UserId; |
677 |
STemp.Opac = instance.Opacity; |
678 |
STemp.TR = instance.TopRightPoint; |
679 |
STemp.LB = instance.LeftBottomPoint; |
680 |
STemp.EndPoint = instance.EndPoint; |
681 |
STemp.PaintState = instance.Paint; |
682 |
STemp.DashSize = instance.DashSize; |
683 |
STemp.ArcLength = instance.ArcLength; |
684 |
STemp.Name = instance.GetType().Name.ToString(); |
685 |
///강인구 추가(2017.11.02) |
686 |
///Memo 추가 |
687 |
STemp.Memo = instance.Memo; |
688 |
|
689 |
///강인구 추가(2017.11.02) |
690 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
691 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
692 |
Data.DATA_TYPE = (int)(instance.ControlType); |
693 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
694 |
} |
695 |
} |
696 |
break; |
697 |
#endregion |
698 |
#region Circle |
699 |
case "CircleControl": |
700 |
using (S_CircleControl STemp = new S_CircleControl()) |
701 |
{ |
702 |
var instance = Control as CircleControl; |
703 |
STemp.TransformPoint = "0|0"; |
704 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
705 |
STemp.PaintState = instance.Paint; |
706 |
//STemp.StrokeColor = "#FF00FF00"; |
707 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
708 |
if (instance.FillColor != null) |
709 |
{ |
710 |
STemp.FillColor = instance.FillColor.Color.ToString(); |
711 |
} |
712 |
STemp.StartPoint = instance.StartPoint; |
713 |
STemp.UserID = UserId; |
714 |
STemp.EndPoint = instance.EndPoint; |
715 |
STemp.TRP = instance.TopRightPoint; |
716 |
STemp.LBP = instance.LeftBottomPoint; |
717 |
STemp.Opac = instance.Opacity; |
718 |
STemp.Angle = instance.Angle; |
719 |
STemp.PointSet = instance.PointSet; |
720 |
STemp.DashSize = instance.DashSize; |
721 |
STemp.Name = instance.GetType().Name.ToString(); |
722 |
///강인구 추가(2017.11.02) |
723 |
///Memo 추가 |
724 |
STemp.Memo = instance.Memo; |
725 |
|
726 |
///강인구 추가(2017.11.02) |
727 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
728 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
729 |
Data.DATA_TYPE = (int)(instance.ControlType); |
730 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
731 |
}; |
732 |
break; |
733 |
#endregion |
734 |
#region Rectangle |
735 |
case "RectangleControl": |
736 |
using (S_RectControl STemp = new S_RectControl()) |
737 |
{ |
738 |
var instance = Control as RectangleControl; |
739 |
STemp.TransformPoint = "0|0"; |
740 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
741 |
STemp.PaintState = instance.Paint; |
742 |
STemp.PointSet = instance.PointSet; |
743 |
//STemp.StrokeColor = "#FF00FF00"; |
744 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
745 |
if (instance.FillColor != null) |
746 |
{ |
747 |
STemp.FillColor = instance.FillColor.Color.ToString(); |
748 |
} |
749 |
STemp.StartPoint = instance.StartPoint; |
750 |
STemp.UserID = UserId; |
751 |
//STemp.Angle = instance.a; |
752 |
STemp.EndPoint = instance.EndPoint; |
753 |
STemp.LB = instance.LeftBottomPoint; |
754 |
STemp.TR = instance.TopRightPoint; |
755 |
STemp.DashSize = instance.DashSize; |
756 |
STemp.Opac = instance.Opacity; |
757 |
STemp.Name = instance.GetType().Name.ToString(); |
758 |
///강인구 추가(2017.11.02) |
759 |
///Memo 추가 |
760 |
STemp.Memo = instance.Memo; |
761 |
|
762 |
///강인구 추가(2017.11.02) |
763 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
764 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
765 |
Data.DATA_TYPE = (int)(instance.ControlType); |
766 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
767 |
}; |
768 |
break; |
769 |
#endregion |
770 |
#region Triangle |
771 |
case "TriControl": |
772 |
using (S_TriControl STemp = new S_TriControl()) |
773 |
{ |
774 |
var instance = Control as TriControl; |
775 |
STemp.TransformPoint = "0|0"; |
776 |
STemp.Paint = instance.Paint; |
777 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
778 |
//STemp.StrokeColor = "#FF00FF00"; |
779 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
780 |
if (instance.FillColor != null) |
781 |
{ |
782 |
STemp.FillColor = instance.FillColor.Color.ToString(); |
783 |
} |
784 |
STemp.StartPoint = instance.StartPoint; |
785 |
STemp.EndPoint = instance.EndPoint; |
786 |
STemp.MidPoint = instance.MidPoint; |
787 |
STemp.Opac = instance.Opacity; |
788 |
STemp.UserID = UserId; |
789 |
STemp.PointSet = instance.PointSet; |
790 |
STemp.Angle = instance.Angle; |
791 |
STemp.DashSize = instance.DashSize; |
792 |
STemp.Name = instance.GetType().Name.ToString(); |
793 |
///강인구 추가(2017.11.02) |
794 |
///Memo 추가 |
795 |
STemp.Memo = instance.Memo; |
796 |
|
797 |
///강인구 추가(2017.11.02) |
798 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
799 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
800 |
Data.DATA_TYPE = (int)(instance.ControlType); |
801 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
802 |
} |
803 |
break; |
804 |
#endregion |
805 |
#endregion |
806 |
|
807 |
#region Polygon |
808 |
#region Poly |
809 |
case "PolygonControl": |
810 |
using (S_PolyControl STemp = new S_PolyControl()) |
811 |
{ |
812 |
var instance = Control as PolygonControl; |
813 |
|
814 |
STemp.TransformPoint = "0|0"; |
815 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
816 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
817 |
//STemp.StrokeColor = "#FF000FFF"; |
818 |
STemp.Name = instance.GetType().Name.ToString(); |
819 |
//STemp.Toler = instance.Toler; |
820 |
STemp.PaintState = instance.Paint; |
821 |
STemp.Opac = instance.Opacity; |
822 |
STemp.UserID = UserId; |
823 |
STemp.PaintState = instance.Paint; |
824 |
//강인구 추가(Chain인지 Polygon인지 구분) |
825 |
STemp.Type = instance.ControlType; |
826 |
//STemp.IsTrans = instance.isTransOn; |
827 |
//STemp.IsChain = instance.isChain; |
828 |
STemp.PointSet = new List<Point>(); |
829 |
STemp.DashSize = instance.DashSize; |
830 |
STemp.StartPoint = instance.StartPoint; |
831 |
STemp.EndPoint = instance.EndPoint; |
832 |
STemp.IsCompleted = instance.IsCompleted; |
833 |
foreach (var point in instance.PointSet) |
834 |
{ |
835 |
STemp.PointSet.Add(point); |
836 |
} |
837 |
///강인구 추가(2017.11.02) |
838 |
///Memo 추가 |
839 |
STemp.Memo = instance.Memo; |
840 |
|
841 |
///강인구 추가(2017.11.02) |
842 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
843 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
844 |
Data.DATA_TYPE = (int)(instance.ControlType); |
845 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
846 |
}; |
847 |
break; |
848 |
#endregion |
849 |
|
850 |
#region InkControl |
851 |
case "InkControl": |
852 |
using (S_PolyControl STemp = new S_PolyControl()) |
853 |
{ |
854 |
var instance = Control as InkControl; |
855 |
|
856 |
STemp.TransformPoint = "0|0"; |
857 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
858 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
859 |
//STemp.StrokeColor = "#FF000FFF"; |
860 |
STemp.Name = instance.GetType().Name.ToString(); |
861 |
//STemp.Toler = instance.Toler; |
862 |
STemp.PaintState = instance.Paint; |
863 |
STemp.Opac = instance.Opacity; |
864 |
STemp.UserID = UserId; |
865 |
STemp.PaintState = instance.Paint; |
866 |
//강인구 추가(Chain인지 Polygon인지 구분) |
867 |
STemp.Type = instance.ControlType; |
868 |
//STemp.IsTrans = instance.isTransOn; |
869 |
//STemp.IsChain = instance.isChain; |
870 |
STemp.PointSet = new List<Point>(); |
871 |
STemp.DashSize = instance.DashSize; |
872 |
STemp.IsCompleted = instance.IsCompleted; |
873 |
STemp.StartPoint = instance.StartPoint; |
874 |
STemp.EndPoint = instance.EndPoint; |
875 |
foreach (var point in instance.PointSet) |
876 |
{ |
877 |
STemp.PointSet.Add(point); |
878 |
} |
879 |
///강인구 추가(2017.11.02) |
880 |
///Memo 추가 |
881 |
STemp.Memo = instance.Memo; |
882 |
|
883 |
///강인구 추가(2017.11.02) |
884 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
885 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
886 |
Data.DATA_TYPE = (int)(instance.ControlType); |
887 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
888 |
}; |
889 |
break; |
890 |
#endregion |
891 |
|
892 |
#region Cloud |
893 |
case "CloudControl": |
894 |
using (S_CloudControl STemp = new S_CloudControl()) |
895 |
{ |
896 |
var instance = Control as CloudControl; |
897 |
|
898 |
STemp.TransformPoint = "0|0"; |
899 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
900 |
//STemp.StrokeColor = "#FF000FFF"; |
901 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
902 |
STemp.Name = instance.GetType().Name.ToString(); |
903 |
STemp.Toler = instance.Toler; |
904 |
STemp.PaintState = instance.Paint; |
905 |
STemp.Opac = instance.Opacity; |
906 |
STemp.UserID = UserId; |
907 |
STemp.IsTrans = instance.isTransOn; |
908 |
STemp.IsChain = instance.isChain; |
909 |
STemp.PointSet = new List<Point>(); |
910 |
STemp.DashSize = instance.DashSize; |
911 |
STemp.StartPoint = instance.StartPoint; |
912 |
STemp.EndPoint = instance.EndPoint; |
913 |
STemp.ArcLength = instance.ArcLength; |
914 |
foreach (var point in instance.PointSet) |
915 |
{ |
916 |
STemp.PointSet.Add(point); |
917 |
} |
918 |
|
919 |
//STemp.CloudFill = instance.Fill; |
920 |
STemp.ArcLength = instance.ArcLength; |
921 |
///강인구 추가(2017.11.02) |
922 |
///Memo 추가 |
923 |
STemp.Memo = instance.Memo; |
924 |
|
925 |
///강인구 추가(2017.11.02) |
926 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
927 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
928 |
Data.DATA_TYPE = (int)(instance.ControlType); |
929 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
930 |
} |
931 |
break; |
932 |
#endregion |
933 |
#endregion |
934 |
|
935 |
#region Text |
936 |
#region Text |
937 |
case "TextControl": |
938 |
using (S_TextControl STemp = new S_TextControl()) |
939 |
{ |
940 |
|
941 |
var instance = Control as TextControl; |
942 |
STemp.TransformPoint = "0|0"; |
943 |
STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString()); |
944 |
STemp.Text = instance.Text; |
945 |
STemp.UserID = UserId; |
946 |
STemp.FontColor = instance.FontColor.Color.ToString(); |
947 |
//STemp.FontColor = "#FFFFFF00"; |
948 |
|
949 |
if(instance.StartPoint == new Point()) |
950 |
STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY); |
951 |
else |
952 |
STemp.StartPoint = instance.StartPoint; |
953 |
|
954 |
STemp.EndPoint = instance.EndPoint; |
955 |
STemp.Opac = instance.Opacity; |
956 |
STemp.PointSet = instance.PointSet; |
957 |
STemp.Angle = instance.Angle; |
958 |
STemp.paintMethod = instance.ControlType_No; |
959 |
STemp.BoxW = instance.BoxWidth; |
960 |
STemp.BoxH = instance.BoxHeight; |
961 |
STemp.isHighLight = instance.IsHighLight; |
962 |
STemp.Name = instance.GetType().Name.ToString(); |
963 |
STemp.fontConfig = new List<string>() |
964 |
{ |
965 |
instance.TextFamily.ToString(), |
966 |
instance.TextStyle.ToString(), |
967 |
instance.TextWeight.ToString(), |
968 |
}; |
969 |
|
970 |
|
971 |
|
972 |
if (instance.UnderLine != null) |
973 |
{ |
974 |
STemp.fontConfig.Add("true"); |
975 |
} |
976 |
|
977 |
///강인구 추가(2017.11.02) |
978 |
///Memo 추가 |
979 |
STemp.Memo = instance.Memo; |
980 |
|
981 |
///강인구 추가(2017.11.02) |
982 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
983 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
984 |
Data.DATA_TYPE = (int)(instance.ControlType); |
985 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
986 |
} |
987 |
break; |
988 |
#endregion |
989 |
#region ArrowText |
990 |
case "ArrowTextControl": |
991 |
using (S_ArrowTextControl STemp = new S_ArrowTextControl()) |
992 |
{ |
993 |
var instance = Control as ArrowTextControl; |
994 |
|
995 |
STemp.TransformPoint = "0|0"; |
996 |
STemp.PointSet = instance.PointSet; |
997 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
998 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
999 |
STemp.StartPoint = instance.StartPoint; |
1000 |
STemp.ArrowStyle = instance.ArrowTextStyle; |
1001 |
//STemp.StrokeColor = "#FF00FF00"; |
1002 |
STemp.UserID = UserId; |
1003 |
STemp.ArrowText = instance.Base_TextBox.Text; |
1004 |
STemp.BorderSize = instance.BorderSize; |
1005 |
STemp.isHighLight = instance.isHighLight; |
1006 |
STemp.BoxHeight = instance.BoxHeight; |
1007 |
STemp.BoxWidth = instance.BoxWidth; |
1008 |
STemp.Opac = instance.Opacity; |
1009 |
STemp.EndPoint = instance.EndPoint; |
1010 |
STemp.isFixed = instance.isFixed; |
1011 |
//STemp.DashSize = instance.DashSize; |
1012 |
STemp.Name = instance.GetType().Name.ToString(); |
1013 |
STemp.isTrans = instance.isTrans; |
1014 |
STemp.MidPoint = instance.MidPoint; |
1015 |
STemp.Angle = instance.Angle; |
1016 |
STemp.fontConfig = new List<string>() |
1017 |
{ |
1018 |
instance.TextFamily.ToString(), |
1019 |
instance.TextStyle.ToString(), |
1020 |
instance.TextWeight.ToString(), |
1021 |
instance.TextSize.ToString(), |
1022 |
}; |
1023 |
|
1024 |
if (instance.UnderLine != null) |
1025 |
{ |
1026 |
STemp.fontConfig.Add("true"); |
1027 |
} |
1028 |
|
1029 |
///강인구 추가(2017.11.02) |
1030 |
///Memo 추가 |
1031 |
STemp.Memo = instance.Memo; |
1032 |
STemp.BorderSize = instance.BorderSize; |
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 |
break; |
1040 |
#endregion |
1041 |
#endregion |
1042 |
|
1043 |
#region ETC |
1044 |
#region Sign |
1045 |
case "SignControl": |
1046 |
{ |
1047 |
//강인구 추가 |
1048 |
using (S_SignControl STemp = new S_SignControl()) |
1049 |
{ |
1050 |
SignControl instance = Control as SignControl; |
1051 |
STemp.Angle = instance.Angle; |
1052 |
STemp.EndPoint = instance.EndPoint; |
1053 |
STemp.UserID = UserId; |
1054 |
STemp.LB = instance.LeftBottomPoint; |
1055 |
STemp.Name = instance.GetType().Name; |
1056 |
STemp.PointSet = instance.PointSet; |
1057 |
STemp.StartPoint = instance.StartPoint; |
1058 |
STemp.Opac = instance.Opacity; |
1059 |
STemp.TR = instance.TopRightPoint; |
1060 |
STemp.UserNumber = instance.UserNumber == null ? UserId : instance.UserNumber; |
1061 |
|
1062 |
///강인구 추가(2017.11.02) |
1063 |
///Memo 추가 |
1064 |
STemp.Memo = instance.Memo; |
1065 |
|
1066 |
///강인구 추가(2017.11.02) |
1067 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
1068 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1069 |
Data.DATA_TYPE = (int)(instance.ControlType); |
1070 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1071 |
} |
1072 |
} |
1073 |
break; |
1074 |
#endregion |
1075 |
|
1076 |
|
1077 |
//변경 필요 |
1078 |
#region Ink |
1079 |
case "InkPresenter": |
1080 |
{ |
1081 |
//var instance = item as InkPresenter; |
1082 |
//if (instance.Strokes.Count >= 1) |
1083 |
//{ |
1084 |
// using (S_PensilControl STemp = new S_PensilControl()) |
1085 |
// { |
1086 |
// bool isRealData = true; |
1087 |
// foreach (var strokeData in instance.Strokes) |
1088 |
// { |
1089 |
// if (strokeData.StylusPoints.Count == 0) |
1090 |
// { |
1091 |
// isRealData = false; |
1092 |
// } |
1093 |
// } |
1094 |
// if (isRealData) |
1095 |
// { |
1096 |
// if (instance.Tag != null) |
1097 |
// { |
1098 |
// STemp.UserID = instance.Tag.ToString(); |
1099 |
// } |
1100 |
// STemp.SCC = instance.Strokes; |
1101 |
// STemp.Name = instance.GetType().Name; |
1102 |
// STemp.Opac = instance.Opacity; |
1103 |
// STemp.TransformPoint = "0|0"; |
1104 |
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1105 |
// } |
1106 |
// } |
1107 |
//} |
1108 |
} |
1109 |
break; |
1110 |
#endregion |
1111 |
#region Date |
1112 |
case "DateControl": |
1113 |
{ |
1114 |
using (S_DateControl STemp = new S_DateControl()) |
1115 |
{ |
1116 |
DateControl instance = Control as DateControl; |
1117 |
STemp.Angle = instance.Angle; |
1118 |
STemp.EndPoint = instance.EndPoint; |
1119 |
STemp.UserID = UserId; |
1120 |
STemp.LB = instance.LeftBottomPoint; |
1121 |
STemp.Name = instance.GetType().Name; |
1122 |
STemp.PointSet = instance.PointSet; |
1123 |
STemp.StartPoint = instance.StartPoint; |
1124 |
STemp.Opac = instance.Opacity; |
1125 |
STemp.TR = instance.TopRightPoint; |
1126 |
STemp.TransformPoint = "0|0"; |
1127 |
STemp.FontColor = instance.FontColor.Color.ToString(); |
1128 |
//STemp.FontColor = "#FFFFFF00"; |
1129 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1130 |
STemp.Text = instance.Text; |
1131 |
///강인구 추가(2017.11.02) |
1132 |
///Memo 추가 |
1133 |
STemp.Memo = instance.Memo; |
1134 |
|
1135 |
///강인구 추가(2017.11.02) |
1136 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
1137 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1138 |
Data.DATA_TYPE = (int)(instance.ControlType); |
1139 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1140 |
} |
1141 |
} |
1142 |
break; |
1143 |
#endregion |
1144 |
#region Symbol |
1145 |
case "SymControl": |
1146 |
using (S_SymControl STemp = new S_SymControl()) |
1147 |
{ |
1148 |
var instance = Control as SymControl; |
1149 |
STemp.TransformPoint = "0|0"; |
1150 |
STemp.PointSet = instance.PointSet; |
1151 |
STemp.UserID = UserId; |
1152 |
STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString()); |
1153 |
STemp.PaintState = instance.Paint; |
1154 |
STemp.PathInfo = instance.PathData.ToString(); |
1155 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1156 |
STemp.StartPoint = instance.StartPoint; |
1157 |
STemp.Angle = instance.Angle; |
1158 |
STemp.EndPoint = instance.EndPoint; |
1159 |
STemp.LB = instance.LeftBottomPoint; |
1160 |
STemp.TR = instance.TopRightPoint; |
1161 |
STemp.Opac = instance.Opacity; |
1162 |
STemp.Name = instance.GetType().Name.ToString(); |
1163 |
|
1164 |
///강인구 추가(2017.11.02) |
1165 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
1166 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1167 |
Data.DATA_TYPE = (int)(instance.ControlType); |
1168 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1169 |
} |
1170 |
break; |
1171 |
#endregion |
1172 |
#region SymbolN |
1173 |
case "SymControlN": |
1174 |
using (S_SymControlN STemp = new S_SymControlN()) |
1175 |
{ |
1176 |
var instance = Control as SymControlN; |
1177 |
STemp.TransformPoint = "0|0"; |
1178 |
STemp.PointSet = instance.PointSet; |
1179 |
//STemp.XamlData = instance.PathXathData; |
1180 |
STemp.UserID = UserId; |
1181 |
STemp.DBData = instance.PathXathData; |
1182 |
//STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1183 |
STemp.StartPoint = instance.StartPoint; |
1184 |
STemp.Angle = instance.Angle; |
1185 |
STemp.EndPoint = instance.EndPoint; |
1186 |
STemp.LB = instance.LeftBottomPoint; |
1187 |
STemp.TR = instance.TopRightPoint; |
1188 |
STemp.Opac = instance.Opacity; |
1189 |
STemp.Name = instance.GetType().Name.ToString(); |
1190 |
|
1191 |
///강인구 추가(2017.11.02) |
1192 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
1193 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1194 |
Data.DATA_TYPE = (int)(instance.ControlType); |
1195 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1196 |
} |
1197 |
break; |
1198 |
#endregion |
1199 |
#region Image |
1200 |
case "ImgControl": |
1201 |
using (S_ImgControl STemp = new S_ImgControl()) |
1202 |
{ |
1203 |
ImgControl instance = Control as ImgControl; |
1204 |
STemp.Angle = instance.Angle; |
1205 |
STemp.EndPoint = instance.EndPoint; |
1206 |
STemp.LB = instance.LeftBottomPoint; |
1207 |
STemp.Name = instance.GetType().Name; |
1208 |
STemp.PointSet = instance.PointSet; |
1209 |
STemp.StartPoint = instance.StartPoint; |
1210 |
STemp.UserID = UserId; |
1211 |
STemp.Opac = instance.Opacity; |
1212 |
STemp.TR = instance.TopRightPoint; |
1213 |
STemp.ImagePath = instance.FilePath; |
1214 |
///강인구 추가(2017.11.02) |
1215 |
///Memo 추가 |
1216 |
STemp.Memo = instance.Memo; |
1217 |
|
1218 |
///강인구 추가(2017.11.02) |
1219 |
///DATA_TYPE추가로 인한 클래스 변수 대입 |
1220 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1221 |
Data.DATA_TYPE = (int)(instance.ControlType); |
1222 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1223 |
} |
1224 |
break; |
1225 |
#endregion |
1226 |
#endregion |
1227 |
default: |
1228 |
break; |
1229 |
} |
1230 |
|
1231 |
#endregion |
1232 |
|
1233 |
//return ConvertData; |
1234 |
return Data; |
1235 |
} |
1236 |
|
1237 |
public MarkupReturn MarkupToString(ObservableCollection<Control> baseLayer, string UserId) |
1238 |
{ |
1239 |
MarkupReturn Data = new MarkupReturn(); |
1240 |
Data.ConvertData = ""; |
1241 |
Data.DATA_TYPE = 0; |
1242 |
|
1243 |
String ConvertData = ""; |
1244 |
//int DATA_TYPE = 0; |
1245 |
|
1246 |
#region ######### 마크업 파싱########## |
1247 |
foreach (UIElement item in baseLayer) |
1248 |
{ |
1249 |
switch (item.GetType().Name.ToString()) |
1250 |
{ |
1251 |
#region Line |
1252 |
#region Arrow_Multi |
1253 |
case "ArrowControl_Multi": |
1254 |
using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi()) |
1255 |
{ |
1256 |
var instance = item as ArrowControl_Multi; |
1257 |
STemp.TransformPoint = "0|0"; |
1258 |
STemp.PointSet = instance.PointSet; |
1259 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1260 |
//STemp.StrokeColor = "#FF00FF00"; |
1261 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1262 |
STemp.StartPoint = instance.StartPoint; |
1263 |
STemp.EndPoint = instance.EndPoint; |
1264 |
STemp.UserID = UserId; |
1265 |
STemp.Opac = instance.Opacity; |
1266 |
STemp.DashSize = instance.DashSize; |
1267 |
STemp.MidPoint = instance.MiddlePoint; |
1268 |
STemp.Name = instance.GetType().Name.ToString(); |
1269 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1270 |
}; |
1271 |
break; |
1272 |
#endregion |
1273 |
#region Line |
1274 |
case "LineControl": |
1275 |
using (S_LineControl STemp = new S_LineControl()) |
1276 |
{ |
1277 |
var instance = item as LineControl; |
1278 |
|
1279 |
//Data Type 테스트 |
1280 |
Data.DATA_TYPE = (int)(instance.ControlType); |
1281 |
|
1282 |
STemp.TransformPoint = "0|0"; |
1283 |
STemp.PointSet = instance.PointSet; |
1284 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1285 |
STemp.LineStyleSet = instance.LineStyleSet; |
1286 |
//STemp.StrokeColor = "#FF00FF00"; |
1287 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1288 |
STemp.StartPoint = instance.StartPoint; |
1289 |
STemp.EndPoint = instance.EndPoint; |
1290 |
STemp.UserID = UserId; |
1291 |
STemp.Opac = instance.Opacity; |
1292 |
STemp.DashSize = instance.DashSize; |
1293 |
STemp.Interval = instance.Interval; |
1294 |
STemp.DimSize = instance.DimSize; |
1295 |
STemp.Name = instance.GetType().Name.ToString(); |
1296 |
|
1297 |
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1298 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1299 |
}; |
1300 |
break; |
1301 |
#endregion |
1302 |
#region Arc |
1303 |
case "ArcControl": |
1304 |
using (S_ArcControl STemp = new S_ArcControl()) |
1305 |
{ |
1306 |
var instance = item as ArcControl; |
1307 |
STemp.TransformPoint = "0|0"; |
1308 |
STemp.PointSet = instance.PointSet; |
1309 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1310 |
//STemp.StrokeColor = "#FF000FFF"; |
1311 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1312 |
STemp.StartPoint = instance.StartPoint; |
1313 |
STemp.UserID = UserId; |
1314 |
STemp.Opac = instance.Opacity; |
1315 |
STemp.MidPoint = instance.MidPoint; |
1316 |
STemp.EndPoint = instance.EndPoint; |
1317 |
STemp.IsTransOn = instance.isTransOn; |
1318 |
STemp.DashSize = instance.DashSize; |
1319 |
STemp.Clock = instance.Clock; |
1320 |
//STemp.ArcStyleSet = instance.ControlType; |
1321 |
STemp.Name = instance.GetType().Name.ToString(); |
1322 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1323 |
}; |
1324 |
break; |
1325 |
#endregion |
1326 |
#region ArrowArc |
1327 |
case "ArrowArcControl": |
1328 |
using (S_ArrowArcControl STemp = new S_ArrowArcControl()) |
1329 |
{ |
1330 |
var instance = item as ArrowArcControl; |
1331 |
STemp.TransformPoint = "0|0"; |
1332 |
STemp.PointSet = instance.PointSet; |
1333 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1334 |
//STemp.StrokeColor = "#FF000FFF"; |
1335 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1336 |
STemp.StartPoint = instance.StartPoint; |
1337 |
STemp.UserID = UserId; |
1338 |
STemp.Opac = instance.Opacity; |
1339 |
STemp.MidPoint = instance.MidPoint; |
1340 |
STemp.EndPoint = instance.EndPoint; |
1341 |
STemp.IsTransOn = instance.isTransOn; |
1342 |
STemp.DashSize = instance.DashSize; |
1343 |
STemp.Clock = instance.Clock; |
1344 |
//STemp.ArcStyleSet = instance.ControlType; |
1345 |
STemp.Name = instance.GetType().Name.ToString(); |
1346 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1347 |
}; |
1348 |
break; |
1349 |
#endregion |
1350 |
#endregion |
1351 |
#region Shape |
1352 |
#region RectCloud |
1353 |
case "RectCloudControl": |
1354 |
{ |
1355 |
using (S_RectCloudControl STemp = new S_RectCloudControl()) |
1356 |
{ |
1357 |
var instance = item as RectCloudControl; |
1358 |
STemp.TransformPoint = "0|0"; |
1359 |
STemp.PointSet = instance.PointSet; |
1360 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1361 |
//STemp.StrokeColor = "#FF00FF00"; |
1362 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1363 |
STemp.StartPoint = instance.StartPoint; |
1364 |
STemp.UserID = UserId; |
1365 |
STemp.Opac = instance.Opacity; |
1366 |
STemp.TR = instance.TopRightPoint; |
1367 |
STemp.LB = instance.LeftBottomPoint; |
1368 |
STemp.EndPoint = instance.EndPoint; |
1369 |
STemp.PaintState = instance.Paint; |
1370 |
STemp.DashSize = instance.DashSize; |
1371 |
STemp.Name = instance.GetType().Name.ToString(); |
1372 |
STemp.ArcLength = instance.ArcLength; |
1373 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1374 |
} |
1375 |
} |
1376 |
break; |
1377 |
#endregion |
1378 |
#region Circle |
1379 |
case "CircleControl": |
1380 |
using (S_CircleControl STemp = new S_CircleControl()) |
1381 |
{ |
1382 |
var instance = item as CircleControl; |
1383 |
STemp.TransformPoint = "0|0"; |
1384 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1385 |
STemp.PaintState = instance.Paint; |
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.UserID = UserId; |
1394 |
STemp.EndPoint = instance.EndPoint; |
1395 |
STemp.TRP = instance.TopRightPoint; |
1396 |
STemp.LBP = instance.LeftBottomPoint; |
1397 |
STemp.Opac = instance.Opacity; |
1398 |
STemp.Angle = instance.Angle; |
1399 |
STemp.PointSet = instance.PointSet; |
1400 |
STemp.DashSize = instance.DashSize; |
1401 |
STemp.Name = instance.GetType().Name.ToString(); |
1402 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1403 |
}; |
1404 |
break; |
1405 |
#endregion |
1406 |
#region Rectangle |
1407 |
case "RectangleControl": |
1408 |
using (S_RectControl STemp = new S_RectControl()) |
1409 |
{ |
1410 |
var instance = item as RectangleControl; |
1411 |
STemp.TransformPoint = "0|0"; |
1412 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1413 |
STemp.PaintState = instance.Paint; |
1414 |
STemp.PointSet = instance.PointSet; |
1415 |
//STemp.StrokeColor = "#FF00FF00"; |
1416 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1417 |
if (instance.FillColor != null) |
1418 |
{ |
1419 |
STemp.FillColor = instance.FillColor.Color.ToString(); |
1420 |
} |
1421 |
STemp.StartPoint = instance.StartPoint; |
1422 |
STemp.UserID = UserId; |
1423 |
STemp.Angle = instance.Angle; |
1424 |
STemp.EndPoint = instance.EndPoint; |
1425 |
STemp.LB = instance.LeftBottomPoint; |
1426 |
STemp.TR = instance.TopRightPoint; |
1427 |
STemp.DashSize = instance.DashSize; |
1428 |
STemp.Opac = instance.Opacity; |
1429 |
STemp.Name = instance.GetType().Name.ToString(); |
1430 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1431 |
}; |
1432 |
break; |
1433 |
#endregion |
1434 |
#region Triangle |
1435 |
case "TriControl": |
1436 |
using (S_TriControl STemp = new S_TriControl()) |
1437 |
{ |
1438 |
var instance = item as TriControl; |
1439 |
STemp.TransformPoint = "0|0"; |
1440 |
STemp.Paint = instance.Paint; |
1441 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1442 |
//STemp.StrokeColor = "#FF00FF00"; |
1443 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1444 |
if (instance.FillColor != null) |
1445 |
{ |
1446 |
STemp.FillColor = instance.FillColor.Color.ToString(); |
1447 |
} |
1448 |
STemp.StartPoint = instance.StartPoint; |
1449 |
STemp.EndPoint = instance.EndPoint; |
1450 |
STemp.MidPoint = instance.MidPoint; |
1451 |
STemp.Opac = instance.Opacity; |
1452 |
STemp.UserID = UserId; |
1453 |
STemp.PointSet = instance.PointSet; |
1454 |
STemp.Angle = instance.Angle; |
1455 |
STemp.DashSize = instance.DashSize; |
1456 |
STemp.Name = instance.GetType().Name.ToString(); |
1457 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1458 |
} |
1459 |
break; |
1460 |
#endregion |
1461 |
#endregion |
1462 |
|
1463 |
#region Polygon |
1464 |
|
1465 |
#region Poly |
1466 |
case "PolygonControl": |
1467 |
using (S_PolyControl STemp = new S_PolyControl()) |
1468 |
{ |
1469 |
var instance = item as PolygonControl; |
1470 |
|
1471 |
STemp.TransformPoint = "0|0"; |
1472 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1473 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1474 |
//STemp.StrokeColor = "#FF000FFF"; |
1475 |
STemp.Name = instance.GetType().Name.ToString(); |
1476 |
//STemp.Toler = instance.Toler; |
1477 |
STemp.PaintState = instance.Paint; |
1478 |
STemp.Opac = instance.Opacity; |
1479 |
STemp.UserID = UserId; |
1480 |
//강인구 추가(Chain인지 Polygon인지 구분) |
1481 |
STemp.Type = instance.ControlType; |
1482 |
//STemp.IsTrans = instance.isTransOn; |
1483 |
//STemp.IsChain = instance.isChain; |
1484 |
STemp.PointSet = new List<Point>(); |
1485 |
STemp.DashSize = instance.DashSize; |
1486 |
STemp.IsCompleted = instance.IsCompleted; |
1487 |
STemp.StartPoint = instance.StartPoint; |
1488 |
STemp.EndPoint = instance.EndPoint; |
1489 |
foreach (var point in instance.PointSet) |
1490 |
{ |
1491 |
STemp.PointSet.Add(point); |
1492 |
} |
1493 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1494 |
}; |
1495 |
break; |
1496 |
#endregion |
1497 |
|
1498 |
#region Inkcontrol |
1499 |
case "InkControl": |
1500 |
using (S_PolyControl STemp = new S_PolyControl()) |
1501 |
{ |
1502 |
var instance = item as InkControl; |
1503 |
|
1504 |
STemp.TransformPoint = "0|0"; |
1505 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1506 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1507 |
//STemp.StrokeColor = "#FF000FFF"; |
1508 |
STemp.Name = instance.GetType().Name.ToString(); |
1509 |
//STemp.Toler = instance.Toler; |
1510 |
STemp.PaintState = instance.Paint; |
1511 |
STemp.Opac = instance.Opacity; |
1512 |
STemp.UserID = UserId; |
1513 |
//강인구 추가(Chain인지 Polygon인지 구분) |
1514 |
STemp.Type = instance.ControlType; |
1515 |
//STemp.IsTrans = instance.isTransOn; |
1516 |
//STemp.IsChain = instance.isChain; |
1517 |
STemp.PointSet = new List<Point>(); |
1518 |
STemp.DashSize = instance.DashSize; |
1519 |
STemp.IsCompleted = instance.IsCompleted; |
1520 |
STemp.StartPoint = instance.StartPoint; |
1521 |
STemp.EndPoint = instance.EndPoint; |
1522 |
foreach (var point in instance.PointSet) |
1523 |
{ |
1524 |
STemp.PointSet.Add(point); |
1525 |
} |
1526 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1527 |
}; |
1528 |
break; |
1529 |
#endregion |
1530 |
|
1531 |
#region Cloud |
1532 |
case "CloudControl": |
1533 |
using (S_CloudControl STemp = new S_CloudControl()) |
1534 |
{ |
1535 |
var instance = item as CloudControl; |
1536 |
|
1537 |
STemp.TransformPoint = "0|0"; |
1538 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1539 |
//STemp.StrokeColor = "#FF000FFF"; |
1540 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1541 |
STemp.Name = instance.GetType().Name.ToString(); |
1542 |
STemp.Toler = instance.Toler; |
1543 |
STemp.PaintState = instance.Paint; |
1544 |
STemp.Opac = instance.Opacity; |
1545 |
STemp.UserID = UserId; |
1546 |
STemp.IsTrans = instance.isTransOn; |
1547 |
STemp.IsChain = instance.isChain; |
1548 |
STemp.PointSet = new List<Point>(); |
1549 |
STemp.DashSize = instance.DashSize; |
1550 |
STemp.StartPoint = instance.StartPoint; |
1551 |
STemp.EndPoint = instance.EndPoint; |
1552 |
STemp.ArcLength = instance.ArcLength; |
1553 |
|
1554 |
foreach (var point in instance.PointSet) |
1555 |
{ |
1556 |
STemp.PointSet.Add(point); |
1557 |
} |
1558 |
|
1559 |
//STemp.CloudFill = instance.Fill; |
1560 |
STemp.ArcLength = instance.ArcLength; |
1561 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1562 |
} |
1563 |
break; |
1564 |
#endregion |
1565 |
|
1566 |
#endregion |
1567 |
|
1568 |
#region Text |
1569 |
#region Text |
1570 |
case "TextControl": |
1571 |
using (S_TextControl STemp = new S_TextControl()) |
1572 |
{ |
1573 |
|
1574 |
var instance = item as TextControl; |
1575 |
STemp.TransformPoint = "0|0"; |
1576 |
STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString()); |
1577 |
STemp.Text = instance.Text; |
1578 |
STemp.UserID = UserId; |
1579 |
STemp.FontColor = instance.FontColor.Color.ToString(); |
1580 |
//STemp.FontColor = "#FFFFFF00"; |
1581 |
//STemp.EndPoint = instance.EndPoint; |
1582 |
STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY); |
1583 |
STemp.Opac = instance.Opacity; |
1584 |
//STemp.StartPoint = instance.StartPoint; |
1585 |
STemp.PointSet = instance.PointSet; |
1586 |
STemp.Angle = instance.Angle; |
1587 |
STemp.paintMethod = instance.ControlType_No; |
1588 |
STemp.BoxW = instance.BoxWidth; |
1589 |
STemp.BoxH = instance.BoxHeight; |
1590 |
STemp.isHighLight = instance.IsHighLight; |
1591 |
STemp.Name = instance.GetType().Name.ToString(); |
1592 |
STemp.fontConfig = new List<string>() |
1593 |
{ |
1594 |
instance.TextFamily.ToString(), |
1595 |
instance.TextStyle.ToString(), |
1596 |
instance.TextWeight.ToString(), |
1597 |
}; |
1598 |
|
1599 |
|
1600 |
|
1601 |
if (instance.UnderLine != null) |
1602 |
{ |
1603 |
STemp.fontConfig.Add("true"); |
1604 |
} |
1605 |
|
1606 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1607 |
} |
1608 |
break; |
1609 |
#endregion |
1610 |
#region ArrowText |
1611 |
case "ArrowTextControl": |
1612 |
using (S_ArrowTextControl STemp = new S_ArrowTextControl()) |
1613 |
{ |
1614 |
var instance = item as ArrowTextControl; |
1615 |
|
1616 |
STemp.TransformPoint = "0|0"; |
1617 |
STemp.PointSet = instance.PointSet; |
1618 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1619 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1620 |
STemp.StartPoint = instance.StartPoint; |
1621 |
STemp.ArrowStyle = instance.ArrowTextStyle; |
1622 |
//STemp.StrokeColor = "#FF00FF00"; |
1623 |
STemp.UserID = UserId; |
1624 |
STemp.ArrowText = instance.Base_TextBox.Text; |
1625 |
STemp.BorderSize = instance.BorderSize; |
1626 |
STemp.isHighLight = instance.isHighLight; |
1627 |
STemp.BoxHeight = instance.BoxHeight; |
1628 |
STemp.BoxWidth = instance.BoxWidth; |
1629 |
STemp.Opac = instance.Opacity; |
1630 |
STemp.EndPoint = instance.EndPoint; |
1631 |
STemp.isFixed = instance.isFixed; |
1632 |
//STemp.DashSize = instance.DashSize; |
1633 |
STemp.Name = instance.GetType().Name.ToString(); |
1634 |
STemp.isTrans = instance.isTrans; |
1635 |
STemp.MidPoint = instance.MidPoint; |
1636 |
STemp.Angle = instance.Angle; |
1637 |
STemp.fontConfig = new List<string>() |
1638 |
{ |
1639 |
instance.TextFamily.ToString(), |
1640 |
instance.TextStyle.ToString(), |
1641 |
instance.TextWeight.ToString(), |
1642 |
instance.TextSize.ToString(), |
1643 |
}; |
1644 |
|
1645 |
if (instance.UnderLine != null) |
1646 |
{ |
1647 |
STemp.fontConfig.Add("true"); |
1648 |
} |
1649 |
STemp.BorderSize = instance.BorderSize; |
1650 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1651 |
}; |
1652 |
break; |
1653 |
#endregion |
1654 |
#endregion |
1655 |
|
1656 |
#region ETC |
1657 |
#region Sign |
1658 |
case "SignControl": |
1659 |
{ |
1660 |
using (S_SignControl STemp = new S_SignControl()) |
1661 |
{ |
1662 |
//SignControl instance = item as SignControl; |
1663 |
//STemp.Angle = instance.Angle; |
1664 |
//STemp.EndPoint = instance.EndPoint; |
1665 |
//STemp.UserID = UserId; |
1666 |
//STemp.LB = instance.LeftBottomPoint; |
1667 |
//STemp.Name = instance.GetType().Name; |
1668 |
//STemp.PointSet = instance.PointSet; |
1669 |
//STemp.StartPoint = instance.StartPoint; |
1670 |
//STemp.Opac = instance.Opacity; |
1671 |
//STemp.TR = instance.TopRightPoint; |
1672 |
//STemp.UserNumber = instance.UserNumber; |
1673 |
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1674 |
} |
1675 |
} |
1676 |
break; |
1677 |
#endregion |
1678 |
#region Ink |
1679 |
case "InkPresenter": |
1680 |
{ |
1681 |
var instance = item as InkPresenter; |
1682 |
if (instance.Strokes.Count >= 1) |
1683 |
{ |
1684 |
using (S_PensilControl STemp = new S_PensilControl()) |
1685 |
{ |
1686 |
bool isRealData = true; |
1687 |
foreach (var strokeData in instance.Strokes) |
1688 |
{ |
1689 |
if (strokeData.StylusPoints.Count == 0) |
1690 |
{ |
1691 |
isRealData = false; |
1692 |
} |
1693 |
} |
1694 |
if (isRealData) |
1695 |
{ |
1696 |
if (instance.Tag != null) |
1697 |
{ |
1698 |
STemp.UserID = instance.Tag.ToString(); |
1699 |
} |
1700 |
STemp.SCC = instance.Strokes; |
1701 |
STemp.Name = instance.GetType().Name; |
1702 |
STemp.Opac = instance.Opacity; |
1703 |
STemp.TransformPoint = "0|0"; |
1704 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1705 |
} |
1706 |
} |
1707 |
} |
1708 |
} |
1709 |
break; |
1710 |
#endregion |
1711 |
#region Date |
1712 |
case "DateControl": |
1713 |
{ |
1714 |
using (S_DateControl STemp = new S_DateControl()) |
1715 |
{ |
1716 |
DateControl instance = item as DateControl; |
1717 |
STemp.Angle = instance.Angle; |
1718 |
STemp.EndPoint = instance.EndPoint; |
1719 |
STemp.UserID = UserId; |
1720 |
STemp.LB = instance.LeftBottomPoint; |
1721 |
STemp.Name = instance.GetType().Name; |
1722 |
STemp.PointSet = instance.PointSet; |
1723 |
STemp.StartPoint = instance.StartPoint; |
1724 |
STemp.Opac = instance.Opacity; |
1725 |
STemp.TR = instance.TopRightPoint; |
1726 |
STemp.TransformPoint = "0|0"; |
1727 |
STemp.FontColor = instance.FontColor.Color.ToString(); |
1728 |
//STemp.FontColor = "#FFFFFF00"; |
1729 |
STemp.SizeSet = String.Format("{0}", instance.LineSize); |
1730 |
STemp.Text = instance.Text; |
1731 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1732 |
} |
1733 |
} |
1734 |
break; |
1735 |
#endregion |
1736 |
#region Symbol |
1737 |
case "SymControl": |
1738 |
using (S_SymControl STemp = new S_SymControl()) |
1739 |
{ |
1740 |
var instance = item as SymControl; |
1741 |
STemp.TransformPoint = "0|0"; |
1742 |
STemp.PointSet = instance.PointSet; |
1743 |
STemp.UserID = UserId; |
1744 |
STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString()); |
1745 |
STemp.PaintState = instance.Paint; |
1746 |
STemp.PathInfo = instance.PathData.ToString(); |
1747 |
STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1748 |
STemp.StartPoint = instance.StartPoint; |
1749 |
STemp.Angle = instance.Angle; |
1750 |
STemp.EndPoint = instance.EndPoint; |
1751 |
STemp.LB = instance.LeftBottomPoint; |
1752 |
STemp.TR = instance.TopRightPoint; |
1753 |
STemp.Opac = instance.Opacity; |
1754 |
STemp.Name = instance.GetType().Name.ToString(); |
1755 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1756 |
} |
1757 |
break; |
1758 |
#endregion |
1759 |
#region SymbolN |
1760 |
case "SymControlN": |
1761 |
using (S_SymControlN STemp = new S_SymControlN()) |
1762 |
{ |
1763 |
var instance = item as SymControlN; |
1764 |
STemp.TransformPoint = "0|0"; |
1765 |
STemp.PointSet = instance.PointSet; |
1766 |
//STemp.XamlData = instance.PathXathData; |
1767 |
STemp.UserID = UserId; |
1768 |
STemp.DBData = instance.PathXathData; |
1769 |
//STemp.StrokeColor = instance.StrokeColor.Color.ToString(); |
1770 |
STemp.StartPoint = instance.StartPoint; |
1771 |
STemp.Angle = instance.Angle; |
1772 |
STemp.EndPoint = instance.EndPoint; |
1773 |
STemp.LB = instance.LeftBottomPoint; |
1774 |
STemp.TR = instance.TopRightPoint; |
1775 |
STemp.Opac = instance.Opacity; |
1776 |
STemp.Name = instance.GetType().Name.ToString(); |
1777 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1778 |
} |
1779 |
break; |
1780 |
#endregion |
1781 |
#region Image |
1782 |
case "ImgControl": |
1783 |
using (S_ImgControl STemp = new S_ImgControl()) |
1784 |
{ |
1785 |
ImgControl instance = item as ImgControl; |
1786 |
STemp.Angle = instance.Angle; |
1787 |
STemp.EndPoint = instance.EndPoint; |
1788 |
STemp.LB = instance.LeftBottomPoint; |
1789 |
STemp.Name = instance.GetType().Name; |
1790 |
STemp.PointSet = instance.PointSet; |
1791 |
STemp.StartPoint = instance.StartPoint; |
1792 |
STemp.UserID = UserId; |
1793 |
STemp.Opac = instance.Opacity; |
1794 |
STemp.TR = instance.TopRightPoint; |
1795 |
STemp.ImagePath = instance.FilePath; |
1796 |
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
1797 |
} |
1798 |
break; |
1799 |
#endregion |
1800 |
#endregion |
1801 |
default: |
1802 |
break; |
1803 |
} |
1804 |
} |
1805 |
#endregion |
1806 |
|
1807 |
//return ConvertData; |
1808 |
return Data; |
1809 |
} |
1810 |
|
1811 |
|
1812 |
//GUID생성(최민수 사원 수정) |
1813 |
public string shortGuid() |
1814 |
{ |
1815 |
byte[] bytes = new byte[16]; |
1816 |
using (var provider = System.Security.Cryptography.RandomNumberGenerator.Create()) |
1817 |
{ |
1818 |
provider.GetBytes(bytes); |
1819 |
} |
1820 |
|
1821 |
var guid = new Guid(bytes); |
1822 |
|
1823 |
return Convert.ToBase64String(guid.ToByteArray()) |
1824 |
.Substring(0, 10) |
1825 |
.Replace("/", "") |
1826 |
.Replace("+", "") + DateTime.UtcNow.Ticks.ToString("x"); |
1827 |
} |
1828 |
|
1829 |
//GUID생성 |
1830 |
//안쓰는 내용 |
1831 |
public Guid GetUniqueGuid() |
1832 |
{ |
1833 |
char[] chars = "ABCDEF1234567890".ToCharArray(); |
1834 |
byte[] data = new byte[1]; |
1835 |
System.Security.Cryptography.RNGCryptoServiceProvider crypto = new System.Security.Cryptography.RNGCryptoServiceProvider(); |
1836 |
crypto.GetNonZeroBytes(data); |
1837 |
data = new byte[32]; |
1838 |
crypto.GetNonZeroBytes(data); |
1839 |
StringBuilder result = new StringBuilder(32); |
1840 |
|
1841 |
foreach (byte b in data) |
1842 |
{ |
1843 |
result.Append(chars[b % (chars.Length - 1)]); |
1844 |
} |
1845 |
|
1846 |
return Guid.ParseExact(result.ToString(0, 8) + "-" + result.ToString(8, 4) + "-" + result.ToString(11, 4) + "-" |
1847 |
+ result.ToString(16, 4) + "-" + result.ToString(20, 12), "D"); |
1848 |
} |
1849 |
|
1850 |
///강인구 추가(2017.11.02) |
1851 |
///DATA_TYPE추가로 인한 클래스 변수 추가 |
1852 |
//markup_Data.DATA = MarkupString; |
1853 |
public class MarkupReturn |
1854 |
{ |
1855 |
public string ConvertData { get; set; } |
1856 |
public int DATA_TYPE { get; set; } |
1857 |
|
1858 |
public string CommentID { get; set; } |
1859 |
} |
1860 |
|
1861 |
//GUID생성 |
1862 |
//public Guid GetUniqueGuid() |
1863 |
//{ |
1864 |
// char[] chars = "ABCDEF1234567890".ToCharArray(); |
1865 |
// byte[] data = new byte[1]; |
1866 |
// System.Security.Cryptography.RNGCryptoServiceProvider crypto = new System.Security.Cryptography.RNGCryptoServiceProvider(); |
1867 |
// crypto.GetNonZeroBytes(data); |
1868 |
// data = new byte[32]; |
1869 |
// crypto.GetNonZeroBytes(data); |
1870 |
// StringBuilder result = new StringBuilder(32); |
1871 |
|
1872 |
// foreach (byte b in data) |
1873 |
// { |
1874 |
// result.Append(chars[b % (chars.Length - 1)]); |
1875 |
// } |
1876 |
|
1877 |
// return Guid.ParseExact(result.ToString(0, 8) + "-" + result.ToString(8, 4) + "-" + result.ToString(11, 4) + "-" |
1878 |
// + result.ToString(16, 4) + "-" + result.ToString(20, 12), "D"); |
1879 |
//} |
1880 |
} |
1881 |
} |