프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Controls / Parsing / MarkupCopy.cs.bak @ 53880c83

이력 | 보기 | 이력해설 | 다운로드 (88 KB)

1
using System;
2
using System.Net;
3
using System.Windows;
4
using System.Windows.Controls;
5
using System.Windows.Documents;
6
using System.Windows.Ink;
7
using System.Windows.Input;
8
using System.Windows.Media;
9
using System.Windows.Media.Animation;
10
using System.Windows.Shapes;
11
using MarkupToPDF.Controls;
12
using MarkupToPDF.Controls.Line;
13
using MarkupToPDF.Controls.Shape;
14
using MarkupToPDF.Controls.Polygon;
15
using MarkupToPDF.Controls.Text;
16
using MarkupToPDF.Controls.Etc;
17
using MarkupToPDF.Controls.Common.ValueConverter;
18
using MarkupToPDF.Serialize.S_Control;
19
using MarkupToPDF.Serialize.Core;
20
using System.Collections.Generic;
21
using System.Collections.ObjectModel;
22
using System.Text;
23
using MarkupToPDF.Controls.Common;
24
using MarkupToPDF.Common;
25

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

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

    
39
    //    String ConvertData = "";
40

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

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

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

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

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

    
390

    
391

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

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

    
495
    //    return ConvertData;
496
    //}
497

    
498
    public partial class LayerControl : Control
