프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / MarkupToPDF / Controls / Parsing / MarkupCopy.cs @ 684ef11c

이력 | 보기 | 이력해설 | 다운로드 (109 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
using MarkupToPDF.Controls.Cad;
26

    
27
namespace MarkupToPDF.Controls.Parsing
28
{
29
    //public partial class LayerControl : Control
30
    //{
31
    //public class MarkupReturn
32
    //{
33
    //    public string ConvertData { get; set; }
34
    //    public int DATA_TYPE { get; set; }
35
    //}
36

    
37
    //public string MarkupToString(ObservableCollection<CommentUserInfo> baseLayer, string UserId)
38
    //{
39

    
40
    //    String ConvertData = "";
41

    
42
    //    #region ######### 마크업 파싱##########
43
    //    foreach (UIElement item in baseLayer)
44
    //    {
45
    //        switch (item.GetType().Name.ToString())
46
    //        {
47
    //            #region Arrow_Multi
48
    //            case "ArrowControl_Multi":
49
    //                using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi())
50
    //                {
51
    //                    var instance = item as ArrowControl_Multi;
52
    //                    STemp.TransformPoint = "0|0";
53
    //                    STemp.PointSet = instance.PointSet;
54
    //                    STemp.SizeSet = String.Format("{0}", instance.LineSize);
55
    //                    STemp.StrokeColor = instance.StrokeColor.Color.ToString();
56
    //                    STemp.StartPoint = instance.StartPoint;
57
    //                    STemp.EndPoint = instance.EndPoint;
58
    //                    STemp.UserID = UserId;
59
    //                    STemp.Opac = instance.Opacity;
60
    //                    STemp.DashSize = instance.DashSize;
61
    //                    STemp.MidPoint = instance.MiddlePoint;
62
    //                    STemp.Name = instance.GetType().Name.ToString();
63
    //                    ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
64
    //                };
65
    //                break;
66
    //            #endregion
67
    //            #region ArrowText
68
    //            case "ArrowTextControl":
69
    //                using (S_ArrowTextControl STemp = new S_ArrowTextControl())
70
    //                {
71
    //                    var instance = item as ArrowTextControl;
72
    //                    STemp.TransformPoint = "0|0";
73
    //                    STemp.PointSet = instance.PointSet;
74
    //                    STemp.SizeSet = String.Format("{0}", instance.LineSize);
75
    //                    STemp.StrokeColor = instance.StrokeColor.Color.ToString();
76
    //                    STemp.StartPoint = instance.StartPoint;
77
    //                    STemp.ArrowStyle = instance.ArrowTextStyle;
78
    //                    STemp.UserID = UserId;
79
    //                    STemp.ArrowText = instance.Base_TextBox.Text;
80
    //                    STemp.BorderSize = instance.BorderSize;
81
    //                    STemp.isHighLight = instance.isHighLight;
82
    //                    STemp.BoxHeight = instance.BoxHeight;
83
    //                    STemp.BoxWidth = instance.BoxWidth;
84
    //                    STemp.Opac = instance.Opacity;
85
    //                    STemp.EndPoint = instance.EndPoint;
86
    //                    STemp.isFixed = instance.isFixed;
87
    //                    //STemp.DashSize = instance.DashSize;
88
    //                    STemp.Name = instance.GetType().Name.ToString();
89
    //                    STemp.isTrans = instance.isTrans;
90
    //                    STemp.MidPoint = instance.MidPoint;
91
    //                    STemp.Angle = instance.Angle;
92
    //                    STemp.fontConfig = new List<string>()
93
    //                    {
94
    //                        instance.TextFamily.ToString(),
95
    //                        instance.TextStyle.ToString(),
96
    //                        instance.TextWeight.ToString(),
97
    //                        instance.TextSize.ToString(),
98
    //                    };
99
    //                    ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
100
    //                };
101
    //                break;
102
    //            #endregion
103
    //            #region Line
104
    //            case "LineControl":
105
    //                using (S_LineControl STemp = new S_LineControl())
106
    //                {
107
    //                    var instance = item as LineControl;
108
    //                    STemp.TransformPoint = "0|0";
109
    //                    STemp.PointSet = instance.PointSet;
110
    //                    STemp.SizeSet = String.Format("{0}", instance.LineSize);
111
    //                    STemp.LineStyleSet = instance.LineStyleSet;
112
    //                    STemp.StrokeColor = instance.StrokeColor.Color.ToString();
113
    //                    STemp.StartPoint = instance.StartPoint;
114
    //                    STemp.EndPoint = instance.EndPoint;
115
    //                    STemp.UserID = UserId;
116
    //                    STemp.Opac = instance.Opacity;
117
    //                    STemp.DashSize = instance.DashSize;
118
    //                    STemp.Interval = instance.Interval;
119
    //                    STemp.DimSize = instance.DimSize;
120
    //                    STemp.Name = instance.GetType().Name.ToString();
121
    //                    ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
122
    //                };
123
    //                break;
124
    //            #endregion
125
    //            #region Arc
126
    //            case "ArcControl":
127
    //                using (S_ArcControl STemp = new S_ArcControl())
128
    //                {
129
    //                    var instance = item as ArcControl;
130
    //                    STemp.TransformPoint = "0|0";
131
    //                    STemp.PointSet = instance.PointSet;
132
    //                    STemp.SizeSet = String.Format("{0}", instance.LineSize);
133
    //                    STemp.StrokeColor = instance.StrokeColor.Color.ToString();
134
    //                    STemp.StartPoint = instance.StartPoint;
135
    //                    STemp.UserID = UserId;
136
    //                    STemp.Opac = instance.Opacity;
137
    //                    STemp.MidPoint = instance.MidPoint;
138
    //                    STemp.EndPoint = instance.EndPoint;
139
    //                    STemp.IsTransOn = instance.isTransOn;
140
    //                    STemp.DashSize = instance.DashSize;
141
    //                    STemp.Clock = instance.Clock;
142
    //                    //STemp.ArcStyleSet = instance.ControlType;
143
    //                    STemp.Name = instance.GetType().Name.ToString();
144
    //                    ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
145
    //                };
146
    //                break;
147
    //            #endregion
148
    //            #region RectCloud
149
    //            case "RectCloudControl":
150
    //                {
151
    //                    using (S_RectCloudControl STemp = new S_RectCloudControl())
152
    //                    {
153
    //                        var instance = item as RectCloudControl;
154
    //                        STemp.TransformPoint = "0|0";
155
    //                        STemp.PointSet = instance.PointSet;
156
    //                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
157
    //                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
158
    //                        STemp.StartPoint = instance.StartPoint;
159
    //                        STemp.UserID = UserId;
160
    //                        STemp.Opac = instance.Opacity;
161
    //                        STemp.TR = instance.TopRightPoint;
162
    //                        STemp.LB = instance.LeftBottomPoint;
163
    //                        STemp.EndPoint = instance.EndPoint;
164
    //                        STemp.PaintState = instance.Paint;
165
    //                        STemp.DashSize = instance.DashSize;
166
    //                        STemp.Name = instance.GetType().Name.ToString();
167
    //                        ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
168
    //                    }
169
    //                }
170
    //                break;
171
    //            #endregion
172
    //            #region Circle
173
    //            case "CircleControl":
174
    //                using (S_CircleControl STemp = new S_CircleControl())
175
    //                {
176
    //                    var instance = item as CircleControl;
177
    //                    STemp.TransformPoint = "0|0";
178
    //                    STemp.SizeSet = String.Format("{0}", instance.LineSize);
179
    //                    STemp.PaintState = instance.Paint;
180
    //                    STemp.StrokeColor = instance.StrokeColor.Color.ToString();
181
    //                    if (instance.FillColor != null)
182
    //                    {
183
    //                        STemp.FillColor = instance.FillColor.Color.ToString();
184
    //                    }
185
    //                    STemp.StartPoint = instance.StartPoint;
186
    //                    STemp.UserID = UserId;
187
    //                    STemp.EndPoint = instance.EndPoint;
188
    //                    STemp.TRP = instance.TopRightPoint;
189
    //                    STemp.LBP = instance.LeftBottomPoint;
190
    //                    STemp.Opac = instance.Opacity;
191
    //                    STemp.Angle = instance.Angle;
192
    //                    STemp.PointSet = instance.PointSet;
193
    //                    STemp.DashSize = instance.DashSize;
194
    //                    STemp.Name = instance.GetType().Name.ToString();
195
    //                    ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
196
    //                };
197
    //                break;
198
    //            #endregion
199
    //            #region Rectangle
200
    //            case "RectangleControl":
201
    //                using (S_RectControl STemp = new S_RectControl())
202
    //                {
203
    //                    var instance = item as RectangleControl;
204
    //                    STemp.TransformPoint = "0|0";
205
    //                    STemp.SizeSet = String.Format("{0}", instance.LineSize);
206
    //                    STemp.PaintState = instance.Paint;
207
    //                    STemp.PointSet = instance.PointSet;
208
    //                    STemp.StrokeColor = instance.StrokeColor.Color.ToString();
209
    //                    if (instance.FillColor != null)
210
    //                    {
211
    //                        STemp.FillColor = instance.FillColor.Color.ToString();
212
    //                    }
213
    //                    STemp.StartPoint = instance.StartPoint;
214
    //                    STemp.UserID = instance.Uid;
215
    //                    //STemp.Angle = instance.a;
216
    //                    STemp.EndPoint = instance.EndPoint;
217
    //                    STemp.LB = instance.LeftBottomPoint;
218
    //                    STemp.TR = instance.TopRightPoint;
219
    //                    //STemp.DashSize = instance.DashSize;
220
    //                    STemp.Opac = instance.Opacity;
221
    //                    STemp.Name = instance.GetType().Name.ToString();
222
    //                    ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
223
    //                };
224
    //                break;
225
    //            #endregion
226
    //            #region Triangle
227
    //            case "TriControl":
228
    //                using (S_TriControl STemp = new S_TriControl())
229
    //                {
230
    //                    var instance = item as TriControl;
231
    //                    STemp.TransformPoint = "0|0";
232
    //                    STemp.Paint = instance.Paint;
233
    //                    STemp.SizeSet = String.Format("{0}", instance.LineSize);
234
    //                    STemp.StrokeColor = instance.StrokeColor.Color.ToString();
235
    //                    if (instance.FillColor != null)
236
    //                    {
237
    //                        STemp.FillColor = instance.FillColor.Color.ToString();
238
    //                    }
239
    //                    STemp.StartPoint = instance.StartPoint;
240
    //                    STemp.EndPoint = instance.EndPoint;
241
    //                    STemp.MidPoint = instance.MidPoint;
242
    //                    STemp.Opac = instance.Opacity;
243
    //                    STemp.UserID = UserId;
244
    //                    STemp.PointSet = instance.PointSet;
245
    //                    STemp.Angle = instance.Angle;
246
    //                    STemp.DashSize = instance.DashSize;
247
    //                    STemp.Name = instance.GetType().Name.ToString();
248
    //                    ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
249
    //                }
250
    //                break;
251
    //            #endregion
252
    //            #region Poly
253
    //            case "PolygonControl":
254
    //                using (S_PolyControl STemp = new S_PolyControl())
255
    //                {
256
    //                    var instance = item as PolygonControl;
257

    
258
    //                    STemp.TransformPoint = "0|0";
259
    //                    STemp.SizeSet = String.Format("{0}", instance.LineSize);
260
    //                    //STemp.StrokeColor = instance.StrokeColor.Color.ToString();
261
    //                    STemp.Name = instance.GetType().Name.ToString();
262
    //                    //STemp.Toler = instance.Toler;
263
    //                    //STemp.PaintState = instance.Paint;
264
    //                    STemp.Opac = instance.Opacity;
265
    //                    STemp.UserID = UserId;
266
    //                    //STemp.IsTrans = instance.isTransOn;
267
    //                    //STemp.IsChain = instance.isChain;
268
    //                    STemp.PointSet = new List<Point>();
269
    //                    //STemp.DashSize = instance.DashSize;
270
    //                    STemp.IsCompleted = instance.IsCompleted;
271
    //                    foreach (var point in instance.PointSet)
272
    //                    {
273
    //                        STemp.PointSet.Add(point);
274
    //                    }
275
    //                    ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
276
    //                };
277
    //                break;
278
    //            #endregion
279
    //            #region Cloud
280
    //            case "CloudControl":
281
    //                using (S_CloudControl STemp = new S_CloudControl())
282
    //                {
283
    //                    var instance = item as CloudControl;
284

    
285
    //                    STemp.TransformPoint = "0|0";
286
    //                    STemp.SizeSet = String.Format("{0}", instance.LineSize);
287
    //                    STemp.StrokeColor = instance.StrokeColor.Color.ToString();
288
    //                    STemp.Name = instance.GetType().Name.ToString();
289
    //                    STemp.Toler = instance.Toler;
290
    //                    STemp.PaintState = instance.Paint;
291
    //                    STemp.Opac = instance.Opacity;
292
    //                    STemp.UserID = UserId;
293
    //                    STemp.IsTrans = instance.isTransOn;
294
    //                    STemp.IsChain = instance.isChain;
295
    //                    STemp.PointSet = new List<Point>();
296
    //                    STemp.DashSize = instance.DashSize;
297
    //                    foreach (var point in instance.PointSet)
298
    //                    {
299
    //                        STemp.PointSet.Add(point);
300
    //                    }
301

    
302
    //                    //STemp.CloudFill = instance.Fill;
303
    //                    STemp.ArcLength = instance.ArcLength;
304
    //                    ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
305
    //                }
306
    //                break;
307
    //            #endregion
308
    //            #region Sign
309
    //            case "SignControl":
310
    //                {
311
    //                    using (S_SignControl STemp = new S_SignControl())
312
    //                    {
313
    //                        //SignControl instance = item as SignControl;
314
    //                        //STemp.Angle = instance.Angle;
315
    //                        //STemp.EndPoint = instance.EndPoint;
316
    //                        //STemp.UserID = UserId;
317
    //                        //STemp.LB = instance.LeftBottomPoint;
318
    //                        //STemp.Name = instance.GetType().Name;
319
    //                        //STemp.PointSet = instance.PointSet;
320
    //                        //STemp.StartPoint = instance.StartPoint;
321
    //                        //STemp.Opac = instance.Opacity;
322
    //                        //STemp.TR = instance.TopRightPoint;
323
    //                        //STemp.UserNumber = instance.UserNumber;
324
    //                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
325
    //                    }
326
    //                }
327
    //                break;
328
    //            #endregion
329
    //            #region Ink
330
    //            case "InkPresenter":
331
    //                {
332
    //                    var instance = item as InkPresenter;
333
    //                    if (instance.Strokes.Count >= 1)
334
    //                    {
335
    //                        using (S_PensilControl STemp = new S_PensilControl())
336
    //                        {
337
    //                            bool isRealData = true;
338
    //                            foreach (var strokeData in instance.Strokes)
339
    //                            {
340
    //                                if (strokeData.StylusPoints.Count == 0)
341
    //                                {
342
    //                                    isRealData = false;
343
    //                                }
344
    //                            }
345
    //                            if (isRealData)
346
    //                            {
347
    //                                if (instance.Tag != null)
348
    //                                {
349
    //                                    STemp.UserID = instance.Tag.ToString();
350
    //                                }
351
    //                                STemp.SCC = instance.Strokes;
352
    //                                STemp.Name = instance.GetType().Name;
353
    //                                STemp.Opac = instance.Opacity;
354
    //                                STemp.TransformPoint = "0|0";
355
    //                                ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
356
    //                            }
357
    //                        }
358
    //                    }
359
    //                }
360
    //                break;
361
    //            #endregion
362
    //            #region Text
363
    //            case "TextControl":
364
    //                using (S_TextControl STemp = new S_TextControl())
365
    //                {
366

    
367
    //                    var instance = item as TextControl;
368
    //                    STemp.TransformPoint = "0|0";
369
    //                    STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString());
370
    //                    STemp.Text = instance.Text;
371
    //                    STemp.UserID = UserId;
372
    //                    STemp.FontColor = instance.FontColor.Color.ToString();
373
    //                    //STemp.EndPoint = instance.EndPoint;
374
    //                    STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY);
375
    //                    STemp.Opac = instance.Opacity;
376
    //                    //STemp.StartPoint = instance.StartPoint;
377
    //                    STemp.PointSet = instance.PointSet;
378
    //                    STemp.Angle = instance.Angle;
379
    //                    STemp.paintMethod = instance.ControlType_No;
380
    //                    STemp.BoxW = instance.BoxWidth;
381
    //                    STemp.BoxH = instance.BoxHeight;
382
    //                    STemp.isHighLight = instance.IsHighLight;
383
    //                    STemp.Name = instance.GetType().Name.ToString();
384
    //                    STemp.fontConfig = new List<string>()
385
    //                    {
386
    //                        instance.TextFamily.ToString(),
387
    //                        instance.TextStyle.ToString(),
388
    //                        instance.TextWeight.ToString(),
389
    //                    };
390

    
391

    
392

    
393
    //                    if (instance.UnderLine != null)
394
    //                    {
395
    //                        STemp.fontConfig.Add("true");
396
    //                    }
397

    
398
    //                    ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
399
    //                }
400
    //                break;
401
    //            #endregion
402
    //            #region Date
403
    //            case "DateControl":
404
    //                {
405
    //                    using (S_DateControl STemp = new S_DateControl())
406
    //                    {
407
    //                        DateControl instance = item as DateControl;
408
    //                        STemp.Angle = instance.Angle;
409
    //                        STemp.EndPoint = instance.EndPoint;
410
    //                        STemp.UserID = UserId;
411
    //                        STemp.LB = instance.LeftBottomPoint;
412
    //                        STemp.Name = instance.GetType().Name;
413
    //                        STemp.PointSet = instance.PointSet;
414
    //                        STemp.StartPoint = instance.StartPoint;
415
    //                        STemp.Opac = instance.Opacity;
416
    //                        STemp.TR = instance.TopRightPoint;
417
    //                        STemp.TransformPoint = "0|0";
418
    //                        STemp.FontColor = instance.FontColor.Color.ToString();
419
    //                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
420
    //                        STemp.Text = instance.Text;
421
    //                        ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
422
    //                    }
423
    //                }
424
    //                break;
425
    //            #endregion
426
    //            #region Symbol
427
    //            case "SymControl":
428
    //                using (S_SymControl STemp = new S_SymControl())
429
    //                {
430
    //                    //var instance = item as SymControl;
431
    //                    //STemp.TransformPoint = "0|0";
432
    //                    //STemp.PointSet = instance.PointSet;
433
    //                    //STemp.UserID = UserId;
434
    //                    //STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString());
435
    //                    //STemp.PaintState = instance.Paint;
436
    //                    //STemp.PathInfo = instance.PathData.ToString();
437
    //                    //STemp.StrokeColor = instance.StrokeColor.Color.ToString();
438
    //                    //STemp.StartPoint = instance.StartPoint;
439
    //                    //STemp.Angle = instance.Angle;
440
    //                    //STemp.EndPoint = instance.EndPoint;
441
    //                    //STemp.LB = instance.LeftBottomPoint;
442
    //                    //STemp.TR = instance.TopRightPoint;
443
    //                    //STemp.Opac = instance.Opacity;
444
    //                    //STemp.Name = instance.GetType().Name.ToString();
445
    //                    //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
446
    //                }
447
    //                break;
448
    //            #endregion
449
    //            #region SymbolN
450
    //            case "SymControlN":
451
    //                using (S_SymControlN STemp = new S_SymControlN())
452
    //                {
453
    //                    //var instance = item as SymControlN;
454
    //                    //STemp.TransformPoint = "0|0";
455
    //                    //STemp.PointSet = instance.PointSet;
456
    //                    ////STemp.XamlData = instance.PathXathData;
457
    //                    //STemp.UserID = UserId;
458
    //                    //STemp.DBData = JsonSerializerHelper.CompressString(instance.PathXathData);
459
    //                    ////STemp.StrokeColor = instance.StrokeColor.Color.ToString();
460
    //                    //STemp.StartPoint = instance.StartPoint;
461
    //                    //STemp.Angle = instance.Angle;
462
    //                    //STemp.EndPoint = instance.EndPoint;
463
    //                    //STemp.LB = instance.LeftBottomPoint;
464
    //                    //STemp.TR = instance.TopRightPoint;
465
    //                    //STemp.Opac = instance.Opacity;
466
    //                    //STemp.Name = instance.GetType().Name.ToString();
467
    //                    //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
468
    //                }
469
    //                break;
470
    //            #endregion
471
    //            #region Image
472
    //            case "ImgControl":
473
    //                using (S_ImgControl STemp = new S_ImgControl())
474
    //                {
475
    //                    ImgControl instance = item as ImgControl;
476
    //                    STemp.Angle = instance.Angle;
477
    //                    STemp.EndPoint = instance.EndPoint;
478
    //                    STemp.LB = instance.LeftBottomPoint;
479
    //                    STemp.Name = instance.GetType().Name;
480
    //                    STemp.PointSet = instance.PointSet;
481
    //                    STemp.StartPoint = instance.StartPoint;
482
    //                    STemp.UserID = UserId;
483
    //                    STemp.Opac = instance.Opacity;
484
    //                    STemp.TR = instance.TopRightPoint;
485
    //                    STemp.ImagePath = instance.FilePath;
486
    //                    ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
487
    //                }
488
    //                break;
489
    //            #endregion
490
    //            default:
491
    //                break;
492
    //        }
493
    //    }
494
    //    #endregion
495

    
496
    //    return ConvertData;
497
    //}
498

    
499
    public partial class LayerControl : Control
500
    {
501

    
502
        public MarkupReturn MarkupToString(CommentUserInfo Control, string UserId)
503
        {
504
            MarkupReturn Data = new MarkupReturn();
505
            Data.ConvertData = "";
506
            Data.DATA_TYPE = 0;
507
            Data.CommentID = Control.CommentID;
508
            if(Data.CommentID == null)
509
            {
510
                Data.CommentID = shortGuid();
511
            }
512

    
513
            String ConvertData = "";
514
            //int DATA_TYPE = 0;
515

    
516
            #region ######### 마크업 파싱##########
517

    
518
            switch (Control.GetType().Name.ToString())
519
            {
520
                #region Line
521
                #region Arrow_Multi
522
                case "ArrowControl_Multi":
523
                    using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi())
524
                    {
525
                        var instance = Control as ArrowControl_Multi;
526
                        STemp.TransformPoint = "0|0";
527
                        STemp.PointSet = instance.PointSet;
528
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
529
                        //STemp.StrokeColor = "#FF00FF00";
530
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
531
                        STemp.StartPoint = instance.StartPoint;
532
                        STemp.EndPoint = instance.EndPoint;
533
                        STemp.UserID = UserId;
534
                        STemp.Opac = instance.Opacity;
535
                        STemp.DashSize = instance.DashSize;
536
                        STemp.MidPoint = instance.MiddlePoint;
537
                        STemp.Name = instance.GetType().Name.ToString();
538

    
539
                        ///강인구 추가(2017.11.02)
540
                        ///Memo 추가
541
                        STemp.Memo = instance.Memo;
542

    
543
                        ///강인구 추가(2017.11.02)
544
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
545
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
546
                        Data.DATA_TYPE = (int)(instance.ControlType);
547
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
548
                    };
549
                    break;
550
                #endregion
551
                #region Line
552
                case "LineControl":
553
                    using (S_LineControl STemp = new S_LineControl())
554
                    {
555
                        var instance = Control as LineControl;
556

    
557
                        STemp.TransformPoint = "0|0";
558
                        STemp.PointSet = instance.PointSet;
559
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
560
                        STemp.LineStyleSet = instance.LineStyleSet;
561
                        //STemp.StrokeColor = "#FF00FF00";
562
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
563
                        STemp.StartPoint = instance.StartPoint;
564
                        STemp.EndPoint = instance.EndPoint;
565
                        STemp.UserID = UserId;
566
                        STemp.Opac = instance.Opacity;
567
                        STemp.DashSize = instance.DashSize;
568
                        STemp.Interval = instance.Interval;
569
                        STemp.DimSize = instance.DimSize;
570
                        STemp.Name = instance.GetType().Name.ToString();
571

    
572
                        ///강인구 추가(2017.11.02)
573
                        ///Memo 추가
574
                        STemp.Memo = instance.Memo;
575

    
576
                        ///강인구 추가(2017.11.02)
577
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
578
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
579
                        Data.DATA_TYPE = (int)(instance.ControlType);
580

    
581
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
582

    
583
                        //var item = JsonSerializerHelper.UnCompressString(Data.ConvertData); //언패킹작업
584
                        //using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
585
                        //{
586
                        //    LineControl ins = new LineControl()
587
                        //    {
588
                        //        Memo = s.Memo
589
                        //    };
590
                        //}
591

    
592
                    };
593
                    break;
594
                #endregion
595
                #region Arc
596
                case "ArcControl":
597
                    using (S_ArcControl STemp = new S_ArcControl())
598
                    {
599
                        var instance = Control as ArcControl;
600
                        STemp.TransformPoint = "0|0";
601
                        STemp.PointSet = instance.PointSet;
602
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
603
                        //STemp.StrokeColor = "#FF000FFF";
604
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
605
                        STemp.StartPoint = instance.StartPoint;
606
                        STemp.UserID = UserId;
607
                        STemp.Opac = instance.Opacity;
608
                        STemp.MidPoint = instance.MidPoint;
609
                        STemp.EndPoint = instance.EndPoint;
610
                        STemp.IsTransOn = instance.isTransOn;
611
                        STemp.DashSize = instance.DashSize;
612
                        STemp.Clock = instance.Clock;
613
                        //STemp.ArcStyleSet = instance.ControlType;
614
                        STemp.Name = instance.GetType().Name.ToString();
615

    
616
                        ///강인구 추가(2017.11.02)
617
                        ///Memo 추가
618
                        STemp.Memo = instance.Memo;
619

    
620
                        ///강인구 추가(2017.11.02)
621
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
622
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
623
                        Data.DATA_TYPE = (int)(instance.ControlType);
624
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
625

    
626
                    };
627
                    break;
628
                #endregion
629
                #region ArrowArc
630
                case "ArrowArcControl":
631
                    using (S_ArrowArcControl STemp = new S_ArrowArcControl())
632
                    {
633
                        var instance = Control as ArrowArcControl;
634
                        STemp.TransformPoint = "0|0";
635
                        STemp.PointSet = instance.PointSet;
636
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
637
                        //STemp.StrokeColor = "#FF000FFF";
638
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
639
                        STemp.StartPoint = instance.StartPoint;
640
                        STemp.UserID = UserId;
641
                        STemp.Opac = instance.Opacity;
642
                        STemp.MidPoint = instance.MidPoint;
643
                        STemp.EndPoint = instance.EndPoint;
644
                        STemp.IsTransOn = instance.isTransOn;
645
                        STemp.DashSize = instance.DashSize;
646
                        STemp.Clock = instance.Clock;
647
                        //STemp.ArcStyleSet = instance.ControlType;
648
                        STemp.Name = instance.GetType().Name.ToString();
649

    
650
                        ///강인구 추가(2017.11.02)
651
                        ///Memo 추가
652
                        STemp.Memo = instance.Memo;
653

    
654
                        ///강인구 추가(2017.11.02)
655
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
656
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
657
                        Data.DATA_TYPE = (int)(instance.ControlType);
658
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
659

    
660
                    };
661
                    break;
662
                #endregion
663
                #endregion
664
                #region Shape
665
                #region RectCloud
666
                case "RectCloudControl":
667
                    {
668
                        using (S_RectCloudControl STemp = new S_RectCloudControl())
669
                        {
670
                            var instance = Control as RectCloudControl;
671
                            STemp.TransformPoint = "0|0";
672
                            STemp.PointSet = instance.PointSet;
673
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
674
                            //STemp.StrokeColor = "#FF00FF00";
675
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
676
                            STemp.StartPoint = instance.StartPoint;
677
                            STemp.UserID = UserId;
678
                            STemp.Opac = instance.Opacity;
679
                            STemp.TR = instance.TopRightPoint;
680
                            STemp.LB = instance.LeftBottomPoint;
681
                            STemp.EndPoint = instance.EndPoint;
682
                            STemp.PaintState = instance.Paint;
683
                            STemp.DashSize = instance.DashSize;
684
                            STemp.ArcLength = instance.ArcLength;
685
                            STemp.Name = instance.GetType().Name.ToString();
686
                            ///강인구 추가(2017.11.02)
687
                            ///Memo 추가
688
                            STemp.Memo = instance.Memo;
689

    
690
                            ///강인구 추가(2017.11.02)
691
                            ///DATA_TYPE추가로 인한 클래스 변수 대입
692
                            //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
693
                            Data.DATA_TYPE = (int)(instance.ControlType);
694
                            Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
695
                        }
696
                    }
697
                    break;
698
                #endregion
699
                #region Circle
700
                case "CircleControl":
701
                    using (S_CircleControl STemp = new S_CircleControl())
702
                    {
703
                        var instance = Control as CircleControl;
704
                        STemp.TransformPoint = "0|0";
705
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
706
                        STemp.PaintState = instance.Paint;
707
                        //STemp.StrokeColor = "#FF00FF00";
708
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
709
                        if (instance.FillColor != null)
710
                        {
711
                            STemp.FillColor = instance.FillColor.Color.ToString();
712
                        }
713
                        STemp.StartPoint = instance.StartPoint;
714
                        STemp.UserID = UserId;
715
                        STemp.EndPoint = instance.EndPoint;
716
                        STemp.TRP = instance.TopRightPoint;
717
                        STemp.LBP = instance.LeftBottomPoint;
718
                        STemp.Opac = instance.Opacity;
719
                        STemp.Angle = instance.Angle;
720
                        STemp.PointSet = instance.PointSet;
721
                        STemp.DashSize = instance.DashSize;
722
                        STemp.Name = instance.GetType().Name.ToString();
723
                        ///강인구 추가(2017.11.02)
724
                        ///Memo 추가
725
                        STemp.Memo = instance.Memo;
726

    
727
                        ///강인구 추가(2017.11.02)
728
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
729
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
730
                        Data.DATA_TYPE = (int)(instance.ControlType);
731
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
732
                    };
733
                    break;
734
                #endregion
735
                #region Rectangle
736
                case "RectangleControl":
737
                    using (S_RectControl STemp = new S_RectControl())
738
                    {
739
                        var instance = Control as RectangleControl;
740
                        STemp.TransformPoint = "0|0";
741
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
742
                        STemp.PaintState = instance.Paint;
743
                        STemp.PointSet = instance.PointSet;
744
                        //STemp.StrokeColor = "#FF00FF00";
745
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
746
                        if (instance.FillColor != null)
747
                        {
748
                            STemp.FillColor = instance.FillColor.Color.ToString();
749
                        }
750
                        STemp.StartPoint = instance.StartPoint;
751
                        STemp.UserID = UserId;
752
                        //STemp.Angle = instance.a;
753
                        STemp.EndPoint = instance.EndPoint;
754
                        STemp.LB = instance.LeftBottomPoint;
755
                        STemp.TR = instance.TopRightPoint;
756
                        STemp.DashSize = instance.DashSize;
757
                        STemp.Opac = instance.Opacity;
758
                        STemp.Name = instance.GetType().Name.ToString();
759
                        ///강인구 추가(2017.11.02)
760
                        ///Memo 추가
761
                        STemp.Memo = instance.Memo;
762

    
763
                        ///강인구 추가(2017.11.02)
764
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
765
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
766
                        Data.DATA_TYPE = (int)(instance.ControlType);
767
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
768
                    };
769
                    break;
770
                #endregion
771
                #region Triangle
772
                case "TriControl":
773
                    using (S_TriControl STemp = new S_TriControl())
774
                    {
775
                        var instance = Control as TriControl;
776
                        STemp.TransformPoint = "0|0";
777
                        STemp.Paint = instance.Paint;
778
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
779
                        //STemp.StrokeColor = "#FF00FF00";
780
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
781
                        if (instance.FillColor != null)
782
                        {
783
                            STemp.FillColor = instance.FillColor.Color.ToString();
784
                        }
785
                        STemp.StartPoint = instance.StartPoint;
786
                        STemp.EndPoint = instance.EndPoint;
787
                        STemp.MidPoint = instance.MidPoint;
788
                        STemp.Opac = instance.Opacity;
789
                        STemp.UserID = UserId;
790
                        STemp.PointSet = instance.PointSet;
791
                        STemp.Angle = instance.Angle;
792
                        STemp.DashSize = instance.DashSize;
793
                        STemp.Name = instance.GetType().Name.ToString();
794
                        ///강인구 추가(2017.11.02)
795
                        ///Memo 추가
796
                        STemp.Memo = instance.Memo;
797

    
798
                        ///강인구 추가(2017.11.02)
799
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
800
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
801
                        Data.DATA_TYPE = (int)(instance.ControlType);
802
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
803
                    }
804
                    break;
805
                #endregion
806
                #endregion
807

    
808
                #region Polygon
809
                #region Poly
810
                case "PolygonControl":
811
                    using (S_PolyControl STemp = new S_PolyControl())
812
                    {
813
                        var instance = Control as PolygonControl;
814

    
815
                        STemp.TransformPoint = "0|0";
816
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
817
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
818
                        //STemp.StrokeColor = "#FF000FFF";
819
                        STemp.Name = instance.GetType().Name.ToString();
820
                        //STemp.Toler = instance.Toler;
821
                        STemp.PaintState = instance.Paint;
822
                        STemp.Opac = instance.Opacity;
823
                        STemp.UserID = UserId;
824
                        STemp.PaintState = instance.Paint;
825
                        //강인구 추가(Chain인지 Polygon인지 구분)
826
                        STemp.Type = instance.ControlType;
827
                        //STemp.IsTrans = instance.isTransOn;
828
                        //STemp.IsChain = instance.isChain;
829
                        STemp.PointSet = new List<Point>();
830
                        STemp.DashSize = instance.DashSize;
831
                        STemp.StartPoint = instance.StartPoint;
832
                        STemp.EndPoint = instance.EndPoint;
833
                        STemp.IsCompleted = instance.IsCompleted;
834
                        foreach (var point in instance.PointSet)
835
                        {
836
                            STemp.PointSet.Add(point);
837
                        }
838
                        ///강인구 추가(2017.11.02)
839
                        ///Memo 추가
840
                        STemp.Memo = instance.Memo;
841

    
842
                        ///강인구 추가(2017.11.02)
843
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
844
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
845
                        Data.DATA_TYPE = (int)(instance.ControlType);
846
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
847
                    };
848
                    break;
849
                #endregion
850

    
851
                #region InkControl
852
                case "InkControl":
853
                    using (S_PolyControl STemp = new S_PolyControl())
854
                    {
855
                        var instance = Control as InkControl;
856

    
857
                        STemp.TransformPoint = "0|0";
858
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
859
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
860
                        //STemp.StrokeColor = "#FF000FFF";
861
                        STemp.Name = instance.GetType().Name.ToString();
862
                        //STemp.Toler = instance.Toler;
863
                        STemp.PaintState = instance.Paint;
864
                        STemp.Opac = instance.Opacity;
865
                        STemp.UserID = UserId;
866
                        STemp.PaintState = instance.Paint;
867
                        //강인구 추가(Chain인지 Polygon인지 구분)
868
                        STemp.Type = instance.ControlType;
869
                        //STemp.IsTrans = instance.isTransOn;
870
                        //STemp.IsChain = instance.isChain;
871
                        STemp.PointSet = new List<Point>();
872
                        STemp.DashSize = instance.DashSize;
873
                        STemp.IsCompleted = instance.IsCompleted;
874
                        STemp.StartPoint = instance.StartPoint;
875
                        STemp.EndPoint = instance.EndPoint;
876
                        foreach (var point in instance.PointSet)
877
                        {
878
                            STemp.PointSet.Add(point);
879
                        }
880
                        ///강인구 추가(2017.11.02)
881
                        ///Memo 추가
882
                        STemp.Memo = instance.Memo;
883

    
884
                        ///강인구 추가(2017.11.02)
885
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
886
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
887
                        Data.DATA_TYPE = (int)(instance.ControlType);
888
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
889
                    };
890
                    break;
891
                #endregion
892

    
893
                #region Cloud
894
                case "CloudControl":
895
                    using (S_CloudControl STemp = new S_CloudControl())
896
                    {
897
                        var instance = Control as CloudControl;
898

    
899
                        STemp.TransformPoint = "0|0";
900
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
901
                        //STemp.StrokeColor = "#FF000FFF";
902
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
903
                        STemp.Name = instance.GetType().Name.ToString();
904
                        STemp.Toler = instance.Toler;
905
                        STemp.PaintState = instance.Paint;
906
                        STemp.Opac = instance.Opacity;
907
                        STemp.UserID = UserId;
908
                        STemp.IsTrans = instance.isTransOn;
909
                        STemp.IsChain = instance.isChain;
910
                        STemp.PointSet = new List<Point>();
911
                        STemp.DashSize = instance.DashSize;
912
                        STemp.StartPoint = instance.StartPoint;
913
                        STemp.EndPoint = instance.EndPoint;
914
                        STemp.ArcLength = instance.ArcLength;
915
                        foreach (var point in instance.PointSet)
916
                        {
917
                            STemp.PointSet.Add(point);
918
                        }
919

    
920
                        //STemp.CloudFill = instance.Fill;
921
                        STemp.ArcLength = instance.ArcLength;
922
                        ///강인구 추가(2017.11.02)
923
                        ///Memo 추가
924
                        STemp.Memo = instance.Memo;
925

    
926
                        ///강인구 추가(2017.11.02)
927
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
928
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
929
                        Data.DATA_TYPE = (int)(instance.ControlType);
930
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
931
                    }
932
                    break;
933
                #endregion
934
                #endregion
935

    
936
                #region Text
937
                #region Text
938
                case "TextControl":
939
                    using (S_TextControl STemp = new S_TextControl())
940
                    {
941

    
942
                        var instance = Control as TextControl;
943
                        STemp.TransformPoint = "0|0";
944
                        STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString());
945
                        STemp.Text = instance.Text;
946
                        STemp.UserID = UserId;
947
                        STemp.FontColor = instance.FontColor.Color.ToString();
948
                        //STemp.FontColor = "#FFFFFF00";
949

    
950
                        if(instance.StartPoint == new Point())
951
                            STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY);
952
                        else
953
                            STemp.StartPoint = instance.StartPoint;
954

    
955
                        STemp.EndPoint = instance.EndPoint;
956
                        STemp.Opac = instance.Opacity;
957
                        STemp.PointSet = instance.PointSet;
958
                        STemp.Angle = instance.Angle;
959
                        STemp.paintMethod = instance.ControlType_No;
960
                        STemp.BoxW = instance.BoxWidth;
961
                        STemp.BoxH = instance.BoxHeight;
962
                        STemp.isHighLight = instance.IsHighLight;
963
                        STemp.Name = instance.GetType().Name.ToString();
964
                        STemp.fontConfig = new List<string>()
965
                            {
966
                                instance.TextFamily.ToString(),
967
                                instance.TextStyle.ToString(),
968
                                instance.TextWeight.ToString(),
969
                            };
970

    
971

    
972

    
973
                        if (instance.UnderLine != null)
974
                        {
975
                            STemp.fontConfig.Add("true");
976
                        }
977

    
978
                        ///강인구 추가(2017.11.02)
979
                        ///Memo 추가
980
                        STemp.Memo = instance.Memo;
981

    
982
                        ///강인구 추가(2017.11.02)
983
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
984
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
985
                        Data.DATA_TYPE = (int)(instance.ControlType);
986
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
987
                    }
988
                    break;
989
                #endregion
990
                #region ArrowText
991
                case "ArrowTextControl":
992
                    using (S_ArrowTextControl STemp = new S_ArrowTextControl())
993
                    {
994
                        var instance = Control as ArrowTextControl;
995

    
996
                        STemp.TransformPoint = "0|0";
997
                        STemp.PointSet = instance.PointSet;
998
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
999
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1000
                        STemp.StartPoint = instance.StartPoint;
1001
                        STemp.ArrowStyle = instance.ArrowTextStyle;
1002
                        //STemp.StrokeColor = "#FF00FF00";
1003
                        STemp.UserID = UserId;
1004
                        STemp.ArrowText = instance.Base_TextBox.Text;
1005
                        STemp.BorderSize = instance.BorderSize;
1006
                        STemp.isHighLight = instance.isHighLight;
1007
                        STemp.BoxHeight = instance.BoxHeight;
1008
                        STemp.BoxWidth = instance.BoxWidth;
1009
                        STemp.Opac = instance.Opacity;
1010
                        STemp.EndPoint = instance.EndPoint;
1011
                        STemp.isFixed = instance.isFixed;
1012
                        //STemp.DashSize = instance.DashSize;
1013
                        STemp.Name = instance.GetType().Name.ToString();
1014
                        STemp.isTrans = instance.isTrans;
1015
                        STemp.MidPoint = instance.MidPoint;
1016
                        STemp.Angle = instance.Angle;
1017
                        STemp.fontConfig = new List<string>()
1018
                            {
1019
                                instance.TextFamily.ToString(),
1020
                                instance.TextStyle.ToString(),
1021
                                instance.TextWeight.ToString(),
1022
                                instance.TextSize.ToString(),
1023
                            };
1024

    
1025
                        if (instance.UnderLine != null)
1026
                        {
1027
                            STemp.fontConfig.Add("true");
1028
                        }
1029

    
1030
                        ///강인구 추가(2017.11.02)
1031
                        ///Memo 추가
1032
                        STemp.Memo = instance.Memo;
1033
                        STemp.BorderSize = instance.BorderSize;
1034
                        ///강인구 추가(2017.11.02)
1035
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
1036
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1037
                        Data.DATA_TYPE = (int)(instance.ControlType);
1038
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1039
                    };
1040
                    break;
1041
                #endregion
1042
                #endregion
1043

    
1044
                #region ETC
1045
                #region Sign
1046
                case "SignControl":
1047
                    {
1048
//강인구 추가
1049
                        using (S_SignControl STemp = new S_SignControl())
1050
                        {
1051
                            SignControl instance = Control as SignControl;
1052
                            STemp.Angle = instance.Angle;
1053
                            STemp.EndPoint = instance.EndPoint;
1054
                            STemp.UserID = UserId;
1055
                            STemp.LB = instance.LeftBottomPoint;
1056
                            STemp.Name = instance.GetType().Name;
1057
                            STemp.PointSet = instance.PointSet;
1058
                            STemp.StartPoint = instance.StartPoint;
1059
                            STemp.Opac = instance.Opacity;
1060
                            STemp.TR = instance.TopRightPoint;
1061
                            STemp.UserNumber = instance.UserNumber == null ? UserId : instance.UserNumber;
1062

    
1063
                            ///강인구 추가(2017.11.02)
1064
                            ///Memo 추가
1065
                            STemp.Memo = instance.Memo;
1066

    
1067
                            ///강인구 추가(2017.11.02)
1068
                            ///DATA_TYPE추가로 인한 클래스 변수 대입
1069
                            //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1070
                            Data.DATA_TYPE = (int)(instance.ControlType);
1071
                            Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1072
                        }
1073
                    }
1074
                    break;
1075
                #endregion
1076

    
1077

    
1078
                //변경 필요
1079
                #region Ink
1080
                case "InkPresenter":
1081
                    {
1082
                        //var instance = item as InkPresenter;
1083
                        //if (instance.Strokes.Count >= 1)
1084
                        //{
1085
                        //    using (S_PensilControl STemp = new S_PensilControl())
1086
                        //    {
1087
                        //        bool isRealData = true;
1088
                        //        foreach (var strokeData in instance.Strokes)
1089
                        //        {
1090
                        //            if (strokeData.StylusPoints.Count == 0)
1091
                        //            {
1092
                        //                isRealData = false;
1093
                        //            }
1094
                        //        }
1095
                        //        if (isRealData)
1096
                        //        {
1097
                        //            if (instance.Tag != null)
1098
                        //            {
1099
                        //                STemp.UserID = instance.Tag.ToString();
1100
                        //            }
1101
                        //            STemp.SCC = instance.Strokes;
1102
                        //            STemp.Name = instance.GetType().Name;
1103
                        //            STemp.Opac = instance.Opacity;
1104
                        //            STemp.TransformPoint = "0|0";
1105
                        //            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1106
                        //        }
1107
                        //    }
1108
                        //}
1109
                    }
1110
                    break;
1111
                #endregion
1112
                #region Date
1113
                case "DateControl":
1114
                    {
1115
                        using (S_DateControl STemp = new S_DateControl())
1116
                        {
1117
                            DateControl instance = Control as DateControl;
1118
                            STemp.Angle = instance.Angle;
1119
                            STemp.EndPoint = instance.EndPoint;
1120
                            STemp.UserID = UserId;
1121
                            STemp.LB = instance.LeftBottomPoint;
1122
                            STemp.Name = instance.GetType().Name;
1123
                            STemp.PointSet = instance.PointSet;
1124
                            STemp.StartPoint = instance.StartPoint;
1125
                            STemp.Opac = instance.Opacity;
1126
                            STemp.TR = instance.TopRightPoint;
1127
                            STemp.TransformPoint = "0|0";
1128
                            STemp.FontColor = instance.FontColor.Color.ToString();
1129
                            //STemp.FontColor = "#FFFFFF00";
1130
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1131
                            STemp.Text = instance.Text;
1132
                            ///강인구 추가(2017.11.02)
1133
                            ///Memo 추가
1134
                            STemp.Memo = instance.Memo;
1135

    
1136
                            ///강인구 추가(2017.11.02)
1137
                            ///DATA_TYPE추가로 인한 클래스 변수 대입
1138
                            //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1139
                            Data.DATA_TYPE = (int)(instance.ControlType);
1140
                            Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1141
                        }
1142
                    }
1143
                    break;
1144
                #endregion
1145
                #region Symbol
1146
                case "SymControl":
1147
                    using (S_SymControl STemp = new S_SymControl())
1148
                    {
1149
                        var instance = Control as SymControl;
1150
                        STemp.TransformPoint = "0|0";
1151
                        STemp.PointSet = instance.PointSet;
1152
                        STemp.UserID = UserId;
1153
                        STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString());
1154
                        STemp.PaintState = instance.Paint;
1155
                        STemp.PathInfo = instance.PathData.ToString();
1156
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1157
                        STemp.StartPoint = instance.StartPoint;
1158
                        STemp.Angle = instance.Angle;
1159
                        STemp.EndPoint = instance.EndPoint;
1160
                        STemp.LB = instance.LeftBottomPoint;
1161
                        STemp.TR = instance.TopRightPoint;
1162
                        STemp.Opac = instance.Opacity;
1163
                        STemp.Name = instance.GetType().Name.ToString();
1164

    
1165
                        ///강인구 추가(2017.11.02)
1166
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
1167
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1168
                        Data.DATA_TYPE = (int)(instance.ControlType);
1169
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1170
                    }
1171
                    break;
1172
                #endregion
1173
                #region SymbolN
1174
                case "SymControlN":
1175
                    using (S_SymControlN STemp = new S_SymControlN())
1176
                    {
1177
                        var instance = Control as SymControlN;
1178
                        STemp.TransformPoint = "0|0";
1179
                        STemp.PointSet = instance.PointSet;
1180
                        //STemp.XamlData = instance.PathXathData;
1181
                        STemp.UserID = UserId;
1182
                        STemp.DBData = instance.PathXathData;
1183
                        //STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1184
                        STemp.StartPoint = instance.StartPoint;
1185
                        STemp.Angle = instance.Angle;
1186
                        STemp.EndPoint = instance.EndPoint;
1187
                        STemp.LB = instance.LeftBottomPoint;
1188
                        STemp.TR = instance.TopRightPoint;
1189
                        STemp.Opac = instance.Opacity;
1190
                        STemp.Name = instance.GetType().Name.ToString();
1191

    
1192
                        ///강인구 추가(2017.11.02)
1193
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
1194
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1195
                        Data.DATA_TYPE = (int)(instance.ControlType);
1196
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1197
                    }
1198
                    break;
1199
                #endregion
1200
                #region Image
1201
                case "ImgControl":
1202
                    using (S_ImgControl STemp = new S_ImgControl())
1203
                    {
1204
                        ImgControl instance = Control as ImgControl;
1205
                        STemp.Angle = instance.Angle;
1206
                        STemp.EndPoint = instance.EndPoint;
1207
                        STemp.LB = instance.LeftBottomPoint;
1208
                        STemp.Name = instance.GetType().Name;
1209
                        STemp.PointSet = instance.PointSet;
1210
                        STemp.StartPoint = instance.StartPoint;
1211
                        STemp.UserID = UserId;
1212
                        STemp.Opac = instance.Opacity;
1213
                        STemp.TR = instance.TopRightPoint;
1214
                        STemp.ImagePath = instance.FilePath;
1215
                        ///강인구 추가(2017.11.02)
1216
                        ///Memo 추가
1217
                        STemp.Memo = instance.Memo;
1218

    
1219
                        ///강인구 추가(2017.11.02)
1220
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
1221
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1222
                        Data.DATA_TYPE = (int)(instance.ControlType);
1223
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1224
                    }
1225
                    break;
1226
                #endregion
1227
                #endregion
1228
                #region Cad
1229
                case "InsideWhiteControl":
1230
                    using (S_InsideWhiteControl STemp = new S_InsideWhiteControl())
1231
                    {
1232
                        var instance = Control as InsideWhiteControl;
1233
                        STemp.TransformPoint = "0|0";
1234
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
1235
                        STemp.PaintState = instance.Paint;
1236
                        STemp.PointSet = instance.PointSet;
1237
                        //STemp.StrokeColor = "#FF00FF00";
1238
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1239
                        if (instance.FillColor != null)
1240
                        {
1241
                            STemp.FillColor = instance.FillColor.Color.ToString();
1242
                        }
1243
                        STemp.StartPoint = instance.StartPoint;
1244
                        STemp.UserID = UserId;
1245
                        STemp.EndPoint = instance.EndPoint;
1246
                        STemp.LB = instance.LeftBottomPoint;
1247
                        STemp.TR = instance.TopRightPoint;
1248
                        STemp.DashSize = instance.DashSize;
1249
                        STemp.Opac = instance.Opacity;
1250
                        STemp.Name = instance.GetType().Name.ToString();
1251
                        STemp.Memo = instance.Memo;
1252
                        Data.DATA_TYPE = (int)(instance.ControlType);
1253
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1254
                    };
1255
                    break;
1256
                case "OverlapWhiteControl":
1257
                    using (S_OverlapWhiteControl STemp = new S_OverlapWhiteControl())
1258
                    {
1259
                        var instance = Control as OverlapWhiteControl;
1260
                        STemp.TransformPoint = "0|0";
1261
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
1262
                        STemp.PaintState = instance.Paint;
1263
                        STemp.PointSet = instance.PointSet;
1264
                        //STemp.StrokeColor = "#FF00FF00";
1265
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1266
                        if (instance.FillColor != null)
1267
                        {
1268
                            STemp.FillColor = instance.FillColor.Color.ToString();
1269
                        }
1270
                        STemp.StartPoint = instance.StartPoint;
1271
                        STemp.UserID = UserId;
1272
                        STemp.EndPoint = instance.EndPoint;
1273
                        STemp.LB = instance.LeftBottomPoint;
1274
                        STemp.TR = instance.TopRightPoint;
1275
                        STemp.DashSize = instance.DashSize;
1276
                        STemp.Opac = instance.Opacity;
1277
                        STemp.Name = instance.GetType().Name.ToString();
1278
                        STemp.Memo = instance.Memo;
1279
                        Data.DATA_TYPE = (int)(instance.ControlType);
1280
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1281
                    };
1282
                    break;
1283
                case "ClipWhiteControl":
1284
                    using (S_ClipWhiteControl STemp = new S_ClipWhiteControl())
1285
                    {
1286
                        var instance = Control as ClipWhiteControl;
1287
                        STemp.TransformPoint = "0|0";
1288
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
1289
                        STemp.PaintState = instance.Paint;
1290
                        STemp.PointSet = instance.PointSet;
1291
                        //STemp.StrokeColor = "#FF00FF00";
1292
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1293
                        if (instance.FillColor != null)
1294
                        {
1295
                            STemp.FillColor = instance.FillColor.Color.ToString();
1296
                        }
1297
                        STemp.StartPoint = instance.StartPoint;
1298
                        STemp.UserID = UserId;
1299
                        STemp.EndPoint = instance.EndPoint;
1300
                        STemp.LB = instance.LeftBottomPoint;
1301
                        STemp.TR = instance.TopRightPoint;
1302
                        STemp.DashSize = instance.DashSize;
1303
                        STemp.Opac = instance.Opacity;
1304
                        STemp.Name = instance.GetType().Name.ToString();
1305
                        STemp.Memo = instance.Memo;
1306
                        Data.DATA_TYPE = (int)(instance.ControlType);
1307
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1308
                    };
1309
                    break;
1310
                case "CoordinateControl":
1311
                    using (S_CoordinateControl STemp = new S_CoordinateControl())
1312
                    {
1313
                        var instance = Control as CoordinateControl;
1314
                        STemp.TransformPoint = "0|0";
1315
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
1316
                        STemp.PaintState = instance.Paint;
1317
                        STemp.PointSet = instance.PointSet;
1318
                        //STemp.StrokeColor = "#FF00FF00";
1319
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1320
                        if (instance.FillColor != null)
1321
                        {
1322
                            STemp.FillColor = instance.FillColor.Color.ToString();
1323
                        }
1324
                        STemp.StartPoint = instance.StartPoint;
1325
                        STemp.UserID = UserId;
1326
                        STemp.EndPoint = instance.EndPoint;
1327
                        STemp.LB = instance.LeftBottomPoint;
1328
                        STemp.TR = instance.TopRightPoint;
1329
                        STemp.DashSize = instance.DashSize;
1330
                        STemp.Opac = instance.Opacity;
1331
                        STemp.Name = instance.GetType().Name.ToString();
1332
                        STemp.Memo = instance.Memo;
1333

    
1334
                        Data.DATA_TYPE = (int)(instance.ControlType);
1335
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1336
                    };
1337
                    break;
1338
                #endregion
1339
                default:
1340
                    break;
1341
            }