499
    {
500

    
501
        public MarkupReturn MarkupToString(CommentUserInfo Control, string UserId)
502
        {
503
            MarkupReturn Data = new MarkupReturn();
504
            Data.ConvertData = "";
505
            Data.DATA_TYPE = 0;
506
            Data.CommentID = Control.CommentID;
507

    
508
            String ConvertData = "";
509
            //int DATA_TYPE = 0;
510

    
511
            #region ######### 마크업 파싱##########
512

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

    
534
                        ///강인구 추가(2017.11.02)
535
                        ///Memo 추가
536
                        STemp.Memo = instance.Memo;
537

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

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

    
567
                        ///강인구 추가(2017.11.02)
568
                        ///Memo 추가
569
                        STemp.Memo = instance.Memo;
570

    
571
                        ///강인구 추가(2017.11.02)
572
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
573
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
574
                        Data.DATA_TYPE = (int)(instance.ControlType);
575

    
576
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
577

    
578
                        //var item = JsonSerializerHelper.UnCompressString(Data.ConvertData); //언패킹작업
579
                        //using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
580
                        //{
581
                        //    LineControl ins = new LineControl()
582
                        //    {
583
                        //        Memo = s.Memo
584
                        //    };
585
                        //}
586

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

    
611
                        ///강인구 추가(2017.11.02)
612
                        ///Memo 추가
613
                        STemp.Memo = instance.Memo;
614

    
615
                        ///강인구 추가(2017.11.02)
616
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
617
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
618
                        Data.DATA_TYPE = (int)(instance.ControlType);
619
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
620

    
621
                    };
622
                    break;
623
                #endregion
624
                #endregion
625

    
626
                #region Shape
627
                #region RectCloud
628
                case "RectCloudControl":
629
                    {
630
                        using (S_RectCloudControl STemp = new S_RectCloudControl())
631
                        {
632
                            var instance = Control as RectCloudControl;
633
                            STemp.TransformPoint = "0|0";
634
                            STemp.PointSet = instance.PointSet;
635
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
636
                            //STemp.StrokeColor = "#FF00FF00";
637
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
638
                            STemp.StartPoint = instance.StartPoint;
639
                            STemp.UserID = UserId;
640
                            STemp.Opac = instance.Opacity;
641
                            STemp.TR = instance.TopRightPoint;
642
                            STemp.LB = instance.LeftBottomPoint;
643
                            STemp.EndPoint = instance.EndPoint;
644
                            STemp.PaintState = instance.Paint;
645
                            STemp.DashSize = instance.DashSize;
646
                            STemp.Name = instance.GetType().Name.ToString();
647
                            ///강인구 추가(2017.11.02)
648
                            ///Memo 추가
649
                            STemp.Memo = instance.Memo;
650

    
651
                            ///강인구 추가(2017.11.02)
652
                            ///DATA_TYPE추가로 인한 클래스 변수 대입
653
                            //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
654
                            Data.DATA_TYPE = (int)(instance.ControlType);
655
                            Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
656
                        }
657
                    }
658
                    break;
659
                #endregion
660
                #region Circle
661
                case "CircleControl":
662
                    using (S_CircleControl STemp = new S_CircleControl())
663
                    {
664
                        var instance = Control as CircleControl;
665
                        STemp.TransformPoint = "0|0";
666
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
667
                        STemp.PaintState = instance.Paint;
668
                        //STemp.StrokeColor = "#FF00FF00";
669
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
670
                        if (instance.FillColor != null)
671
                        {
672
                            STemp.FillColor = instance.FillColor.Color.ToString();
673
                        }
674
                        STemp.StartPoint = instance.StartPoint;
675
                        STemp.UserID = UserId;
676
                        STemp.EndPoint = instance.EndPoint;
677
                        STemp.TRP = instance.TopRightPoint;
678
                        STemp.LBP = instance.LeftBottomPoint;
679
                        STemp.Opac = instance.Opacity;
680
                        STemp.Angle = instance.Angle;
681
                        STemp.PointSet = instance.PointSet;
682
                        STemp.DashSize = instance.DashSize;
683
                        STemp.Name = instance.GetType().Name.ToString();
684
                        ///강인구 추가(2017.11.02)
685
                        ///Memo 추가
686
                        STemp.Memo = instance.Memo;
687

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

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

    
759
                        ///강인구 추가(2017.11.02)
760
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
761
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
762
                        Data.DATA_TYPE = (int)(instance.ControlType);
763
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
764
                    }
765
                    break;
766
                #endregion
767
                #endregion
768

    
769
                #region Polygon
770
                #region Poly
771
                case "PolygonControl":
772
                    using (S_PolyControl STemp = new S_PolyControl())
773
                    {
774
                        var instance = Control as PolygonControl;
775

    
776
                        STemp.TransformPoint = "0|0";
777
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
778
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
779
                        //STemp.StrokeColor = "#FF000FFF";
780
                        STemp.Name = instance.GetType().Name.ToString();
781
                        //STemp.Toler = instance.Toler;
782
                        //STemp.PaintState = instance.Paint;
783
                        STemp.Opac = instance.Opacity;
784
                        STemp.UserID = UserId;
785
                        STemp.PaintState = instance.Paint;
786
                        //강인구 추가(Chain인지 Polygon인지 구분)
787
                        STemp.Type = instance.ControlType;
788
                        //STemp.IsTrans = instance.isTransOn;
789
                        //STemp.IsChain = instance.isChain;
790
                        STemp.PointSet = new List<Point>();
791
                        STemp.DashSize = instance.DashSize;
792
                        STemp.IsCompleted = instance.IsCompleted;
793
                        foreach (var point in instance.PointSet)
794
                        {
795
                            STemp.PointSet.Add(point);
796
                        }
797
                        ///강인구 추가(2017.11.02)
798
                        ///Memo 추가
799
                        STemp.Memo = instance.Memo;
800

    
801
                        ///강인구 추가(2017.11.02)
802
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
803
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
804
                        Data.DATA_TYPE = (int)(instance.ControlType);
805
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
806
                    };
807
                    break;
808
                #endregion
809
                #region Cloud
810
                case "CloudControl":
811
                    using (S_CloudControl STemp = new S_CloudControl())
812
                    {
813
                        var instance = Control as CloudControl;
814

    
815
                        STemp.TransformPoint = "0|0";
816
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
817
                        //STemp.StrokeColor = "#FF000FFF";
818
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
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.IsTrans = instance.isTransOn;
825
                        STemp.IsChain = instance.isChain;
826
                        STemp.PointSet = new List<Point>();
827
                        STemp.DashSize = instance.DashSize;
828
                        foreach (var point in instance.PointSet)
829
                        {
830
                            STemp.PointSet.Add(point);
831
                        }
832

    
833
                        //STemp.CloudFill = instance.Fill;
834
                        STemp.ArcLength = instance.ArcLength;
835
                        ///강인구 추가(2017.11.02)
836
                        ///Memo 추가
837
                        STemp.Memo = instance.Memo;
838

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

    
849
                #region Text
850
                #region Text
851
                case "TextControl":
852
                    using (S_TextControl STemp = new S_TextControl())
853
                    {
854

    
855
                        var instance = Control as TextControl;
856
                        STemp.TransformPoint = "0|0";
857
                        STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString());
858
                        STemp.Text = instance.Text;
859
                        STemp.UserID = UserId;
860
                        STemp.FontColor = instance.FontColor.Color.ToString();
861
                        //STemp.FontColor = "#FFFFFF00";
862

    
863
                        if(instance.StartPoint == new Point())
864
                            STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY);
865
                        else
866
                            STemp.StartPoint = instance.StartPoint;
867

    
868
                        STemp.EndPoint = instance.EndPoint;
869
                        STemp.Opac = instance.Opacity;
870
                        STemp.PointSet = instance.PointSet;
871
                        STemp.Angle = instance.Angle;
872
                        STemp.paintMethod = instance.ControlType_No;
873
                        STemp.BoxW = instance.BoxWidth;
874
                        STemp.BoxH = instance.BoxHeight;
875
                        STemp.isHighLight = instance.IsHighLight;
876
                        STemp.Name = instance.GetType().Name.ToString();
877
                        STemp.fontConfig = new List<string>()
878
                            {
879
                                instance.TextFamily.ToString(),
880
                                instance.TextStyle.ToString(),
881
                                instance.TextWeight.ToString(),
882
                            };
883

    
884

    
885

    
886
                        if (instance.UnderLine != null)
887
                        {
888
                            STemp.fontConfig.Add("true");
889
                        }
890

    
891
                        ///강인구 추가(2017.11.02)
892
                        ///Memo 추가
893
                        STemp.Memo = instance.Memo;
894

    
895
                        ///강인구 추가(2017.11.02)
896
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
897
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
898
                        Data.DATA_TYPE = (int)(instance.ControlType);
899
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
900
                    }
901
                    break;
902
                #endregion
903
                #region ArrowText
904
                case "ArrowTextControl":
905
                    using (S_ArrowTextControl STemp = new S_ArrowTextControl())