1342

    
1343
            #endregion
1344

    
1345
            //return ConvertData;
1346
            return Data;
1347
        }
1348

    
1349
        public MarkupReturn MarkupToString(ObservableCollection<Control> baseLayer, string UserId)
1350
        {
1351
            MarkupReturn Data = new MarkupReturn();
1352
            Data.ConvertData = "";
1353
            Data.DATA_TYPE = 0;
1354

    
1355
            String ConvertData = "";
1356
            //int DATA_TYPE = 0;
1357

    
1358
            #region ######### 마크업 파싱##########
1359
            foreach (UIElement item in baseLayer)
1360
            {
1361
                switch (item.GetType().Name.ToString())
1362
                {
1363
                    #region Line
1364
                    #region Arrow_Multi
1365
                    case "ArrowControl_Multi":
1366
                        using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi())
1367
                        {
1368
                            var instance = item as ArrowControl_Multi;
1369
                            STemp.TransformPoint = "0|0";
1370
                            STemp.PointSet = instance.PointSet;
1371
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1372
                            //STemp.StrokeColor = "#FF00FF00";
1373
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1374
                            STemp.StartPoint = instance.StartPoint;
1375
                            STemp.EndPoint = instance.EndPoint;
1376
                            STemp.UserID = UserId;
1377
                            STemp.Opac = instance.Opacity;
1378
                            STemp.DashSize = instance.DashSize;
1379
                            STemp.MidPoint = instance.MiddlePoint;
1380
                            STemp.Name = instance.GetType().Name.ToString();
1381
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1382
                        };
1383
                        break;
1384
                    #endregion
1385
                    #region Line
1386
                    case "LineControl":
1387
                        using (S_LineControl STemp = new S_LineControl())
1388
                        {
1389
                            var instance = item as LineControl;
1390

    
1391
                            //Data Type 테스트
1392
                            Data.DATA_TYPE = (int)(instance.ControlType);
1393

    
1394
                            STemp.TransformPoint = "0|0";
1395
                            STemp.PointSet = instance.PointSet;
1396
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1397
                            STemp.LineStyleSet = instance.LineStyleSet;
1398
                            //STemp.StrokeColor = "#FF00FF00";
1399
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1400
                            STemp.StartPoint = instance.StartPoint;
1401
                            STemp.EndPoint = instance.EndPoint;
1402
                            STemp.UserID = UserId;
1403
                            STemp.Opac = instance.Opacity;
1404
                            STemp.DashSize = instance.DashSize;
1405
                            STemp.Interval = instance.Interval;
1406
                            STemp.DimSize = instance.DimSize;
1407
                            STemp.Name = instance.GetType().Name.ToString();
1408

    
1409
                            Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1410
                            //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1411
                        };
1412
                        break;
1413
                    #endregion
1414
                    #region Arc
1415
                    case "ArcControl":
1416
                        using (S_ArcControl STemp = new S_ArcControl())
1417
                        {
1418
                            var instance = item as ArcControl;
1419
                            STemp.TransformPoint = "0|0";
1420
                            STemp.PointSet = instance.PointSet;
1421
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1422
                            //STemp.StrokeColor = "#FF000FFF";
1423
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1424
                            STemp.StartPoint = instance.StartPoint;
1425
                            STemp.UserID = UserId;
1426
                            STemp.Opac = instance.Opacity;
1427
                            STemp.MidPoint = instance.MidPoint;
1428
                            STemp.EndPoint = instance.EndPoint;
1429
                            STemp.IsTransOn = instance.isTransOn;
1430
                            STemp.DashSize = instance.DashSize;
1431
                            STemp.Clock = instance.Clock;
1432
                            //STemp.ArcStyleSet = instance.ControlType;
1433
                            STemp.Name = instance.GetType().Name.ToString();
1434
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1435
                        };
1436
                        break;
1437
                    #endregion
1438
                    #region ArrowArc
1439
                    case "ArrowArcControl":
1440
                        using (S_ArrowArcControl STemp = new S_ArrowArcControl())
1441
                        {
1442
                            var instance = item as ArrowArcControl;
1443
                            STemp.TransformPoint = "0|0";
1444
                            STemp.PointSet = instance.PointSet;
1445
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1446
                            //STemp.StrokeColor = "#FF000FFF";
1447
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1448
                            STemp.StartPoint = instance.StartPoint;
1449
                            STemp.UserID = UserId;
1450
                            STemp.Opac = instance.Opacity;
1451
                            STemp.MidPoint = instance.MidPoint;
1452
                            STemp.EndPoint = instance.EndPoint;
1453
                            STemp.IsTransOn = instance.isTransOn;
1454
                            STemp.DashSize = instance.DashSize;
1455
                            STemp.Clock = instance.Clock;
1456
                            //STemp.ArcStyleSet = instance.ControlType;
1457
                            STemp.Name = instance.GetType().Name.ToString();
1458
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1459
                        };
1460
                        break;
1461
                    #endregion
1462
                    #endregion
1463
                    #region Shape
1464
                    #region RectCloud
1465
                    case "RectCloudControl":
1466
                        {
1467
                            using (S_RectCloudControl STemp = new S_RectCloudControl())
1468
                            {
1469
                                var instance = item as RectCloudControl;
1470
                                STemp.TransformPoint = "0|0";
1471
                                STemp.PointSet = instance.PointSet;
1472
                                STemp.SizeSet = String.Format("{0}", instance.LineSize);
1473
                                //STemp.StrokeColor = "#FF00FF00";
1474
                                STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1475
                                STemp.StartPoint = instance.StartPoint;
1476
                                STemp.UserID = UserId;
1477
                                STemp.Opac = instance.Opacity;
1478
                                STemp.TR = instance.TopRightPoint;
1479
                                STemp.LB = instance.LeftBottomPoint;
1480
                                STemp.EndPoint = instance.EndPoint;
1481
                                STemp.PaintState = instance.Paint;
1482
                                STemp.DashSize = instance.DashSize;
1483
                                STemp.Name = instance.GetType().Name.ToString();
1484
                                STemp.ArcLength = instance.ArcLength;
1485
                                ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1486
                            }
1487
                        }
1488
                        break;
1489
                    #endregion
1490
                    #region Circle
1491
                    case "CircleControl":
1492
                        using (S_CircleControl STemp = new S_CircleControl())
1493
                        {
1494
                            var instance = item as CircleControl;
1495
                            STemp.TransformPoint = "0|0";
1496
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1497
                            STemp.PaintState = instance.Paint;
1498
                            //STemp.StrokeColor = "#FF00FF00";
1499
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1500
                            if (instance.FillColor != null)
1501
                            {
1502
                                STemp.FillColor = instance.FillColor.Color.ToString();
1503
                            }
1504
                            STemp.StartPoint = instance.StartPoint;
1505
                            STemp.UserID = UserId;
1506
                            STemp.EndPoint = instance.EndPoint;
1507
                            STemp.TRP = instance.TopRightPoint;
1508
                            STemp.LBP = instance.LeftBottomPoint;
1509
                            STemp.Opac = instance.Opacity;
1510
                            STemp.Angle = instance.Angle;
1511
                            STemp.PointSet = instance.PointSet;
1512
                            STemp.DashSize = instance.DashSize;
1513
                            STemp.Name = instance.GetType().Name.ToString();
1514
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1515
                        };
1516
                        break;
1517
                    #endregion
1518
                    #region Rectangle
1519
                    case "RectangleControl":
1520
                        using (S_RectControl STemp = new S_RectControl())
1521
                        {
1522
                            var instance = item as RectangleControl;
1523
                            STemp.TransformPoint = "0|0";
1524
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1525
                            STemp.PaintState = instance.Paint;
1526
                            STemp.PointSet = instance.PointSet;
1527
                            //STemp.StrokeColor = "#FF00FF00";
1528
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1529
                            if (instance.FillColor != null)
1530
                            {
1531
                                STemp.FillColor = instance.FillColor.Color.ToString();
1532
                            }
1533
                            STemp.StartPoint = instance.StartPoint;
1534
                            STemp.UserID = UserId;
1535
                            STemp.Angle = instance.Angle;
1536
                            STemp.EndPoint = instance.EndPoint;
1537
                            STemp.LB = instance.LeftBottomPoint;
1538
                            STemp.TR = instance.TopRightPoint;
1539
                            STemp.DashSize = instance.DashSize;
1540
                            STemp.Opac = instance.Opacity;
1541
                            STemp.Name = instance.GetType().Name.ToString();
1542
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1543
                        };
1544
                        break;
1545
                    #endregion
1546
                    #region Triangle
1547
                    case "TriControl":
1548
                        using (S_TriControl STemp = new S_TriControl())
1549
                        {
1550
                            var instance = item as TriControl;
1551
                            STemp.TransformPoint = "0|0";
1552
                            STemp.Paint = instance.Paint;
1553
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1554
                            //STemp.StrokeColor = "#FF00FF00";
1555
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1556
                            if (instance.FillColor != null)
1557
                            {
1558
                                STemp.FillColor = instance.FillColor.Color.ToString();
1559
                            }
1560
                            STemp.StartPoint = instance.StartPoint;
1561
                            STemp.EndPoint = instance.EndPoint;
1562
                            STemp.MidPoint = instance.MidPoint;
1563
                            STemp.Opac = instance.Opacity;
1564
                            STemp.UserID = UserId;
1565
                            STemp.PointSet = instance.PointSet;
1566
                            STemp.Angle = instance.Angle;
1567
                            STemp.DashSize = instance.DashSize;
1568
                            STemp.Name = instance.GetType().Name.ToString();
1569
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1570
                        }
1571
                        break;
1572
                    #endregion
1573
                    #endregion
1574

    
1575
                    #region Polygon
1576

    
1577
                    #region Poly
1578
                    case "PolygonControl":
1579
                        using (S_PolyControl STemp = new S_PolyControl())
1580
                        {
1581
                            var instance = item as PolygonControl;
1582

    
1583
                            STemp.TransformPoint = "0|0";
1584
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1585
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1586
                            //STemp.StrokeColor = "#FF000FFF";
1587
                            STemp.Name = instance.GetType().Name.ToString();
1588
                            //STemp.Toler = instance.Toler;
1589
                            STemp.PaintState = instance.Paint;
1590
                            STemp.Opac = instance.Opacity;
1591
                            STemp.UserID = UserId;
1592
                            //강인구 추가(Chain인지 Polygon인지 구분)
1593
                            STemp.Type = instance.ControlType;
1594
                            //STemp.IsTrans = instance.isTransOn;
1595
                            //STemp.IsChain = instance.isChain;
1596
                            STemp.PointSet = new List<Point>();
1597
                            STemp.DashSize = instance.DashSize;
1598
                            STemp.IsCompleted = instance.IsCompleted;
1599
                            STemp.StartPoint = instance.StartPoint;
1600
                            STemp.EndPoint = instance.EndPoint;
1601
                            foreach (var point in instance.PointSet)
1602
                            {
1603
                                STemp.PointSet.Add(point);
1604
                            }
1605
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1606
                        };
1607
                        break;
1608
                    #endregion
1609

    
1610
                    #region Inkcontrol
1611
                    case "InkControl":
1612
                        using (S_PolyControl STemp = new S_PolyControl())
1613
                        {
1614
                            var instance = item as InkControl;
1615

    
1616
                            STemp.TransformPoint = "0|0";
1617
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1618
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1619
                            //STemp.StrokeColor = "#FF000FFF";
1620
                            STemp.Name = instance.GetType().Name.ToString();
1621
                            //STemp.Toler = instance.Toler;
1622
                            STemp.PaintState = instance.Paint;
1623
                            STemp.Opac = instance.Opacity;
1624
                            STemp.UserID = UserId;
1625
                            //강인구 추가(Chain인지 Polygon인지 구분)
1626
                            STemp.Type = instance.ControlType;
1627
                            //STemp.IsTrans = instance.isTransOn;
1628
                            //STemp.IsChain = instance.isChain;
1629
                            STemp.PointSet = new List<Point>();
1630
                            STemp.DashSize = instance.DashSize;
1631
                            STemp.IsCompleted = instance.IsCompleted;
1632
                            STemp.StartPoint = instance.StartPoint;
1633
                            STemp.EndPoint = instance.EndPoint;
1634
                            foreach (var point in instance.PointSet)
1635
                            {
1636
                                STemp.PointSet.Add(point);
1637
                            }
1638
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1639
                        };
1640
                        break;
1641
                    #endregion
1642

    
1643
                    #region Cloud
1644
                    case "CloudControl":
1645
                        using (S_CloudControl STemp = new S_CloudControl())
1646
                        {
1647
                            var instance = item as CloudControl;
1648

    
1649
                            STemp.TransformPoint = "0|0";
1650
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1651
                            //STemp.StrokeColor = "#FF000FFF";
1652
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1653
                            STemp.Name = instance.GetType().Name.ToString();
1654
                            STemp.Toler = instance.Toler;
1655
                            STemp.PaintState = instance.Paint;
1656
                            STemp.Opac = instance.Opacity;
1657
                            STemp.UserID = UserId;
1658
                            STemp.IsTrans = instance.isTransOn;
1659
                            STemp.IsChain = instance.isChain;
1660
                            STemp.PointSet = new List<Point>();
1661
                            STemp.DashSize = instance.DashSize;
1662
                            STemp.StartPoint = instance.StartPoint;
1663
                            STemp.EndPoint = instance.EndPoint;
1664
                            STemp.ArcLength = instance.ArcLength;
1665

    
1666
                            foreach (var point in instance.PointSet)
1667
                            {
1668
                                STemp.PointSet.Add(point);
1669
                            }
1670

    
1671
                            //STemp.CloudFill = instance.Fill;
1672
                            STemp.ArcLength = instance.ArcLength;
1673
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1674
                        }
1675
                        break;
1676
                    #endregion
1677

    
1678
                    #endregion
1679

    
1680
                    #region Text
1681
                    #region Text
1682
                    case "TextControl":
1683
                        using (S_TextControl STemp = new S_TextControl())
1684
                        {
1685

    
1686
                            var instance = item as TextControl;
1687
                            STemp.TransformPoint = "0|0";
1688
                            STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString());
1689
                            STemp.Text = instance.Text;
1690
                            STemp.UserID = UserId;
1691
                            STemp.FontColor = instance.FontColor.Color.ToString();
1692
                            //STemp.FontColor = "#FFFFFF00";
1693
                            //STemp.EndPoint = instance.EndPoint;
1694
                            STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY);
1695
                            STemp.Opac = instance.Opacity;
1696
                            //STemp.StartPoint = instance.StartPoint;
1697
                            STemp.PointSet = instance.PointSet;
1698
                            STemp.Angle = instance.Angle;
1699
                            STemp.paintMethod = instance.ControlType_No;
1700
                            STemp.BoxW = instance.BoxWidth;
1701
                            STemp.BoxH = instance.BoxHeight;
1702
                            STemp.isHighLight = instance.IsHighLight;
1703
                            STemp.Name = instance.GetType().Name.ToString();
1704
                            STemp.fontConfig = new List<string>()
1705
                            {
1706
                                instance.TextFamily.ToString(),
1707
                                instance.TextStyle.ToString(),
1708
                                instance.TextWeight.ToString(),
1709
                            };
1710

    
1711

    
1712

    
1713
                            if (instance.UnderLine != null)
1714
                            {
1715
                                STemp.fontConfig.Add("true");
1716
                            }
1717

    
1718
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1719
                        }