906
                    {
907
                        var instance = Control as ArrowTextControl;
908

    
909
                        STemp.TransformPoint = "0|0";
910
                        STemp.PointSet = instance.PointSet;
911
                        STemp.SizeSet = String.Format("{0}", instance.LineSize);
912
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
913
                        STemp.StartPoint = instance.StartPoint;
914
                        STemp.ArrowStyle = instance.ArrowTextStyle;
915
                        //STemp.StrokeColor = "#FF00FF00";
916
                        STemp.UserID = UserId;
917
                        STemp.ArrowText = instance.Base_TextBox.Text;
918
                        STemp.BorderSize = instance.BorderSize;
919
                        STemp.isHighLight = instance.isHighLight;
920
                        STemp.BoxHeight = instance.BoxHeight;
921
                        STemp.BoxWidth = instance.BoxWidth;
922
                        STemp.Opac = instance.Opacity;
923
                        STemp.EndPoint = instance.EndPoint;
924
                        STemp.isFixed = instance.isFixed;
925
                        //STemp.DashSize = instance.DashSize;
926
                        STemp.Name = instance.GetType().Name.ToString();
927
                        STemp.isTrans = instance.isTrans;
928
                        STemp.MidPoint = instance.MidPoint;
929
                        STemp.Angle = instance.Angle;
930
                        STemp.fontConfig = new List<string>()
931
                            {
932
                                instance.TextFamily.ToString(),
933
                                instance.TextStyle.ToString(),
934
                                instance.TextWeight.ToString(),
935
                                instance.TextSize.ToString(),
936
                            };
937
                        ///강인구 추가(2017.11.02)
938
                        ///Memo 추가
939
                        STemp.Memo = instance.Memo;
940

    
941
                        ///강인구 추가(2017.11.02)
942
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
943
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
944
                        Data.DATA_TYPE = (int)(instance.ControlType);
945
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
946
                    };
947
                    break;
948
                #endregion
949
                #endregion
950

    
951
                #region ETC
952
                #region Sign
953
                case "SignControl":
954
                    {
955
//강인구 추가
956
                        using (S_SignControl STemp = new S_SignControl())
957
                        {
958
                            SignControl instance = Control as SignControl;
959
                            STemp.Angle = instance.Angle;
960
                            STemp.EndPoint = instance.EndPoint;
961
                            STemp.UserID = UserId;
962
                            STemp.LB = instance.LeftBottomPoint;
963
                            STemp.Name = instance.GetType().Name;
964
                            STemp.PointSet = instance.PointSet;
965
                            STemp.StartPoint = instance.StartPoint;
966
                            STemp.Opac = instance.Opacity;
967
                            STemp.TR = instance.TopRightPoint;
968
                            STemp.UserNumber = instance.UserNumber == null ? UserId : instance.UserNumber;
969

    
970
                            ///강인구 추가(2017.11.02)
971
                            ///Memo 추가
972
                            STemp.Memo = instance.Memo;
973

    
974
                            ///강인구 추가(2017.11.02)
975
                            ///DATA_TYPE추가로 인한 클래스 변수 대입
976
                            //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
977
                            Data.DATA_TYPE = (int)(instance.ControlType);
978
                            Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
979
                        }
980
                    }
981
                    break;
982
                #endregion
983

    
984

    
985
                //변경 필요
986
                #region Ink
987
                case "InkPresenter":
988
                    {
989
                        //var instance = item as InkPresenter;
990
                        //if (instance.Strokes.Count >= 1)
991
                        //{
992
                        //    using (S_PensilControl STemp = new S_PensilControl())
993
                        //    {
994
                        //        bool isRealData = true;
995
                        //        foreach (var strokeData in instance.Strokes)
996
                        //        {
997
                        //            if (strokeData.StylusPoints.Count == 0)
998
                        //            {
999
                        //                isRealData = false;
1000
                        //            }
1001
                        //        }
1002
                        //        if (isRealData)
1003
                        //        {
1004
                        //            if (instance.Tag != null)
1005
                        //            {
1006
                        //                STemp.UserID = instance.Tag.ToString();
1007
                        //            }
1008
                        //            STemp.SCC = instance.Strokes;
1009
                        //            STemp.Name = instance.GetType().Name;
1010
                        //            STemp.Opac = instance.Opacity;
1011
                        //            STemp.TransformPoint = "0|0";
1012
                        //            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1013
                        //        }
1014
                        //    }
1015
                        //}
1016
                    }
1017
                    break;
1018
                #endregion
1019
                #region Date
1020
                case "DateControl":
1021
                    {
1022
                        using (S_DateControl STemp = new S_DateControl())
1023
                        {
1024
                            DateControl instance = Control as DateControl;
1025
                            STemp.Angle = instance.Angle;
1026
                            STemp.EndPoint = instance.EndPoint;
1027
                            STemp.UserID = UserId;
1028
                            STemp.LB = instance.LeftBottomPoint;
1029
                            STemp.Name = instance.GetType().Name;
1030
                            STemp.PointSet = instance.PointSet;
1031
                            STemp.StartPoint = instance.StartPoint;
1032
                            STemp.Opac = instance.Opacity;
1033
                            STemp.TR = instance.TopRightPoint;
1034
                            STemp.TransformPoint = "0|0";
1035
                            STemp.FontColor = instance.FontColor.Color.ToString();
1036
                            //STemp.FontColor = "#FFFFFF00";
1037
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1038
                            STemp.Text = instance.Text;
1039
                            ///강인구 추가(2017.11.02)
1040
                            ///Memo 추가
1041
                            STemp.Memo = instance.Memo;
1042

    
1043
                            ///강인구 추가(2017.11.02)
1044
                            ///DATA_TYPE추가로 인한 클래스 변수 대입
1045
                            //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1046
                            Data.DATA_TYPE = (int)(instance.ControlType);
1047
                            Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1048
                        }
1049
                    }
1050
                    break;
1051
                #endregion
1052
                #region Symbol
1053
                case "SymControl":
1054
                    using (S_SymControl STemp = new S_SymControl())
1055
                    {
1056
                        var instance = Control as SymControl;
1057
                        STemp.TransformPoint = "0|0";
1058
                        STemp.PointSet = instance.PointSet;
1059
                        STemp.UserID = UserId;
1060
                        STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString());