1720
                        break;
1721
                    #endregion
1722
                    #region ArrowText
1723
                    case "ArrowTextControl":
1724
                        using (S_ArrowTextControl STemp = new S_ArrowTextControl())
1725
                        {
1726
                            var instance = item as ArrowTextControl;
1727

    
1728
                            STemp.TransformPoint = "0|0";
1729
                            STemp.PointSet = instance.PointSet;
1730
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1731
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1732
                            STemp.StartPoint = instance.StartPoint;
1733
                            STemp.ArrowStyle = instance.ArrowTextStyle;
1734
                            //STemp.StrokeColor = "#FF00FF00";
1735
                            STemp.UserID = UserId;
1736
                            STemp.ArrowText = instance.Base_TextBox.Text;
1737
                            STemp.BorderSize = instance.BorderSize;
1738
                            STemp.isHighLight = instance.isHighLight;
1739
                            STemp.BoxHeight = instance.BoxHeight;
1740
                            STemp.BoxWidth = instance.BoxWidth;
1741
                            STemp.Opac = instance.Opacity;
1742
                            STemp.EndPoint = instance.EndPoint;
1743
                            STemp.isFixed = instance.isFixed;
1744
                            //STemp.DashSize = instance.DashSize;
1745
                            STemp.Name = instance.GetType().Name.ToString();
1746
                            STemp.isTrans = instance.isTrans;
1747
                            STemp.MidPoint = instance.MidPoint;
1748
                            STemp.Angle = instance.Angle;
1749
                            STemp.fontConfig = new List<string>()
1750
                            {
1751
                                instance.TextFamily.ToString(),
1752
                                instance.TextStyle.ToString(),
1753
                                instance.TextWeight.ToString(),
1754
                                instance.TextSize.ToString(),
1755
                            };
1756

    
1757
                            if (instance.UnderLine != null)
1758
                            {
1759
                                STemp.fontConfig.Add("true");
1760
                            }
1761
                            STemp.BorderSize = instance.BorderSize;
1762
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1763
                        };
1764
                        break;
1765
                    #endregion
1766
                    #endregion
1767

    
1768
                    #region ETC
1769
                    #region Sign
1770
                    case "SignControl":
1771
                        {
1772
                            using (S_SignControl STemp = new S_SignControl())
1773
                            {
1774
                                //SignControl instance = item as SignControl;
1775
                                //STemp.Angle = instance.Angle;
1776
                                //STemp.EndPoint = instance.EndPoint;
1777
                                //STemp.UserID = UserId;
1778
                                //STemp.LB = instance.LeftBottomPoint;
1779
                                //STemp.Name = instance.GetType().Name;
1780
                                //STemp.PointSet = instance.PointSet;
1781
                                //STemp.StartPoint = instance.StartPoint;
1782
                                //STemp.Opac = instance.Opacity;
1783
                                //STemp.TR = instance.TopRightPoint;
1784
                                //STemp.UserNumber = instance.UserNumber;
1785
                                //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1786
                            }
1787
                        }
1788
                        break;
1789
                    #endregion
1790
                    #region Ink
1791
                    case "InkPresenter":
1792
                        {
1793
                            var instance = item as InkPresenter;
1794
                            if (instance.Strokes.Count >= 1)
1795
                            {
1796
                                using (S_PensilControl STemp = new S_PensilControl())
1797
                                {
1798
                                    bool isRealData = true;
1799
                                    foreach (var strokeData in instance.Strokes)
1800
                                    {
1801
                                        if (strokeData.StylusPoints.Count == 0)
1802
                                        {
1803
                                            isRealData = false;
1804
                                        }
1805
                                    }
1806
                                    if (isRealData)
1807
                                    {
1808
                                        if (instance.Tag != null)
1809
                                        {
1810
                                            STemp.UserID = instance.Tag.ToString();
1811
                                        }
1812
                                        STemp.SCC = instance.Strokes;
1813
                                        STemp.Name = instance.GetType().Name;
1814
                                        STemp.Opac = instance.Opacity;
1815
                                        STemp.TransformPoint = "0|0";
1816
                                        ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1817
                                    }
1818
                                }
1819
                            }
1820
                        }