1061
                        STemp.PaintState = instance.Paint;
1062
                        STemp.PathInfo = instance.PathData.ToString();
1063
                        STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1064
                        STemp.StartPoint = instance.StartPoint;
1065
                        STemp.Angle = instance.Angle;
1066
                        STemp.EndPoint = instance.EndPoint;
1067
                        STemp.LB = instance.LeftBottomPoint;
1068
                        STemp.TR = instance.TopRightPoint;
1069
                        STemp.Opac = instance.Opacity;
1070
                        STemp.Name = instance.GetType().Name.ToString();
1071

    
1072
                        ///강인구 추가(2017.11.02)
1073
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
1074
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1075
                        Data.DATA_TYPE = (int)(instance.ControlType);
1076
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1077
                    }
1078
                    break;
1079
                #endregion
1080
                #region SymbolN
1081
                case "SymControlN":
1082
                    using (S_SymControlN STemp = new S_SymControlN())
1083
                    {
1084
                        var instance = Control as SymControlN;
1085
                        STemp.TransformPoint = "0|0";
1086
                        STemp.PointSet = instance.PointSet;
1087
                        //STemp.XamlData = instance.PathXathData;
1088
                        STemp.UserID = UserId;
1089
                        STemp.DBData = JsonSerializerHelper.CompressString(instance.PathXathData);
1090
                        //STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1091
                        STemp.StartPoint = instance.StartPoint;
1092
                        STemp.Angle = instance.Angle;
1093
                        STemp.EndPoint = instance.EndPoint;
1094
                        STemp.LB = instance.LeftBottomPoint;
1095
                        STemp.TR = instance.TopRightPoint;
1096
                        STemp.Opac = instance.Opacity;
1097
                        STemp.Name = instance.GetType().Name.ToString();
1098

    
1099
                        ///강인구 추가(2017.11.02)
1100
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
1101
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1102
                        Data.DATA_TYPE = (int)(instance.ControlType);
1103
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1104
                    }
1105
                    break;
1106
                #endregion
1107
                #region Image
1108
                case "ImgControl":
1109
                    using (S_ImgControl STemp = new S_ImgControl())
1110
                    {
1111
                        ImgControl instance = Control as ImgControl;
1112
                        STemp.Angle = instance.Angle;
1113
                        STemp.EndPoint = instance.EndPoint;
1114
                        STemp.LB = instance.LeftBottomPoint;
1115
                        STemp.Name = instance.GetType().Name;
1116
                        STemp.PointSet = instance.PointSet;
1117
                        STemp.StartPoint = instance.StartPoint;
1118
                        STemp.UserID = UserId;
1119
                        STemp.Opac = instance.Opacity;
1120
                        STemp.TR = instance.TopRightPoint;
1121
                        STemp.ImagePath = instance.FilePath;
1122
                        ///강인구 추가(2017.11.02)
1123
                        ///Memo 추가
1124
                        STemp.Memo = instance.Memo;
1125

    
1126
                        ///강인구 추가(2017.11.02)
1127
                        ///DATA_TYPE추가로 인한 클래스 변수 대입
1128
                        //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1129
                        Data.DATA_TYPE = (int)(instance.ControlType);
1130
                        Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1131
                    }
1132
                    break;
1133
                #endregion
1134
                #endregion
1135
                default:
1136
                    break;
1137
            }
1138

    
1139
            #endregion
1140

    
1141
            //return ConvertData;
1142
            return Data;
1143
        }
1144

    
1145
        public MarkupReturn MarkupToString(ObservableCollection<Control> baseLayer, string UserId)