1821
                        break;
1822
                    #endregion
1823
                    #region Date
1824
                    case "DateControl":
1825
                        {
1826
                            using (S_DateControl STemp = new S_DateControl())
1827
                            {
1828
                                DateControl instance = item as DateControl;
1829
                                STemp.Angle = instance.Angle;
1830
                                STemp.EndPoint = instance.EndPoint;
1831
                                STemp.UserID = UserId;
1832
                                STemp.LB = instance.LeftBottomPoint;
1833
                                STemp.Name = instance.GetType().Name;
1834
                                STemp.PointSet = instance.PointSet;
1835
                                STemp.StartPoint = instance.StartPoint;
1836
                                STemp.Opac = instance.Opacity;
1837
                                STemp.TR = instance.TopRightPoint;
1838
                                STemp.TransformPoint = "0|0";
1839
                                STemp.FontColor = instance.FontColor.Color.ToString();
1840
                                //STemp.FontColor = "#FFFFFF00";
1841
                                STemp.SizeSet = String.Format("{0}", instance.LineSize);
1842
                                STemp.Text = instance.Text;
1843
                                ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1844
                            }
1845
                        }
1846
                        break;
1847
                    #endregion
1848
                    #region Symbol
1849
                    case "SymControl":
1850
                        using (S_SymControl STemp = new S_SymControl())
1851
                        {
1852
                            var instance = item as SymControl;
1853
                            STemp.TransformPoint = "0|0";
1854
                            STemp.PointSet = instance.PointSet;
1855
                            STemp.UserID = UserId;
1856
                            STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString());
1857
                            STemp.PaintState = instance.Paint;
1858
                            STemp.PathInfo = instance.PathData.ToString();
1859
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1860
                            STemp.StartPoint = instance.StartPoint;
1861
                            STemp.Angle = instance.Angle;
1862
                            STemp.EndPoint = instance.EndPoint;
1863
                            STemp.LB = instance.LeftBottomPoint;
1864
                            STemp.TR = instance.TopRightPoint;
1865
                            STemp.Opac = instance.Opacity;
1866
                            STemp.Name = instance.GetType().Name.ToString();
1867
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1868
                        }
1869
                        break;
1870
                    #endregion
1871
                    #region SymbolN
1872
                    case "SymControlN":
1873
                        using (S_SymControlN STemp = new S_SymControlN())
1874
                        {
1875
                            var instance = item as SymControlN;
1876
                            STemp.TransformPoint = "0|0";
1877
                            STemp.PointSet = instance.PointSet;
1878
                            //STemp.XamlData = instance.PathXathData;
1879
                            STemp.UserID = UserId;
1880
                            STemp.DBData = instance.PathXathData;
1881
                            //STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1882
                            STemp.StartPoint = instance.StartPoint;
1883
                            STemp.Angle = instance.Angle;
1884
                            STemp.EndPoint = instance.EndPoint;
1885
                            STemp.LB = instance.LeftBottomPoint;
1886
                            STemp.TR = instance.TopRightPoint;
1887
                            STemp.Opac = instance.Opacity;
1888
                            STemp.Name = instance.GetType().Name.ToString();
1889
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1890
                        }