1146
        {
1147
            MarkupReturn Data = new MarkupReturn();
1148
            Data.ConvertData = "";
1149
            Data.DATA_TYPE = 0;
1150

    
1151
            String ConvertData = "";
1152
            //int DATA_TYPE = 0;
1153

    
1154
            #region ######### 마크업 파싱##########
1155
            foreach (UIElement item in baseLayer)
1156
            {
1157
                switch (item.GetType().Name.ToString())
1158
                {
1159
                    #region Line
1160
                    #region Arrow_Multi
1161
                    case "ArrowControl_Multi":
1162
                        using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi())
1163
                        {
1164
                            var instance = item as ArrowControl_Multi;
1165
                            STemp.TransformPoint = "0|0";
1166
                            STemp.PointSet = instance.PointSet;
1167
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1168
                            //STemp.StrokeColor = "#FF00FF00";
1169
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1170
                            STemp.StartPoint = instance.StartPoint;
1171
                            STemp.EndPoint = instance.EndPoint;
1172
                            STemp.UserID = UserId;
1173
                            STemp.Opac = instance.Opacity;
1174
                            STemp.DashSize = instance.DashSize;
1175
                            STemp.MidPoint = instance.MiddlePoint;
1176
                            STemp.Name = instance.GetType().Name.ToString();
1177
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1178
                        };
1179
                        break;
1180
                    #endregion
1181
                    #region Line
1182
                    case "LineControl":
1183
                        using (S_LineControl STemp = new S_LineControl())
1184
                        {
1185
                            var instance = item as LineControl;
1186

    
1187
                            //Data Type 테스트
1188
                            Data.DATA_TYPE = (int)(instance.ControlType);
1189

    
1190
                            STemp.TransformPoint = "0|0";
1191
                            STemp.PointSet = instance.PointSet;
1192
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1193
                            STemp.LineStyleSet = instance.LineStyleSet;
1194
                            //STemp.StrokeColor = "#FF00FF00";
1195
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1196
                            STemp.StartPoint = instance.StartPoint;
1197
                            STemp.EndPoint = instance.EndPoint;
1198
                            STemp.UserID = UserId;
1199
                            STemp.Opac = instance.Opacity;
1200
                            STemp.DashSize = instance.DashSize;
1201
                            STemp.Interval = instance.Interval;
1202
                            STemp.DimSize = instance.DimSize;
1203
                            STemp.Name = instance.GetType().Name.ToString();
1204

    
1205
                            Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1206
                            //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1207
                        };
1208
                        break;
1209
                    #endregion
1210
                    #region Arc
1211
                    case "ArcControl":
1212
                        using (S_ArcControl STemp = new S_ArcControl())
1213
                        {
1214
                            var instance = item as ArcControl;
1215
                            STemp.TransformPoint = "0|0";
1216
                            STemp.PointSet = instance.PointSet;
1217
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1218
                            //STemp.StrokeColor = "#FF000FFF";
1219
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1220
                            STemp.StartPoint = instance.StartPoint;
1221
                            STemp.UserID = UserId;
1222
                            STemp.Opac = instance.Opacity;
1223
                            STemp.MidPoint = instance.MidPoint;
1224
                            STemp.EndPoint = instance.EndPoint;
1225
                            STemp.IsTransOn = instance.isTransOn;
1226
                            STemp.DashSize = instance.DashSize;
1227
                            STemp.Clock = instance.Clock;
1228
                            //STemp.ArcStyleSet = instance.ControlType;
1229
                            STemp.Name = instance.GetType().Name.ToString();
1230
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1231
                        };
1232
                        break;
1233
                    #endregion
1234
                    #endregion
1235

    
1236
                    #region Shape
1237
                    #region RectCloud
1238
                    case "RectCloudControl":
1239
                        {
1240
                            using (S_RectCloudControl STemp = new S_RectCloudControl())
1241
                            {
1242
                                var instance = item as RectCloudControl;
1243
                                STemp.TransformPoint = "0|0";
1244
                                STemp.PointSet = instance.PointSet;
1245
                                STemp.SizeSet = String.Format("{0}", instance.LineSize);
1246
                                //STemp.StrokeColor = "#FF00FF00";
1247
                                STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1248
                                STemp.StartPoint = instance.StartPoint;
1249
                                STemp.UserID = UserId;
1250
                                STemp.Opac = instance.Opacity;
1251
                                STemp.TR = instance.TopRightPoint;
1252
                                STemp.LB = instance.LeftBottomPoint;
1253
                                STemp.EndPoint = instance.EndPoint;
1254
                                STemp.PaintState = instance.Paint;
1255
                                STemp.DashSize = instance.DashSize;
1256
                                STemp.Name = instance.GetType().Name.ToString();
1257
                                ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1258
                            }
1259
                        }
1260
                        break;
1261
                    #endregion
1262
                    #region Circle
1263
                    case "CircleControl":
1264
                        using (S_CircleControl STemp = new S_CircleControl())
1265
                        {
1266
                            var instance = item as CircleControl;
1267
                            STemp.TransformPoint = "0|0";
1268
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1269
                            STemp.PaintState = instance.Paint;
1270
                            //STemp.StrokeColor = "#FF00FF00";
1271
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1272
                            if (instance.FillColor != null)
1273
                            {
1274
                                STemp.FillColor = instance.FillColor.Color.ToString();
1275
                            }
1276
                            STemp.StartPoint = instance.StartPoint;
1277
                            STemp.UserID = UserId;
1278
                            STemp.EndPoint = instance.EndPoint;
1279
                            STemp.TRP = instance.TopRightPoint;
1280
                            STemp.LBP = instance.LeftBottomPoint;
1281
                            STemp.Opac = instance.Opacity;
1282
                            STemp.Angle = instance.Angle;
1283
                            STemp.PointSet = instance.PointSet;
1284
                            STemp.DashSize = instance.DashSize;
1285
                            STemp.Name = instance.GetType().Name.ToString();
1286
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1287
                        };
1288
                        break;
1289
                    #endregion
1290
                    #region Rectangle
1291
                    case "RectangleControl":
1292
                        using (S_RectControl STemp = new S_RectControl())
1293
                        {
1294
                            var instance = item as RectangleControl;
1295
                            STemp.TransformPoint = "0|0";
1296
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1297
                            STemp.PaintState = instance.Paint;
1298
                            STemp.PointSet = instance.PointSet;
1299
                            //STemp.StrokeColor = "#FF00FF00";
1300
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1301
                            if (instance.FillColor != null)
1302
                            {
1303
                                STemp.FillColor = instance.FillColor.Color.ToString();
1304
                            }
1305
                            STemp.StartPoint = instance.StartPoint;
1306
                            STemp.UserID = UserId;
1307
                            STemp.Angle = instance.Angle;
1308
                            STemp.EndPoint = instance.EndPoint;
1309
                            STemp.LB = instance.LeftBottomPoint;
1310
                            STemp.TR = instance.TopRightPoint;
1311
                            STemp.DashSize = instance.DashSize;
1312
                            STemp.Opac = instance.Opacity;
1313
                            STemp.Name = instance.GetType().Name.ToString();
1314
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1315
                        };
1316
                        break;
1317
                    #endregion
1318
                    #region Triangle
1319
                    case "TriControl":
1320
                        using (S_TriControl STemp = new S_TriControl())
1321
                        {
1322
                            var instance = item as TriControl;
1323
                            STemp.TransformPoint = "0|0";
1324
                            STemp.Paint = instance.Paint;
1325
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1326
                            //STemp.StrokeColor = "#FF00FF00";
1327
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1328
                            if (instance.FillColor != null)
1329
                            {
1330
                                STemp.FillColor = instance.FillColor.Color.ToString();
1331
                            }
1332
                            STemp.StartPoint = instance.StartPoint;
1333
                            STemp.EndPoint = instance.EndPoint;
1334
                            STemp.MidPoint = instance.MidPoint;
1335
                            STemp.Opac = instance.Opacity;
1336
                            STemp.UserID = UserId;
1337
                            STemp.PointSet = instance.PointSet;
1338
                            STemp.Angle = instance.Angle;
1339
                            STemp.DashSize = instance.DashSize;
1340
                            STemp.Name = instance.GetType().Name.ToString();
1341
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1342
                        }
1343
                        break;
1344
                    #endregion
1345
                    #endregion
1346

    
1347
                    #region Polygon
1348
                    #region Poly
1349
                    case "PolygonControl":
1350
                        using (S_PolyControl STemp = new S_PolyControl())
1351
                        {
1352
                            var instance = item as PolygonControl;
1353

    
1354
                            STemp.TransformPoint = "0|0";
1355
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1356
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1357
                            //STemp.StrokeColor = "#FF000FFF";
1358
                            STemp.Name = instance.GetType().Name.ToString();
1359
                            //STemp.Toler = instance.Toler;
1360
                            //STemp.PaintState = instance.Paint;
1361
                            STemp.Opac = instance.Opacity;
1362
                            STemp.UserID = UserId;
1363
                            //강인구 추가(Chain인지 Polygon인지 구분)
1364
                            STemp.Type = instance.ControlType;
1365
                            //STemp.IsTrans = instance.isTransOn;
1366
                            //STemp.IsChain = instance.isChain;
1367
                            STemp.PointSet = new List<Point>();
1368
                            STemp.DashSize = instance.DashSize;
1369
                            STemp.IsCompleted = instance.IsCompleted;
1370
                            foreach (var point in instance.PointSet)
1371
                            {
1372
                                STemp.PointSet.Add(point);
1373
                            }
1374
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1375
                        };
1376
                        break;
1377
                    #endregion
1378
                    #region Cloud
1379
                    case "CloudControl":
1380
                        using (S_CloudControl STemp = new S_CloudControl())
1381
                        {
1382
                            var instance = item as CloudControl;
1383

    
1384
                            STemp.TransformPoint = "0|0";
1385
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1386
                            //STemp.StrokeColor = "#FF000FFF";
1387
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1388
                            STemp.Name = instance.GetType().Name.ToString();
1389
                            STemp.Toler = instance.Toler;
1390
                            STemp.PaintState = instance.Paint;
1391
                            STemp.Opac = instance.Opacity;
1392
                            STemp.UserID = UserId;
1393
                            STemp.IsTrans = instance.isTransOn;
1394
                            STemp.IsChain = instance.isChain;
1395
                            STemp.PointSet = new List<Point>();
1396
                            STemp.DashSize = instance.DashSize;
1397
                            foreach (var point in instance.PointSet)
1398
                            {
1399
                                STemp.PointSet.Add(point);
1400
                            }
1401

    
1402
                            //STemp.CloudFill = instance.Fill;
1403
                            STemp.ArcLength = instance.ArcLength;
1404
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1405
                        }
1406
                        break;
1407
                    #endregion
1408
                    #endregion
1409

    
1410
                    #region Text
1411
                    #region Text
1412
                    case "TextControl":
1413
                        using (S_TextControl STemp = new S_TextControl())
1414
                        {
1415

    
1416
                            var instance = item as TextControl;
1417
                            STemp.TransformPoint = "0|0";
1418
                            STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString());
1419
                            STemp.Text = instance.Text;
1420
                            STemp.UserID = UserId;
1421
                            STemp.FontColor = instance.FontColor.Color.ToString();
1422
                            //STemp.FontColor = "#FFFFFF00";
1423
                            //STemp.EndPoint = instance.EndPoint;
1424
                            STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY);
1425
                            STemp.Opac = instance.Opacity;
1426
                            //STemp.StartPoint = instance.StartPoint;
1427
                            STemp.PointSet = instance.PointSet;
1428
                            STemp.Angle = instance.Angle;
1429
                            STemp.paintMethod = instance.ControlType_No;
1430
                            STemp.BoxW = instance.BoxWidth;
1431
                            STemp.BoxH = instance.BoxHeight;
1432
                            STemp.isHighLight = instance.IsHighLight;
1433
                            STemp.Name = instance.GetType().Name.ToString();
1434
                            STemp.fontConfig = new List<string>()
1435
                            {
1436
                                instance.TextFamily.ToString(),
1437
                                instance.TextStyle.ToString(),
1438
                                instance.TextWeight.ToString(),
1439
                            };
1440

    
1441

    
1442

    
1443
                            if (instance.UnderLine != null)
1444
                            {
1445
                                STemp.fontConfig.Add("true");
1446
                            }
1447

    
1448
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1449
                        }