1891
                        break;
1892
                    #endregion
1893
                    #region Image
1894
                    case "ImgControl":
1895
                        using (S_ImgControl STemp = new S_ImgControl())
1896
                        {
1897
                            ImgControl instance = item as ImgControl;
1898
                            STemp.Angle = instance.Angle;
1899
                            STemp.EndPoint = instance.EndPoint;
1900
                            STemp.LB = instance.LeftBottomPoint;
1901
                            STemp.Name = instance.GetType().Name;
1902
                            STemp.PointSet = instance.PointSet;
1903
                            STemp.StartPoint = instance.StartPoint;
1904
                            STemp.UserID = UserId;
1905
                            STemp.Opac = instance.Opacity;
1906
                            STemp.TR = instance.TopRightPoint;
1907
                            STemp.ImagePath = instance.FilePath;
1908
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1909
                        }
1910
                        break;
1911
                    #endregion
1912
                    #endregion
1913

    
1914
                    #region Cad
1915
                    case "InsideWhiteControl":
1916
                        using (S_InsideWhiteControl STemp = new S_InsideWhiteControl())
1917
                        {
1918
                            var instance = item as InsideWhiteControl;
1919
                            STemp.TransformPoint = "0|0";
1920
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1921
                            STemp.PaintState = instance.Paint;
1922
                            STemp.PointSet = instance.PointSet;
1923
                            //STemp.StrokeColor = "#FF00FF00";
1924
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1925
                            if (instance.FillColor != null)
1926
                            {
1927
                                STemp.FillColor = instance.FillColor.Color.ToString();
1928
                            }
1929
                            STemp.StartPoint = instance.StartPoint;
1930
                            STemp.UserID = UserId;
1931
                            STemp.Angle = instance.Angle;
1932
                            STemp.EndPoint = instance.EndPoint;
1933
                            STemp.LB = instance.LeftBottomPoint;
1934
                            STemp.TR = instance.TopRightPoint;
1935
                            STemp.DashSize = instance.DashSize;
1936
                            STemp.Opac = instance.Opacity;
1937
                            STemp.Name = instance.GetType().Name.ToString();
1938
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1939
                        };