1450
                        break;
1451
                    #endregion
1452
                    #region ArrowText
1453
                    case "ArrowTextControl":
1454
                        using (S_ArrowTextControl STemp = new S_ArrowTextControl())
1455
                        {
1456
                            var instance = item as ArrowTextControl;
1457

    
1458
                            STemp.TransformPoint = "0|0";
1459
                            STemp.PointSet = instance.PointSet;
1460
                            STemp.SizeSet = String.Format("{0}", instance.LineSize);
1461
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1462
                            STemp.StartPoint = instance.StartPoint;
1463
                            STemp.ArrowStyle = instance.ArrowTextStyle;
1464
                            //STemp.StrokeColor = "#FF00FF00";
1465
                            STemp.UserID = UserId;
1466
                            STemp.ArrowText = instance.Base_TextBox.Text;
1467
                            STemp.BorderSize = instance.BorderSize;
1468
                            STemp.isHighLight = instance.isHighLight;
1469
                            STemp.BoxHeight = instance.BoxHeight;
1470
                            STemp.BoxWidth = instance.BoxWidth;
1471
                            STemp.Opac = instance.Opacity;
1472
                            STemp.EndPoint = instance.EndPoint;
1473
                            STemp.isFixed = instance.isFixed;
1474
                            //STemp.DashSize = instance.DashSize;
1475
                            STemp.Name = instance.GetType().Name.ToString();
1476
                            STemp.isTrans = instance.isTrans;
1477
                            STemp.MidPoint = instance.MidPoint;
1478
                            STemp.Angle = instance.Angle;
1479
                            STemp.fontConfig = new List<string>()
1480
                            {
1481
                                instance.TextFamily.ToString(),
1482
                                instance.TextStyle.ToString(),
1483
                                instance.TextWeight.ToString(),
1484
                                instance.TextSize.ToString(),
1485
                            };
1486
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1487
                        };
1488
                        break;
1489
                    #endregion
1490
                    #endregion
1491

    
1492
                    #region ETC
1493
                    #region Sign
1494
                    case "SignControl":
1495
                        {
1496
                            using (S_SignControl STemp = new S_SignControl())
1497
                            {
1498
                                //SignControl instance = item as SignControl;
1499
                                //STemp.Angle = instance.Angle;
1500
                                //STemp.EndPoint = instance.EndPoint;
1501
                                //STemp.UserID = UserId;
1502
                                //STemp.LB = instance.LeftBottomPoint;
1503
                                //STemp.Name = instance.GetType().Name;
1504
                                //STemp.PointSet = instance.PointSet;
1505
                                //STemp.StartPoint = instance.StartPoint;
1506
                                //STemp.Opac = instance.Opacity;
1507
                                //STemp.TR = instance.TopRightPoint;
1508
                                //STemp.UserNumber = instance.UserNumber;
1509
                                //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1510
                            }
1511
                        }
1512
                        break;
1513
                    #endregion
1514
                    #region Ink
1515
                    case "InkPresenter":
1516
                        {
1517
                            var instance = item as InkPresenter;
1518
                            if (instance.Strokes.Count >= 1)
1519
                            {
1520
                                using (S_PensilControl STemp = new S_PensilControl())
1521
                                {
1522
                                    bool isRealData = true;
1523
                                    foreach (var strokeData in instance.Strokes)
1524
                                    {
1525
                                        if (strokeData.StylusPoints.Count == 0)
1526
                                        {
1527
                                            isRealData = false;
1528
                                        }
1529
                                    }
1530
                                    if (isRealData)
1531
                                    {
1532
                                        if (instance.Tag != null)
1533
                                        {
1534
                                            STemp.UserID = instance.Tag.ToString();
1535
                                        }
1536
                                        STemp.SCC = instance.Strokes;
1537
                                        STemp.Name = instance.GetType().Name;
1538
                                        STemp.Opac = instance.Opacity;
1539
                                        STemp.TransformPoint = "0|0";
1540
                                        ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1541
                                    }
1542
                                }
1543
                            }
1544
                        }
1545
                        break;
1546
                    #endregion
1547
                    #region Date
1548
                    case "DateControl":
1549
                        {
1550
                            using (S_DateControl STemp = new S_DateControl())
1551
                            {
1552
                                DateControl instance = item as DateControl;
1553
                                STemp.Angle = instance.Angle;
1554
                                STemp.EndPoint = instance.EndPoint;
1555
                                STemp.UserID = UserId;
1556
                                STemp.LB = instance.LeftBottomPoint;
1557
                                STemp.Name = instance.GetType().Name;
1558
                                STemp.PointSet = instance.PointSet;
1559
                                STemp.StartPoint = instance.StartPoint;
1560
                                STemp.Opac = instance.Opacity;
1561
                                STemp.TR = instance.TopRightPoint;
1562
                                STemp.TransformPoint = "0|0";
1563
                                STemp.FontColor = instance.FontColor.Color.ToString();
1564
                                //STemp.FontColor = "#FFFFFF00";
1565
                                STemp.SizeSet = String.Format("{0}", instance.LineSize);
1566
                                STemp.Text = instance.Text;
1567
                                ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1568
                            }
1569
                        }
1570
                        break;
1571
                    #endregion
1572
                    #region Symbol
1573
                    case "SymControl":
1574
                        using (S_SymControl STemp = new S_SymControl())
1575
                        {
1576
                            var instance = item as SymControl;
1577
                            STemp.TransformPoint = "0|0";
1578
                            STemp.PointSet = instance.PointSet;
1579
                            STemp.UserID = UserId;
1580
                            STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString());
1581
                            STemp.PaintState = instance.Paint;
1582
                            STemp.PathInfo = instance.PathData.ToString();
1583
                            STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1584
                            STemp.StartPoint = instance.StartPoint;
1585
                            STemp.Angle = instance.Angle;
1586
                            STemp.EndPoint = instance.EndPoint;
1587
                            STemp.LB = instance.LeftBottomPoint;
1588
                            STemp.TR = instance.TopRightPoint;
1589
                            STemp.Opac = instance.Opacity;