1940
                        break;
1941
                    case "OverlapWhiteControl":
1942
                        using (S_OverlapWhiteControl STemp = new S_OverlapWhiteControl())
1943
                        {
1944
                            var instance = item as OverlapWhiteControl;
1945
                            STemp.TransformPoint = "0|0";
1946
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1947
                            STemp.PaintState = instance.Paint;
1948
                            STemp.PointSet = instance.PointSet;
1949
                            //STemp.StrokeColor = "#FF00FF00";
1950
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1951
                            if (instance.FillColor != null)
1952
                            {
1953
                                STemp.FillColor = instance.FillColor.Color.ToString();
1954
                            }
1955
                            STemp.StartPoint = instance.StartPoint;
1956
                            STemp.UserID = UserId;
1957
                            STemp.Angle = instance.Angle;
1958
                            STemp.EndPoint = instance.EndPoint;
1959
                            STemp.LB = instance.LeftBottomPoint;
1960
                            STemp.TR = instance.TopRightPoint;
1961
                            STemp.DashSize = instance.DashSize;
1962
                            STemp.Opac = instance.Opacity;
1963
                            STemp.Name = instance.GetType().Name.ToString();
1964
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1965
                        };
1966
                        break;
1967
                    case "ClipWhiteControl":
1968
                        using (S_ClipWhiteControl STemp = new S_ClipWhiteControl())
1969
                        {
1970
                            var instance = item as ClipWhiteControl;
1971
                            STemp.TransformPoint = "0|0";
1972
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1973
                            STemp.PaintState = instance.Paint;
1974
                            STemp.PointSet = instance.PointSet;
1975
                            //STemp.StrokeColor = "#FF00FF00";
1976
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1977
                            if (instance.FillColor != null)
1978
                            {
1979
                                STemp.FillColor = instance.FillColor.Color.ToString();
1980
                            }
1981
                            STemp.StartPoint = instance.StartPoint;
1982
                            STemp.UserID = UserId;
1983
                            STemp.Angle = instance.Angle;
1984
                            STemp.EndPoint = instance.EndPoint;
1985
                            STemp.LB = instance.LeftBottomPoint;
1986
                            STemp.TR = instance.TopRightPoint;
1987
                            STemp.DashSize = instance.DashSize;
1988
                            STemp.Opac = instance.Opacity;
1989
                            STemp.Name = instance.GetType().Name.ToString();
1990
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1991
                        };
1992
                        break;
1993
                    case "CoordinateControl":
1994
                        using (S_CoordinateControl STemp = new S_CoordinateControl())
1995
                        {
1996
                            var instance = item as CoordinateControl;
1997
                            STemp.TransformPoint = "0|0";
1998
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1999
                            STemp.PaintState = instance.Paint;
2000
                            STemp.PointSet = instance.PointSet;
2001
                            //STemp.StrokeColor = "#FF00FF00";
2002
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
2003
                            if (instance.FillColor != null)
2004
                            {
2005
                                STemp.FillColor = instance.FillColor.Color.ToString();
2006
                            }
2007
                            STemp.StartPoint = instance.StartPoint;
2008
                            STemp.UserID = UserId;
2009
                            STemp.Angle = instance.Angle;
2010
                            STemp.EndPoint = instance.EndPoint;
2011
                            STemp.LB = instance.LeftBottomPoint;
2012
                            STemp.TR = instance.TopRightPoint;
2013
                            STemp.DashSize = instance.DashSize;
2014
                            STemp.Opac = instance.Opacity;
2015
                            STemp.Name = instance.GetType().Name.ToString();
2016
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
2017
                        };
2018
                        break;
2019
                    #endregion
2020
                    default:
2021
                        break;
2022
                }
2023
            }
2024
            #endregion
2025

    
2026
            //return ConvertData;
2027
            return Data;
2028
        }
2029

    
2030

    
2031
        //GUID생성(최민수 사원 수정)
2032
        public string shortGuid()
2033
        {
2034
            byte[] bytes = new byte[16];
2035
            using (var provider = System.Security.Cryptography.RandomNumberGenerator.Create())
2036
            {
2037
                provider.GetBytes(bytes);
2038
            }
2039

    
2040
            var guid = new Guid(bytes);
2041

    
2042
            return Convert.ToBase64String(guid.ToByteArray())
2043
                .Substring(0, 10)
2044
                .Replace("/", "")
2045
                .Replace("+", "") + DateTime.UtcNow.Ticks.ToString("x");
2046
        }
2047

    
2048
        //GUID생성
2049
        //안쓰는 내용
2050
        public Guid GetUniqueGuid()
2051
        {
2052
            char[] chars = "ABCDEF1234567890".ToCharArray();
2053
            byte[] data = new byte[1];
2054
            System.Security.Cryptography.RNGCryptoServiceProvider crypto = new System.Security.Cryptography.RNGCryptoServiceProvider();
2055
            crypto.GetNonZeroBytes(data);
2056
            data = new byte[32];
2057
            crypto.GetNonZeroBytes(data);
2058
            StringBuilder result = new StringBuilder(32);
2059

    
2060
            foreach (byte b in data)
2061
            {
2062
                result.Append(chars[b % (chars.Length - 1)]);
2063
            }
2064

    
2065
            return Guid.ParseExact(result.ToString(0, 8) + "-" + result.ToString(8, 4) + "-" + result.ToString(11, 4) + "-"
2066
                + result.ToString(16, 4) + "-" + result.ToString(20, 12), "D");
2067
        }
2068

    
2069
        ///강인구 추가(2017.11.02)
2070
        ///DATA_TYPE추가로 인한 클래스 변수 추가
2071
        //markup_Data.DATA = MarkupString;
2072
        public class MarkupReturn
2073
        {
2074
            public string ConvertData { get; set; }
2075
            public int DATA_TYPE { get; set; }
2076

    
2077
            public string CommentID { get; set; }
2078
        }
2079

    
2080
        //GUID생성
2081
        //public Guid GetUniqueGuid()
2082
        //{
2083
        //    char[] chars = "ABCDEF1234567890".ToCharArray();
2084
        //    byte[] data = new byte[1];
2085
        //    System.Security.Cryptography.RNGCryptoServiceProvider crypto = new System.Security.Cryptography.RNGCryptoServiceProvider();
2086
        //    crypto.GetNonZeroBytes(data);
2087
        //    data = new byte[32];
2088
        //    crypto.GetNonZeroBytes(data);
2089
        //    StringBuilder result = new StringBuilder(32);
2090

    
2091
        //    foreach (byte b in data)
2092
        //    {
2093
        //        result.Append(chars[b % (chars.Length - 1)]);
2094
        //    }
2095

    
2096
        //    return Guid.ParseExact(result.ToString(0, 8) + "-" + result.ToString(8, 4) + "-" + result.ToString(11, 4) + "-"
2097
        //        + result.ToString(16, 4) + "-" + result.ToString(20, 12), "D");
2098
        //}
2099
    }
2100
}
클립보드 이미지 추가 (최대 크기: 500 MB)