1590
                            STemp.Name = instance.GetType().Name.ToString();
1591
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1592
                        }
1593
                        break;
1594
                    #endregion
1595
                    #region SymbolN
1596
                    case "SymControlN":
1597
                        using (S_SymControlN STemp = new S_SymControlN())
1598
                        {
1599
                            var instance = item as SymControlN;
1600
                            STemp.TransformPoint = "0|0";
1601
                            STemp.PointSet = instance.PointSet;
1602
                            //STemp.XamlData = instance.PathXathData;
1603
                            STemp.UserID = UserId;
1604
                            STemp.DBData = JsonSerializerHelper.CompressString(instance.PathXathData);
1605
                            //STemp.StrokeColor = instance.StrokeColor.Color.ToString();
1606
                            STemp.StartPoint = instance.StartPoint;
1607
                            STemp.Angle = instance.Angle;
1608
                            STemp.EndPoint = instance.EndPoint;
1609
                            STemp.LB = instance.LeftBottomPoint;
1610
                            STemp.TR = instance.TopRightPoint;
1611
                            STemp.Opac = instance.Opacity;
1612
                            STemp.Name = instance.GetType().Name.ToString();
1613
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1614
                        }
1615
                        break;
1616
                    #endregion
1617
                    #region Image
1618
                    case "ImgControl":
1619
                        using (S_ImgControl STemp = new S_ImgControl())
1620
                        {
1621
                            ImgControl instance = item as ImgControl;
1622
                            STemp.Angle = instance.Angle;
1623
                            STemp.EndPoint = instance.EndPoint;
1624
                            STemp.LB = instance.LeftBottomPoint;
1625
                            STemp.Name = instance.GetType().Name;
1626
                            STemp.PointSet = instance.PointSet;
1627
                            STemp.StartPoint = instance.StartPoint;
1628
                            STemp.UserID = UserId;
1629
                            STemp.Opac = instance.Opacity;
1630
                            STemp.TR = instance.TopRightPoint;
1631
                            STemp.ImagePath = instance.FilePath;
1632
                            ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
1633
                        }
1634
                        break;
1635
                    #endregion
1636
                    #endregion
1637
                    default:
1638
                        break;
1639
                }
1640
            }
1641
            #endregion
1642

    
1643
            //return ConvertData;
1644
            return Data;
1645
        }
1646

    
1647

    
1648
        //GUID생성(최민수 사원 수정)
1649
        public string shortGuid()
1650
        {
1651
            byte[] bytes = new byte[16];
1652
            using (var provider = System.Security.Cryptography.RandomNumberGenerator.Create())
1653
            {
1654
                provider.GetBytes(bytes);
1655
            }
1656

    
1657
            var guid = new Guid(bytes);
1658

    
1659
            return Convert.ToBase64String(guid.ToByteArray())
1660
                .Substring(0, 10)
1661
                .Replace("/", "")
1662
                .Replace("+", "") + DateTime.UtcNow.Ticks.ToString("x");
1663
        }
1664

    
1665
        //GUID생성
1666
        //안쓰는 내용
1667
        public Guid GetUniqueGuid()
1668
        {
1669
            char[] chars = "ABCDEF1234567890".ToCharArray();
1670
            byte[] data = new byte[1];
1671
            System.Security.Cryptography.RNGCryptoServiceProvider crypto = new System.Security.Cryptography.RNGCryptoServiceProvider();
1672
            crypto.GetNonZeroBytes(data);
1673
            data = new byte[32];
1674
            crypto.GetNonZeroBytes(data);
1675
            StringBuilder result = new StringBuilder(32);
1676

    
1677
            foreach (byte b in data)
1678
            {
1679
                result.Append(chars[b % (chars.Length - 1)]);
1680
            }
1681

    
1682
            return Guid.ParseExact(result.ToString(0, 8) + "-" + result.ToString(8, 4) + "-" + result.ToString(11, 4) + "-"
1683
                + result.ToString(16, 4) + "-" + result.ToString(20, 12), "D");
1684
        }
1685

    
1686
        ///강인구 추가(2017.11.02)
1687
        ///DATA_TYPE추가로 인한 클래스 변수 추가
1688
        //markup_Data.DATA = MarkupString;
1689
        public class MarkupReturn
1690
        {
1691
            public string ConvertData { get; set; }
1692
            public int DATA_TYPE { get; set; }
1693

    
1694
            public string CommentID { get; set; }
1695
        }
1696

    
1697
        //GUID생성
1698
        //public Guid GetUniqueGuid()
1699
        //{
1700
        //    char[] chars = "ABCDEF1234567890".ToCharArray();
1701
        //    byte[] data = new byte[1];
1702
        //    System.Security.Cryptography.RNGCryptoServiceProvider crypto = new System.Security.Cryptography.RNGCryptoServiceProvider();
1703
        //    crypto.GetNonZeroBytes(data);
1704
        //    data = new byte[32];
1705
        //    crypto.GetNonZeroBytes(data);
1706
        //    StringBuilder result = new StringBuilder(32);
1707

    
1708
        //    foreach (byte b in data)
1709
        //    {
1710
        //        result.Append(chars[b % (chars.Length - 1)]);
1711
        //    }
1712

    
1713
        //    return Guid.ParseExact(result.ToString(0, 8) + "-" + result.ToString(8, 4) + "-" + result.ToString(11, 4) + "-"
1714
        //        + result.ToString(16, 4) + "-" + result.ToString(20, 12), "D");
1715
        //}
1716
    }
1717
}
클립보드 이미지 추가 (최대 크기: 500 MB)