프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Controls / Parsing / MarkupParse.cs @ 1a503498

이력 | 보기 | 이력해설 | 다운로드 (361 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 System.Collections.Generic;
12
using MarkupToPDF.Serialize.S_Control;
13
using MarkupToPDF.Serialize.Core;
14
using System.Linq;
15
using MarkupToPDF.Controls.Line;
16
using MarkupToPDF.Controls.Text;
17
using MarkupToPDF.Controls.Shape;
18
using MarkupToPDF.Controls.Etc;
19
using MarkupToPDF.Controls.Polygon;
20
//using Telerik.Windows.Controls;
21
using System.IO;
22
using System.Windows.Media.Imaging;
23
//using MarkupToPDF.Common;
24
using System.Windows.Markup;
25
//using Telerik.Windows.Controls;
26
using System.Net.Cache;
27
using System.Collections.ObjectModel;
28
using MarkupToPDF.Common;
29

    
30
namespace MarkupToPDF.Controls.Parsing
31
{
32
    public partial class LayerControl : Control
33
    {
34
        public GetUserSign getUser = new GetUserSign();
35
        //public string appovalData = "eJyycS/KTFHwS8xNtVVKBAMlhYrcnLxiW6WMkpICK3394uSM1NzEYr3czOSi/OL8tBK95Pxc/fLMvLQKfSMDAzP9isTcHP2CotTi1LySxJLM/DwlOxuQqXpOicnZ6UX5pXkpdjbB+TmZKc75OflFTkWlxRkKYKatkrIbFCgp+BckJmeWVNoqGegZKino29noYxgSlJpckpiXnpOqEFxSlFqSnGGr5JaZk6ME4uZnp0KNMwACmFBIRmZydl5qMdA7pjAxn8y8VK/8zDxbpSCQsUpQ38MNV1IIz0wpAZptZADU45GamZ5RYqtkYamk4JyYVwYMCZ/UNKCArpGeKVwoJL8AJqIP8T00DILyy11S0zLzMkEBUwz0AjIfbrgWWBt2OWM9U3zSBviljfBJaiGFM7pDQ1IrSpxy8pOzFUAsWyXHgIAg/zBXFyUFt/y8knCoCa4VJUWJTvk5KRDh4MwqYEgaG4B4RamQaEOJFY/8oswqoMLEHMeczPS8XGCSsVVyBpKpRUoKYalFJZnJWKVgTrRVgqQNdNc5VSqkJKbmZOYS4TwjWjrPGBGkMAoAAAD//w==";
36
        public string ProjectNo = "";
37

    
38
        #region 주석
39
        //        public void markupParseConSolidate(string MarkupString, Canvas Layer, List<DisplayColorInfo> dc, string ToolTipMessage, string userID)
40
        //        {
41
        //            if (MarkupString != "False")
42
        //            {
43
        //                //SolidColorBrush _SetColor = new SolidColorBrush(StringToColorConverter.Parse(DisplayColor));
44
        //                SolidColorBrush _SetColor = new SolidColorBrush(Colors.Blue);
45
        //                string[] delimiterChars = { "|DZ|" };
46
        //                string[] delimiterChars2 = { "|" };
47
        //                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
48
        //                List<string> dataSet = new List<string>();
49

    
50
        //                foreach (var dataPease in data)
51
        //                {
52
        //                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
53
        //                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
54
        //                    switch (unkownControl.Name)
55
        //                    {
56
        //                        #region Arrow
57
        //                        case "ArrowControl":
58
        //                            using (S_ArrowControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl>(item))
59
        //                            {
60
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
61
        //                                LineControl instance = new LineControl
62
        //                                {
63
        //                                    LineSize = Convert.ToDouble(data2.First()),
64
        //                                    LineStyle = s.ArStyle,
65
        //                                    StartPoint = s.StartPoint,
66
        //                                    EndPoint = s.EndPoint,
67
        //                                    DimSize = s.DimSize,
68
        //                                    DashSize = s.DashSize,
69
        //                                    PointSet = s.PointSet,
70
        //                                    UserID = s.UserID,
71
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
72
        //                                    Opacity = s.Opac,
73
        //                                };
74

    
75
        //                                ToolTipService.SetToolTip(instance, s.UserID);
76
        //                                Layer.Children.Add(instance);
77
        //                                instance.ApplyTemplate();
78
        //                                instance.SetLinePath();
79
        //                            }
80
        //                            break;
81
        //                        #endregion
82
        //                        #region ArrowText
83
        //                        case "ArrowTextControl":
84
        //                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
85
        //                            {
86
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
87
        //                                ArrowTextControl instance = new ArrowTextControl();
88
        //                                Layer.Children.Add(instance);
89
        //                                instance.LineSize = Convert.ToDouble(data2.First());
90
        //                                instance.PointSet = s.PointSet;
91
        //                                instance.StartPoint = s.StartPoint;
92
        //                                instance.EndPoint = s.EndPoint;
93
        //                                instance.isHighLight = s.isHighLight;
94
        //                                //instance.StrokeColor = GetUserColor(dc, s.UserID);
95
        //                                //instance.DashSize = s.DashSize;
96
        //                                instance.ArrowTextStyle = s.ArrowStyle;
97
        //                                instance.ArrowText = s.ArrowText;
98
        //                                instance.Opacity = s.Opac;
99
        //                                instance.isFixed = s.isFixed;
100
        //                                instance.UserID = s.UserID;
101
        //                                instance.BorderSize = s.BorderSize;
102
        //                                instance.BoxWidth = s.BoxWidth;
103
        //                                instance.BoxHeight = s.BoxHeight;
104
        //                                instance.isTrans = s.isTrans;
105
        //                                instance.Angle = s.Angle;
106
        //                                instance.MidPoint = s.MP;
107

    
108
        //                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
109
        //                                {
110
        //                                    s.fontConfig = new List<string>();
111

    
112
        //                                    s.fontConfig.Add("Arial");
113
        //                                    s.fontConfig.Add("Normal");
114
        //                                    s.fontConfig.Add("Normal");
115
        //                                    s.fontConfig.Add("30");
116
        //                                }
117
        //                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
118
        //                                //instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
119
        //                                //instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
120
        //                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
121

    
122
        //                                instance.ApplyTemplate();
123
        //                                instance.SetArrowTextPath();
124
        //                                ToolTipService.SetToolTip(instance, s.UserID);
125
        //                            };
126
        //                            break;
127
        //                        #endregion
128
        //                        #region Arrow_Multi
129
        //                        case "ArrowControl_Multi":
130
        //                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
131
        //                            {
132
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
133
        //                                ArrowControl_Multi instance = new ArrowControl_Multi
134
        //                                {
135
        //                                    LineSize = Convert.ToDouble(data2.First()),
136
        //                                    StartPoint = s.StartPoint,
137
        //                                    MiddlePoint = s.MP,
138
        //                                    DashSize = s.DashSize,
139
        //                                    EndPoint = s.EndPoint,
140
        //                                    PointSet = s.PointSet,
141
        //                                    Opacity = s.Opac,
142
        //                                    UserID = s.UserID,
143
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
144
        //                                };
145
        //                                ToolTipService.SetToolTip(instance, s.UserID);
146
        //                                Layer.Children.Add(instance);
147
        //                                instance.ApplyTemplate();
148
        //                                instance.SetArrowMultiPath();
149
        //                                //instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
150

    
151
        //                            }
152
        //                            break;
153
        //                        #endregion
154
        //                        #region Rectangle
155
        //                        case "RectagleControl":
156
        //                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
157
        //                            {
158
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
159

    
160

    
161
        //                                RectangleControl instance = new RectangleControl
162
        //                                {
163
        //                                    LineSize = Convert.ToDouble(data2.First()),
164
        //                                    //Paint = s.PaintState,
165
        //                                    StartPoint = s.StartPoint,
166
        //                                    EndPoint = s.EndPoint,
167
        //                                    //Angle = s.Angle,
168

    
169
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
170
        //                                    //DashSize = s.DashSize,
171
        //                                    //UserID = s.UserID,
172
        //                                    Opacity = s.Opac,
173
        //                                    LeftBottomPoint = s.LB,
174
        //                                    TopRightPoint = s.TR,
175
        //                                    PointSet = s.PointSet
176
        //                                };
177
        //                                ToolTipService.SetToolTip(instance, s.UserID);
178

    
179
        //                                Layer.Children.Add(instance);
180
        //                                instance.ApplyTemplate();
181
        //                                //instance.SetRectPath();
182
        //                                instance.SetRectPath(null);
183
        //                            }
184
        //                            break;
185
        //                        #endregion
186
        //                        #region Triangle
187
        //                        case "TriControl":
188
        //                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
189
        //                            {
190
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
191
        //                                TriControl instance = new TriControl
192
        //                                {
193
        //                                    LineSize = Convert.ToDouble(data2.First()),
194
        //                                    MidPoint = s.MP,
195
        //                                    StartPoint = s.StartPoint,
196
        //                                    Paint = s.Paint,
197
        //                                    EndPoint = s.EndPoint,
198
        //                                    Opacity = s.Opac,
199
        //                                    UserID = s.UserID,
200
        //                                    Angle = s.Angle,
201
        //                                    DashSize = s.DashSize,
202
        //                                    PointSet = s.PointSet,
203
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
204
        //                                };
205
        //                                ToolTipService.SetToolTip(instance, s.UserID);
206
        //                                Layer.Children.Add(instance);
207
        //                                instance.ApplyTemplate();
208
        //                                instance.SetTri();
209
        //                            }
210
        //                            break;
211
        //                        #endregion
212
        //                        #region Cicle
213
        //                        case "CicleControl":
214
        //                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
215
        //                            {
216
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
217
        //                                CircleControl instance = new CircleControl
218
        //                                {
219
        //                                    LineSize = Convert.ToDouble(data2.First()),
220
        //                                    Paint = s.PaintState,
221
        //                                    StartPoint = s.StartPoint,
222
        //                                    EndPoint = s.EndPoint,
223
        //                                    LeftBottomPoint = s.LBP,
224
        //                                    TopRightPoint = s.TRP,
225
        //                                    Opacity = s.Opac,
226
        //                                    Angle = s.Angle,
227
        //                                    DashSize = s.DashSize,
228
        //                                    PointSet = s.PointSet,
229
        //                                    UserID = s.UserID,
230
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
231
        //                                };
232
        //                                ToolTipService.SetToolTip(instance, s.UserID);
233
        //                                Layer.Children.Add(instance);
234
        //                                instance.ApplyTemplate();
235
        //                                instance.SetCircle();
236
        //                            }
237
        //                            break;
238
        //                        #endregion
239
        //                        #region Cloud
240
        //                        case "CloudControl":
241
        //                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
242
        //                            {
243
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
244
        //                                CloudControl instance = new CloudControl
245
        //                                {
246
        //                                    LineSize = Convert.ToDouble(data2.First()),
247
        //                                    Toler = s.Toler,
248
        //                                    PointSet = new List<Point>(),
249
        //                                    ArcLength = s.ArcLength,
250
        //                                    Paint = s.PaintState,
251
        //                                    Opacity = s.Opac,
252
        //                                    UserID = s.UserID,
253
        //                                    isChain = s.IsChain,
254
        //                                    DashSize = s.DashSize,
255
        //                                    isTransOn = s.IsTrans,
256
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
257
        //                                    //Fill = s.CloudFill,
258
        //                                };
259
        //                                ToolTipService.SetToolTip(instance, s.UserID);
260
        //                                Layer.Children.Add(instance);
261
        //                                instance.ApplyTemplate();
262
        //                                instance.PointSet = s.PointSet;
263
        //                                instance.ChangePaint(s.PaintState);
264
        //                            }
265
        //                            break;
266
        //                        #endregion
267
        //                        #region Line
268
        //                        case "LineControl":
269
        //                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
270
        //                            {
271
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
272
        //                                LineControl instance = new LineControl()
273
        //                                {
274
        //                                    LineStyle = s.LnSet,
275
        //                                    StartPoint = s.StartPoint,
276
        //                                    EndPoint = s.EndPoint,
277
        //                                    DashSize = s.DashSize,
278
        //                                    PointSet = s.PointSet,
279
        //                                    Opacity = s.Opac,
280
        //                                    UserID = s.UserID,
281
        //                                    Interval = s.Interval,
282
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
283
        //                                    LineSize = Convert.ToDouble(data2.First()),
284
        //                                };
285
        //                                ToolTipService.SetToolTip(instance, s.UserID);
286
        //                                Layer.Children.Add(instance);
287
        //                                instance.ApplyTemplate();
288
        //                                instance.SetLinePath();
289
        //                            }
290
        //                            break;
291
        //                        #endregion
292
        //                        #region Text
293
        //                        case "TextControl":
294
        //                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
295
        //                            {
296
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
297
        //                                TextControl instance = new TextControl()
298
        //                                {
299
        //                                    Text = s.Text,
300
        //                                    StartPoint = s.StartPoint,
301
        //                                    EndPoint = s.EndPoint,
302
        //                                    Paint = s.PaintState,
303
        //                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
304
        //                                    TextSize = Convert.ToDouble(data2[1]),
305
        //                                    //FontColor = GetUserColor(dc, s.UserID),
306
        //                                    FontSize = 10,
307
        //                                    //isHighLight = s.isHighLight,
308
        //                                    Angle = s.Angle,
309
        //                                    PointSet = s.PointSet,
310
        //                                    Opacity = s.Opac,
311
        //                                    UserID = s.UserID,
312
        //                                    TextFamily = new FontFamily(s.fontConfig[0]),
313
        //                                    //TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
314
        //                                    //TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
315
        //                                };
316
        //                                if (instance.Text != null && instance.Text != "")
317
        //                                {
318
        //                                    ToolTipService.SetToolTip(instance, s.UserID);
319
        //                                    Layer.Children.Add(instance);
320

    
321
        //                                    if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
322
        //                                    {
323
        //                                        s.fontConfig = new List<string>();
324

    
325
        //                                        s.fontConfig.Add("Arial");
326
        //                                        s.fontConfig.Add("Normal");
327
        //                                        s.fontConfig.Add("Normal");
328
        //                                        s.fontConfig.Add("30");
329
        //                                    }
330
        //                                    instance.TextFamily = new FontFamily(s.fontConfig[0]);
331
        //                                    //instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
332
        //                                    //instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
333

    
334
        //                                    //if (s.fontConfig.Count == 3)
335
        //                                    //{
336
        //                                    //    instance.TextSize = 30;
337
        //                                    //}
338
        //                                    //else
339
        //                                    //{
340
        //                                    //    instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
341
        //                                    //}
342

    
343

    
344
        //                                    instance.ApplyTemplate();
345
        //                                    if (s.fontConfig.Count() == 4)
346
        //                                    {
347
        //                                        instance.UnderLine = TextDecorations.Underline;
348
        //                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
349
        //                                    }
350
        //                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
351
        //                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
352
        //                                    instance.DrawingCloud();
353
        //                                }
354
        //                            }
355
        //                            break;
356
        //                        #endregion
357
        //                        #region Arc
358
        //                        case "ArcControl":
359
        //                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
360
        //                            {
361
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
362
        //                                ArcControl instance = new ArcControl()
363
        //                                {
364
        //                                    StartPoint = s.StartPoint,
365
        //                                    EndPoint = s.EndPoint,
366
        //                                    DashSize = s.DashSize,
367
        //                                    PointSet = s.PointSet,
368
        //                                    MidPoint = s.MP,
369
        //                                    UserID = s.UserID,
370
        //                                    isTransOn = s.IsTrans,
371
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
372
        //                                    LineSize = Convert.ToDouble(data2.First()),
373
        //                                };
374
        //                                ToolTipService.SetToolTip(instance, s.UserID);
375
        //                                Layer.Children.Add(instance);
376
        //                                instance.ApplyTemplate();
377
        //                                instance.SetArcPath();
378
        //                            }
379
        //                            break;
380
        //                        #endregion
381
        //                        #region RectCloud
382
        //                        case "RectCloudControl":
383
        //                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
384
        //                            {
385
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
386
        //                                RectCloudControl instance = new RectCloudControl()
387
        //                                {
388
        //                                    StartPoint = s.StartPoint,
389
        //                                    EndPoint = s.EndPoint,
390
        //                                    LeftBottomPoint = s.LB,
391
        //                                    Paint = s.PaintState,
392
        //                                    Opacity = s.Opac,
393
        //                                    TopRightPoint = s.TR,
394
        //                                    UserID = s.UserID,
395
        //                                    PointSet = s.PointSet,
396
        //                                    DashSize = s.DashSize,
397
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
398
        //                                    LineSize = Convert.ToDouble(data2.First()),
399
        //                                };
400
        //                                ToolTipService.SetToolTip(instance, s.UserID);
401
        //                                Layer.Children.Add(instance);
402
        //                                instance.ApplyTemplate();
403
        //                                instance.SetRectCloud();
404
        //                            }
405
        //                            break;
406
        //                        #endregion
407
        ////                        #region Sign
408
        ////                        case "SignControl":
409
        ////                            {
410
        ////                                using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
411
        ////                                {
412
        ////                                    SignControl instance = new SignControl
413
        ////                                    {
414
        ////                                        Angle = s.Angle,
415
        ////                                        UserNumber = s.UserNumber,
416
        ////                                        StartPoint = s.StartPoint,
417
        ////                                        TopRightPoint = s.TR,
418
        ////                                        EndPoint = s.EndPoint,
419
        ////                                        UserID = s.UserID,
420
        ////                                        LeftBottomPoint = s.LB,
421
        ////                                        PointSet = s.PointSet,
422
        ////                                        SignImage = null,
423
        ////                                    };
424
        ////                                    ToolTipService.SetToolTip(instance, s.UserID);
425
        ////#if SILVERLIGHT
426
        ////                                    SignUserSet.Add(instance);
427
        ////#endif
428
        ////                                    Layer.Children.Add(instance);
429
        ////                                    instance.ApplyTemplate();
430
        ////                                    instance.SetImage();
431
        ////                                }
432
        ////                            }
433
        ////                            break;
434
        ////                        #endregion
435
        ////                        #region SymbolN
436
        ////                        case "SymControlN":
437
        ////                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
438
        ////                            {
439
        ////                                SymControlN instance = new SymControlN()
440
        ////                                {
441
        ////                                    PointSet = s.PointSet,
442
        ////                                    StartPoint = s.StartPoint,
443
        ////                                    EndPoint = s.EndPoint,
444
        ////                                    Angle = s.Angle,
445
        ////                                    LeftBottomPoint = s.LB,
446
        ////                                    UserID = s.UserID,
447
        ////                                    TopRightPoint = s.TR,
448
        ////                                    Opacity = s.Opac,
449
        ////                                    //PathXathData = s.DBData,
450
        ////                                };
451
        ////                                Layer.Children.Add(instance);
452
        ////                                instance.ApplyTemplate();
453
        ////                                ToolTipService.SetToolTip(instance, s.UserID);
454
        ////#else
455
        ////                                instance.PathXathData = JsonSerializerHelper.UnCompressString_NonPrefix(s.DBData);
456
        ////                                MemoryStream memoryStream = new MemoryStream(Convert.FromBase64String(instance.PathXathData));
457
        ////                                object obj = XamlReader.Load(memoryStream);
458
        ////#endif
459
        ////                                instance.Base_ViewBox.Child = obj as UIElement;
460
        ////                                instance.SetViewBox();
461
        ////                            }
462
        ////                            break;
463
        ////                        #endregion
464
        //                        //#region Ink
465
        //                        //case "InkPresenter":
466
        //                        //    using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
467
        //                        //    {
468

    
469
        //                        //        if (((Layer as UIElement) as FrameworkElement).Name == "BaseLayer")
470
        //                        //        {
471
        //                        //                //this._InkBoard.Strokes = s.SCC;
472
        //                        //            foreach (var root in s.SCC)
473
        //                        //            {
474
        //                        //                if (s.UserID != null && data.Count() >1)
475
        //                        //                {
476
        //                        //                    root.DrawingAttributes.Color = GetUserColor(dc, s.UserID).Color;    
477
        //                        //                }
478
        //                        //                this._InkBoard.Strokes.Add(root);
479
        //                        //            }   
480
        //                        //        }
481
        //                        //        else
482
        //                        //        {
483
        //                        //            InkPresenter instance = new InkPresenter();
484
        //                        //            instance.Strokes = s.SCC;
485
        //                        //            if (s.UserID != null)
486
        //                        //            {
487
        //                        //                instance.Tag = s.UserID.ToString();
488
        //                        //            }
489
        //                        //            foreach (var stroke in instance.Strokes)
490
        //                        //            {
491
        //                        //                if (s.UserID != null && data.Count() > 1)
492
        //                        //                {
493
        //                        //                    stroke.DrawingAttributes.Color = GetUserColor(dc, s.UserID).Color;
494
        //                        //                }
495

    
496
        //                        //                if (stroke.DrawingAttributes.Color == StringToColorConverter.Parse("#FFFF0000"))
497
        //                        //                {
498
        //                        //                    stroke.DrawingAttributes.Color = GetUserColor(dc, s.UserID).Color;
499
        //                        //                }
500
        //                        //                //stroke.DrawingAttributes.Color = GetUserColor(dc, userID).Color;
501
        //                        //            }
502
        //                        //            ToolTipService.SetToolTip(instance, s.UserID);
503
        //                        //            Layer.Children.Add(instance);
504
        //                        //        }
505

    
506
        //                        //    }
507
        //                        //    break;
508
        //                        //#endregion
509
        //                        #region Date
510
        //                        case "DateControl":
511
        //                            {
512
        //                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
513
        //                                {
514
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
515
        //                                    DateControl instance = new DateControl
516
        //                                    {
517
        //                                        Angle = s.Angle,
518
        //                                        StartPoint = s.StartPoint,
519
        //                                        EndPoint = s.EndPoint,
520
        //                                        LeftBottomPoint = s.LB,
521
        //                                        TopRightPoint = s.TR,
522
        //                                        Opacity = s.Opac,
523
        //                                        //FontColor = GetUserColor(dc, s.UserID),
524
        //                                        UserID = s.UserID,
525
        //                                        LineSize = Convert.ToDouble(data2.First()),
526
        //                                        Text = s.Text,
527
        //                                        PointSet = s.PointSet,
528
        //                                    };
529
        //                                    ToolTipService.SetToolTip(instance, s.UserID);
530
        //                                    Layer.Children.Add(instance);
531
        //                                    instance.ApplyTemplate();
532
        //                                    instance.SetDate();
533
        //                                }
534
        //                            }
535
        //                            break;
536
        //                        #endregion
537
        //                        //#region Symbol
538
        //                        //case "SymControl":
539
        //                        //    using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
540
        //                        //    {
541
        //                        //        string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
542
        //                        //        StringToPathConverter sm = new StringToPathConverter();
543
        //                        //        SymControl instance = new SymControl()
544
        //                        //        {
545
        //                        //            LineSize = Convert.ToDouble(data2.First()),
546
        //                        //            PointSet = s.PointSet,
547
        //                        //            Paint = s.PaintState,
548
        //                        //            StartPoint = s.StartPoint,
549
        //                        //            StrokeColor = GetUserColor(dc, s.UserID),
550
        //                        //            EndPoint = s.EndPoint,
551
        //                        //            Angle = s.Angle,
552
        //                        //            UserID = s.UserID,
553
        //                        //            LeftBottomPoint = s.LB,
554
        //                        //            TopRightPoint = s.TR,
555
        //                        //            PathData = sm.Convert(s.PathInfo.ToString()),
556
        //                        //            Opacity = s.Opac,
557
        //                        //        };
558
        //                        //        ToolTipService.SetToolTip(instance, s.UserID);
559
        //                        //        Layer.Children.Add(instance);
560
        //                        //        instance.ApplyTemplate();
561
        //                        //        instance.SetSymPath();
562
        //                        //    }
563
        //                        //    break;
564
        //                        //#endregion
565
        //                        #region Image
566
        //                        case "ImgControl":
567
        //                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
568
        //                            {
569
        //                                ImgControl instance = new ImgControl
570
        //                                {
571
        //                                    Angle = s.Angle,
572
        //                                    StartPoint = s.StartPoint,
573
        //                                    TopRightPoint = s.TR,
574
        //                                    EndPoint = s.EndPoint,
575
        //                                    LeftBottomPoint = s.LB,
576
        //                                    PointSet = s.PointSet,
577
        //                                    UserID = s.UserID,
578
        //                                    Opacity = s.Opac,
579
        //                                    FilePath = s.ImagePath,
580
        //                                };
581
        //                                Layer.Children.Add(instance);
582
        //                                instance.ApplyTemplate();
583
        //                                try
584
        //                                {
585
        //                                    instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
586
        //                                    ToolTipService.SetToolTip(instance, s.UserID);
587
        //                                    instance.SetImage();
588
        //                                }
589
        //                                catch (Exception)
590
        //                                {
591
        //                                    break;
592
        //                                }
593

    
594

    
595
        //                            }
596
        //                            break;
597
        //                        #endregion
598
        //                        default:
599
        //                            break;
600
        //                    };
601
        //                }
602
        //            }
603
        //        }
604
        //        /// <summary>
605
        //        /// 복사전용
606
        //        /// </summary>
607
        //        /// <param name="MarkupString"></param>
608
        //        /// <param name="Layer"></param>
609
        //        /// <param name="ToolTipMessage"></param>
610
        //        public void markupParse(string MarkupString, Canvas Layer, string ToolTipMessage)
611
        //        {
612
        //            if (MarkupString != "False")
613
        //            {
614
        //                SignUserSet = new List<SignControl>();
615
        //                CopyDataSet = new List<UIElement>();
616
        //                string[] delimiterChars = { "|DZ|" };
617
        //                string[] delimiterChars2 = { "|" };
618
        //                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
619
        //                //ServiceDeepViewClient client = new ServiceDeepViewClient(this._Basebinding, this._BaseEndPoint);
620
        //                List<string> dataSet = new List<string>();
621
        //                foreach (var dataPease in data)
622
        //                {
623
        //                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
624
        //                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
625
        //                    switch (unkownControl.Name)
626
        //                    {
627
        //                        #region Arrow
628
        //                        case "ArrowControl":
629
        //                            using (S_ArrowControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl>(item))
630
        //                            {
631
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
632
        //                                ArrowControl instance = new ArrowControl
633
        //                                {
634
        //                                    LineSize = Convert.ToDouble(data2.First()),
635
        //                                    ArrowStyle = s.ArStyle,
636
        //                                    StartPoint = s.StartPoint,
637
        //                                    EndPoint = s.EndPoint,
638
        //                                    DimSize = s.DimSize,
639
        //                                    DashSize = s.DashSize,
640
        //                                    PointSet = s.PointSet,
641

    
642
        //                                    StrokeColor = new SolidColorBrush(Colors.Red)
643
        //                                };
644
        //                                Layer.Children.Add(instance);
645
        //                                CopyDataSet.Add(instance);
646
        //                                instance.ApplyTemplate();
647
        //                                instance.SetArrowPath();
648
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
649

    
650
        //                            }
651
        //                            break;
652
        //                        #endregion
653
        //                        #region RectCloud
654
        //                        case "RectCloudControl":
655
        //                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
656
        //                            {
657
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
658
        //                                RectCloudControl instance = new RectCloudControl()
659
        //                                {
660
        //                                    StartPoint = s.StartPoint,
661
        //                                    EndPoint = s.EndPoint,
662
        //                                    LeftBottomPoint = s.LB,
663
        //                                    Paint = s.PaintState,
664
        //                                    Opacity = s.Opac,
665
        //                                    TopRightPoint = s.TR,
666
        //                                    PointSet = s.PointSet,
667
        //                                    DashSize = s.DashSize,
668
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
669
        //                                    LineSize = Convert.ToDouble(data2.First()),
670
        //                                };
671
        //                                Layer.Children.Add(instance);
672
        //                                instance.ApplyTemplate();
673
        //                                CopyDataSet.Add(instance);
674
        //                                instance.SetRectCloud();
675
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
676
        //                            }
677
        //                            break;
678
        //                        #endregion
679
        //                        #region ArrowText
680
        //                        case "ArrowTextControl":
681
        //                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
682
        //                            {
683
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
684
        //                                ArrowTextControl instance = new ArrowTextControl();
685
        //                                Layer.Children.Add(instance);
686
        //                                instance.LineSize = Convert.ToDouble(data2.First());
687
        //                                instance.PointSet = s.PointSet;
688
        //                                instance.StartPoint = s.StartPoint;
689
        //                                instance.EndPoint = s.EndPoint;
690
        //                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
691
        //                                instance.DashSize = s.DashSize;
692
        //                                instance.ArrowTextStyle = s.ArrowStyle;
693
        //                                instance.ArrowText = s.ArrowText;
694
        //                                instance.BorderSize = s.BorderSize;
695
        //                                instance.BoxWidth = s.BoxWidth;
696
        //                                instance.BoxHeight = s.BoxHeight;
697
        //                                instance.isHighLight = s.isHighLight;
698
        //                                instance.isFixed = s.isFixed;
699
        //                                instance.ApplyTemplate();
700
        //                                instance.SetArrowTextPath();
701
        //                                instance.isTrans = s.isTrans;
702
        //                                instance.MidPoint = s.MP;
703
        //                                instance.Angle = s.Angle;
704
        //                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
705
        //                                {
706
        //                                    s.fontConfig = new List<string>();
707

    
708
        //                                    s.fontConfig.Add("Arial");
709
        //                                    s.fontConfig.Add("Normal");
710
        //                                    s.fontConfig.Add("Normal");
711
        //                                    s.fontConfig.Add("30");
712
        //                                }
713
        //                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
714
        //                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
715
        //                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
716
        //                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
717
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
718
        //                                CopyDataSet.Add(instance);
719
        //                                instance.ApplyTemplate();
720
        //                                instance.SetArrowTextPath();
721
        //                            };
722

    
723
        //                            break;
724
        //                        #endregion
725
        //                        #region Arrow_Multi
726
        //                        case "ArrowControl_Multi":
727
        //                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
728
        //                            {
729
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
730
        //                                ArrowControl_Multi instance = new ArrowControl_Multi
731
        //                                {
732
        //                                    LineSize = Convert.ToDouble(data2.First()),
733
        //                                    StartPoint = s.StartPoint,
734
        //                                    MiddlePoint = s.MP,
735
        //                                    DashSize = s.DashSize,
736
        //                                    EndPoint = s.EndPoint,
737
        //                                    PointSet = s.PointSet,
738
        //                                    StrokeColor = new SolidColorBrush(Colors.Red)
739
        //                                };
740
        //                                Layer.Children.Add(instance);
741
        //                                CopyDataSet.Add(instance);
742
        //                                instance.ApplyTemplate();
743
        //                                instance.SetArrowMultiPath();
744
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
745

    
746
        //                            }
747
        //                            break;
748
        //                        #endregion
749
        //                        #region Rectangle
750
        //                        case "RectagleControl":
751
        //                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
752
        //                            {
753
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
754
        //                                RectagleControl instance = new RectagleControl
755
        //                                {
756
        //                                    LineSize = Convert.ToDouble(data2.First()),
757
        //                                    Paint = s.PaintState,
758
        //                                    StartPoint = s.StartPoint,
759
        //                                    EndPoint = s.EndPoint,
760
        //                                    Angle = s.Angle,
761
        //                                    LeftBottomPoint = s.LB,
762
        //                                    TopRightPoint = s.TR,
763
        //                                    Opacity = s.Opac,
764
        //                                    PointSet = s.PointSet,
765
        //                                    DashSize = s.DashSize
766
        //                                };
767
        //                                Layer.Children.Add(instance);
768
        //                                CopyDataSet.Add(instance);
769
        //                                instance.ApplyTemplate();
770
        //                                instance.SetRectPath();
771
        //                            }
772
        //                            break;
773
        //                        #endregion
774
        //                        #region Triangle
775
        //                        case "TriControl":
776
        //                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
777
        //                            {
778
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
779
        //                                TriControl instance = new TriControl
780
        //                                {
781
        //                                    LineSize = Convert.ToDouble(data2.First()),
782
        //                                    MidPoint = s.MP,
783
        //                                    Paint = s.Paint,
784
        //                                    StartPoint = s.StartPoint,
785
        //                                    EndPoint = s.EndPoint,
786
        //                                    Angle = s.Angle,
787
        //                                    DashSize = s.DashSize,
788
        //                                    PointSet = s.PointSet
789
        //                                };
790
        //                                Layer.Children.Add(instance);
791
        //                                CopyDataSet.Add(instance);
792
        //                                instance.ApplyTemplate();
793
        //                                instance.SetTri();
794
        //                            }
795
        //                            break;
796
        //                        #endregion
797
        //                        #region Cicle
798
        //                        case "CicleControl":
799
        //                            using (S_CicleControl s = JsonSerializerHelper.JsonDeserialize<S_CicleControl>(item))
800
        //                            {
801
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
802
        //                                CicleControl instance = new CicleControl
803
        //                                {
804
        //                                    LineSize = Convert.ToDouble(data2.First()),
805
        //                                    Paint = s.PaintState,
806
        //                                    StartPoint = s.StartPoint,
807
        //                                    EndPoint = s.EndPoint,
808
        //                                    LeftBottomPoint = s.LBP,
809
        //                                    TopRightPoint = s.TRP,
810
        //                                    Angle = s.Angle,
811
        //                                    DashSize = s.DashSize,
812
        //                                    PointSet = s.PointSet,
813
        //                                };
814
        //                                Layer.Children.Add(instance);
815
        //                                CopyDataSet.Add(instance);
816
        //                                instance.ApplyTemplate();
817
        //                                instance.SetCicle();
818
        //                            }
819
        //                            break;
820
        //                        #endregion
821
        //                        #region Cloud
822
        //                        case "CloudControl":
823
        //                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
824
        //                            {
825
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
826
        //                                CloudControl instance = new CloudControl
827
        //                                {
828
        //                                    LineSize = Convert.ToDouble(data2.First()),
829
        //                                    Toler = s.Toler,
830
        //                                    PointSet = new List<Point>(),
831
        //                                    ArcLength = s.ArcLength,
832
        //                                    DashSize = s.DashSize,
833
        //                                    Paint = s.PaintState,
834
        //                                    isChain = s.IsChain,
835
        //                                    isTransOn = s.IsTrans,
836
        //                                    //Fill = s.CloudFill,
837
        //                                };
838

    
839
        //                                Layer.Children.Add(instance);
840
        //                                CopyDataSet.Add(instance);
841
        //                                instance.ApplyTemplate();
842
        //                                instance.PointSet = s.pointSet;
843
        //                                instance.ClosePath();
844
        //                            }
845
        //                            break;
846
        //                        #endregion
847
        //                        #region Line
848
        //                        case "LineControl":
849
        //                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
850
        //                            {
851
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
852
        //                                LineControl instance = new LineControl()
853
        //                                {
854
        //                                    LineStyle = s.LnSet,
855
        //                                    StartPoint = s.StartPoint,
856
        //                                    EndPoint = s.EndPoint,
857
        //                                    DashSize = s.DashSize,
858
        //                                    Interval = s.Interval,
859
        //                                    PointSet = s.PointSet,
860
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
861
        //                                    LineSize = Convert.ToDouble(data2.First()),
862
        //                                };
863
        //                                Layer.Children.Add(instance);
864
        //                                CopyDataSet.Add(instance);
865
        //                                instance.ApplyTemplate();
866
        //                                instance.SetLinePath();
867
        //                            }
868
        //                            break;
869
        //                        #endregion
870
        //                        #region Text
871
        //                        case "TextControl":
872
        //                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
873
        //                            {
874
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
875
        //                                TextControl instance = new TextControl()
876
        //                                {
877
        //                                    Text = s.Text,
878
        //                                    StartPoint = s.StartPoint,
879
        //                                    EndPoint = s.EndPoint,
880
        //                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
881
        //                                    TextSize = Convert.ToDouble(data2[1]),
882
        //                                    FontColor = new SolidColorBrush(Colors.Red),
883
        //                                    FontSize = 10,
884
        //                                    Angle = s.Angle,
885
        //                                    PointSet = s.PointSet,
886
        //                                    Paint = s.PaintState,
887
        //                                    isHighLight = s.isHighLight,
888
        //                                    TextFamily = new FontFamily(s.fontConfig[0]),
889
        //                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
890
        //                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
891
        //                                };
892
        //                                if (instance.Text == "" || instance.Text == null)
893
        //                                {
894

    
895
        //                                }
896
        //                                else
897
        //                                {
898

    
899
        //                                    instance.SetText();
900
        //                                    CopyDataSet.Add(instance);
901
        //                                    Layer.Children.Add(instance);
902
        //                                    if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
903
        //                                    {
904
        //                                        s.fontConfig = new List<string>();
905

    
906
        //                                        s.fontConfig.Add("Arial");
907
        //                                        s.fontConfig.Add("Normal");
908
        //                                        s.fontConfig.Add("Normal");
909
        //                                        s.fontConfig.Add("30");
910
        //                                    }
911
        //                                    instance.TextFamily = new FontFamily(s.fontConfig[0]);
912
        //                                    instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
913
        //                                    instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
914

    
915
        //                                    //if (s.fontConfig.Count == 3)
916
        //                                    //{
917
        //                                    //    if (true)
918
        //                                    //    {
919

    
920
        //                                    //    }
921
        //                                    //    instance.TextSize = 30;
922
        //                                    //}
923
        //                                    //else
924
        //                                    //{
925
        //                                    //    instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
926
        //                                    //}
927
        //                                    instance.ApplyTemplate();
928
        //                                    instance.DrawingCloud();
929
        //                                    if (s.fontConfig.Count() == 4)
930
        //                                    {
931
        //                                        instance.UnderLine = TextDecorations.Underline;
932
        //                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
933
        //                                    }
934
        //                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
935
        //                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
936
        //                                }
937
        //                            }
938
        //                            break;
939
        //                        #endregion
940
        //                        #region Arc
941
        //                        case "ArcControl":
942
        //                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
943
        //                            {
944
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
945
        //                                ArcControl instance = new ArcControl()
946
        //                                {
947
        //                                    StartPoint = s.StartPoint,
948
        //                                    MidPoint = s.MP,
949
        //                                    EndPoint = s.EndPoint,
950
        //                                    isTransOn = s.IsTrans,
951
        //                                    DashSize = s.DashSize,
952
        //                                    PointSet = s.PointSet,
953
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
954
        //                                    LineSize = Convert.ToDouble(data2.First()),
955
        //                                };
956
        //                                Layer.Children.Add(instance);
957
        //                                CopyDataSet.Add(instance);
958
        //                                instance.ApplyTemplate();
959
        //                                instance.SetArcPath();
960
        //                            }
961
        //                            break;
962
        //                        #endregion
963
        //                        #region Sign
964
        //                        case "SignControl":
965
        //                            {
966
        //                                using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
967
        //                                {
968
        //                                    ImageSource img;
969

    
970

    
971
        //                                    SignControl instance_Sign = new SignControl
972
        //                                    {
973
        //                                        Angle = s.Angle,
974
        //                                        UserNumber = s.UserNumber,
975
        //                                        StartPoint = s.StartPoint,
976
        //                                        TopRightPoint = s.TR,
977
        //                                        EndPoint = s.EndPoint,
978
        //                                        LeftBottomPoint = s.LB,
979
        //                                        PointSet = s.PointSet,
980
        //                                    };
981

    
982

    
983
        //                                    try
984
        //                                    {
985
        //                                        this.SignSet.TryGetValue(s.UserNumber, out img);
986
        //                                        instance_Sign.SignImage = img;
987
        //                                    }
988
        //                                    catch (Exception)
989
        //                                    {
990
        //                                        SignUserSet.Add(instance_Sign);
991
        //                                        this.GetSignImageLoaded(SignUserSet);
992
        //                                    }
993
        //                                    Layer.Children.Add(instance_Sign);
994
        //                                    CopyDataSet.Add(instance_Sign);
995
        //                                    instance_Sign.ApplyTemplate();
996
        //                                    instance_Sign.SetImage();
997
        //                                }
998
        //                            }
999
        //                            break;
1000
        //                        #endregion
1001
        //                        #region Date
1002
        //                        case "DateControl":
1003
        //                            {
1004
        //                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
1005
        //                                {
1006
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1007
        //                                    DateControl instance = new DateControl
1008
        //                                    {
1009
        //                                        Angle = s.Angle,
1010
        //                                        StartPoint = s.StartPoint,
1011
        //                                        EndPoint = s.EndPoint,
1012
        //                                        LeftBottomPoint = s.LB,
1013
        //                                        TopRightPoint = s.TR,
1014
        //                                        Opacity = s.Opac,
1015
        //                                        FontColor = new SolidColorBrush(Colors.Red),
1016
        //                                        LineSize = Convert.ToDouble(data2.First()),
1017
        //                                        Text = s.Text,
1018
        //                                        PointSet = s.PointSet,
1019
        //                                    };
1020

    
1021
        //                                    Layer.Children.Add(instance);
1022
        //                                    CopyDataSet.Add(instance);
1023
        //                                    instance.ApplyTemplate();
1024
        //                                    instance.SetDate();
1025
        //                                }
1026
        //                            }
1027
        //                            break;
1028
        //                        #endregion
1029
        //                        #region Symbol
1030
        //                        case "SymControl":
1031
        //                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1032
        //                            {
1033

    
1034
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1035
        //                                StringToPathConverter sm = new StringToPathConverter();
1036
        //                                SymControl instance = new SymControl()
1037
        //                                {
1038
        //                                    LineSize = Convert.ToDouble(data2.First()),
1039
        //                                    PointSet = s.PointSet,
1040
        //                                    Paint = s.PaintState,
1041
        //                                    StartPoint = s.StartPoint,
1042
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
1043
        //                                    EndPoint = s.EndPoint,
1044
        //                                    Angle = s.Angle,
1045
        //                                    LeftBottomPoint = s.LB,
1046
        //                                    TopRightPoint = s.TR,
1047
        //                                    PathData = sm.Convert(s.PathInfo.ToString()),
1048
        //                                    Opacity = s.Opac,
1049
        //                                };
1050
        //                                Layer.Children.Add(instance);
1051
        //                                CopyDataSet.Add(instance);
1052
        //                                instance.ApplyTemplate();
1053
        //                                instance.SetSymPath();
1054
        //                            }
1055
        //                            break;
1056
        //                        #endregion
1057
        //                        #region Image
1058
        //                        case "ImgControl":
1059
        //                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
1060
        //                            {
1061
        //                                ImgControl instance = new ImgControl
1062
        //                                {
1063
        //                                    Angle = s.Angle,
1064
        //                                    StartPoint = s.StartPoint,
1065
        //                                    TopRightPoint = s.TR,
1066
        //                                    EndPoint = s.EndPoint,
1067
        //                                    LeftBottomPoint = s.LB,
1068
        //                                    PointSet = s.PointSet,
1069
        //                                    Opacity = s.Opac,
1070
        //                                    FilePath = s.ImagePath,
1071
        //                                };
1072
        //                                Layer.Children.Add(instance);
1073
        //                                instance.ApplyTemplate();
1074
        //                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
1075
        //                                CopyDataSet.Add(instance);
1076
        //                                instance.SetImage();
1077
        //                            }
1078
        //                            break;
1079
        //                        #endregion
1080
        //                        #region SymbolN
1081
        //                        case "SymControlN":
1082
        //                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
1083
        //                            {
1084
        //                                SymControlN instance = new SymControlN()
1085
        //                                {
1086
        //                                    PointSet = s.PointSet,
1087
        //                                    StartPoint = s.StartPoint,
1088
        //                                    EndPoint = s.EndPoint,
1089
        //                                    Angle = s.Angle,
1090
        //                                    LeftBottomPoint = s.LB,
1091
        //                                    TopRightPoint = s.TR,
1092
        //                                    Opacity = s.Opac,
1093
        //                                    //PathXathData = s.DBData,
1094
        //                                };
1095
        //                                if (instance.PointSet.Count == 4)
1096
        //                                {
1097
        //                                    Layer.Children.Add(instance);
1098
        //                                    CopyDataSet.Add(instance);
1099
        //                                    instance.ApplyTemplate();
1100
        //                                    instance.PathXathData = JsonSerializerHelper.UnCompressString_NonPrefix(s.DBData);
1101
        //                                    object obj = XamlReader.Load(JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData));
1102
        //                                    instance.Base_ViewBox.Child = obj as UIElement;
1103
        //                                    instance.SetViewBox();
1104
        //                                }
1105

    
1106

    
1107
        //                            }
1108
        //                            break;
1109
        //                        #endregion
1110
        //                        #region Ink
1111
        //                        case "InkPresenter":
1112
        //                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
1113
        //                            {
1114
        //                                this._InkBoard.Strokes = s.SCC;
1115
        //                            }
1116
        //                            break;
1117
        //        #endregion
1118
        //                        #region Poly
1119
        //                        case "PolyControl":
1120
        //                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
1121
        //                            {
1122
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1123
        //                                PolyControl instance = new PolyControl()
1124
        //                                {
1125
        //                                    //LineSize = Convert.ToDouble(data2.First()),
1126
        //                                    LineSize = LineSize,
1127
        //                                    PointSet = s.PointSet,
1128
        //                                    PointC = s.PointC,
1129
        //                                    StartPoint = s.StartPoint,
1130
        //                                    EndPoint = s.EndPoint,
1131
        //                                    Opacity = s.Opac,
1132
        //                                };
1133
        //                                Layer.Children.Add(instance);
1134
        //                                CopyDataSet.Add(instance);
1135
        //                                instance.ApplyTemplate();
1136
        //                                instance.SetPolyPath();
1137
        //                            };
1138
        //                            break;
1139
        //        #endregion
1140
        //                        default:
1141
        //                            break;
1142
        //                    };
1143

    
1144
        //                    foreach (var copyData in CopyDataSet)
1145
        //                    {
1146
        //                        Layer.Children.Remove(copyData);
1147
        //                    }
1148
        //                }
1149
        //            }
1150
        //        }
1151

    
1152
        //        /// <summary>
1153
        //        /// Undo Redo 전용
1154
        //        /// </summary>
1155
        //        /// <param name="MarkupString"></param>
1156
        //        /// <param name="Layer"></param>
1157
        //        /// <param name="ToolTipMessage"></param>
1158
        //        public void markupParseUndo(string MarkupString, Canvas Layer, string ToolTipMessage)
1159
        //        {
1160
        //            if (MarkupString != "False")
1161
        //            {
1162
        //                SignUserSet = new List<SignControl>();
1163
        //                CopyDataSet = new List<UIElement>();
1164
        //                string[] delimiterChars = { "|DZ|" };
1165
        //                string[] delimiterChars2 = { "|" };
1166
        //                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
1167
        //                //ServiceDeepViewClient client = new ServiceDeepViewClient(this._Basebinding, this._BaseEndPoint);
1168
        //                List<string> dataSet = new List<string>();
1169
        //                foreach (var dataPease in data)
1170
        //                {
1171
        //                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
1172
        //                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
1173
        //                    switch (unkownControl.Name)
1174
        //                    {
1175
        //                        #region Arrow
1176
        //                        case "ArrowControl":
1177
        //                            using (S_ArrowControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl>(item))
1178
        //                            {
1179
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1180
        //                                ArrowControl instance = new ArrowControl
1181
        //                                {
1182
        //                                    LineSize = Convert.ToDouble(data2.First()),
1183
        //                                    ArrowStyle = s.ArStyle,
1184
        //                                    StartPoint = s.StartPoint,
1185
        //                                    EndPoint = s.EndPoint,
1186
        //                                    DashSize = s.DashSize,
1187
        //                                    PointSet = s.PointSet,
1188
        //                                    DimSize = s.DimSize,
1189

    
1190
        //                                    StrokeColor = new SolidColorBrush(Colors.Red)
1191
        //                                };
1192
        //                                Layer.Children.Add(instance);
1193
        //                                instance.ApplyTemplate();
1194
        //                                instance.SetArrowPath();
1195
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1196

    
1197
        //                            }
1198
        //                            break;
1199
        //                        #endregion
1200
        //                        #region RectCloud
1201
        //                        case "RectCloudControl":
1202
        //                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
1203
        //                            {
1204
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1205
        //                                RectCloudControl instance = new RectCloudControl()
1206
        //                                {
1207
        //                                    StartPoint = s.StartPoint,
1208
        //                                    EndPoint = s.EndPoint,
1209
        //                                    LeftBottomPoint = s.LB,
1210
        //                                    Paint = s.PaintState,
1211
        //                                    Opacity = s.Opac,
1212
        //                                    TopRightPoint = s.TR,
1213
        //                                    PointSet = s.PointSet,
1214
        //                                    DashSize = s.DashSize,
1215
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
1216
        //                                    LineSize = Convert.ToDouble(data2.First()),
1217
        //                                };
1218
        //                                Layer.Children.Add(instance);
1219
        //                                instance.ApplyTemplate();
1220
        //                                instance.SetRectCloud();
1221
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1222
        //                            }
1223
        //                            break;
1224
        //                        #endregion
1225
        //                        #region ArrowText
1226
        //                        case "ArrowTextControl":
1227
        //                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
1228
        //                            {
1229
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1230
        //                                ArrowTextControl instance = new ArrowTextControl();
1231
        //                                Layer.Children.Add(instance);
1232
        //                                instance.LineSize = Convert.ToDouble(data2.First());
1233
        //                                instance.PointSet = s.PointSet;
1234
        //                                instance.StartPoint = s.StartPoint;
1235
        //                                instance.EndPoint = s.EndPoint;
1236
        //                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
1237
        //                                instance.DashSize = s.DashSize;
1238
        //                                instance.ArrowTextStyle = s.ArrowStyle;
1239
        //                                instance.ArrowText = s.ArrowText;
1240
        //                                instance.BorderSize = s.BorderSize;
1241
        //                                instance.BoxWidth = s.BoxWidth;
1242
        //                                instance.BoxHeight = s.BoxHeight;
1243
        //                                instance.isHighLight = s.isHighLight;
1244
        //                                instance.ApplyTemplate();
1245
        //                                instance.isFixed = s.isFixed;
1246
        //                                instance.SetArrowTextPath();
1247
        //                                instance.isTrans = s.isTrans;
1248
        //                                instance.Angle = s.Angle;
1249
        //                                instance.MidPoint = s.MP;
1250
        //                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
1251
        //                                {
1252
        //                                    s.fontConfig = new List<string>();
1253

    
1254
        //                                    s.fontConfig.Add("Arial");
1255
        //                                    s.fontConfig.Add("Normal");
1256
        //                                    s.fontConfig.Add("Normal");
1257
        //                                    s.fontConfig.Add("30");
1258
        //                                }
1259
        //                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
1260
        //                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
1261
        //                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
1262
        //                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
1263
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1264
        //                                instance.ApplyTemplate();
1265
        //                                instance.SetArrowTextPath();
1266
        //                            };
1267

    
1268
        //                            break;
1269
        //                        #endregion
1270
        //                        #region Arrow_Multi
1271
        //                        case "ArrowControl_Multi":
1272
        //                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
1273
        //                            {
1274
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1275
        //                                ArrowControl_Multi instance = new ArrowControl_Multi
1276
        //                                {
1277
        //                                    LineSize = Convert.ToDouble(data2.First()),
1278
        //                                    StartPoint = s.StartPoint,
1279
        //                                    MiddlePoint = s.MP,
1280
        //                                    DashSize = s.DashSize,
1281
        //                                    EndPoint = s.EndPoint,
1282
        //                                    PointSet = s.PointSet,
1283
        //                                    StrokeColor = new SolidColorBrush(Colors.Red)
1284
        //                                };
1285
        //                                Layer.Children.Add(instance);
1286
        //                                instance.ApplyTemplate();
1287
        //                                instance.SetArrowMultiPath();
1288
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1289

    
1290
        //                            }
1291
        //                            break;
1292
        //                        #endregion
1293
        //                        #region Rectangle
1294
        //                        case "RectagleControl":
1295
        //                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
1296
        //                            {
1297
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1298
        //                                RectagleControl instance = new RectagleControl
1299
        //                                {
1300
        //                                    LineSize = Convert.ToDouble(data2.First()),
1301
        //                                    Paint = s.PaintState,
1302
        //                                    StartPoint = s.StartPoint,
1303
        //                                    EndPoint = s.EndPoint,
1304
        //                                    Angle = s.Angle,
1305
        //                                    LeftBottomPoint = s.LB,
1306
        //                                    TopRightPoint = s.TR,
1307
        //                                    Opacity = s.Opac,
1308
        //                                    PointSet = s.PointSet,
1309
        //                                    DashSize = s.DashSize
1310
        //                                };
1311
        //                                Layer.Children.Add(instance);
1312
        //                                instance.ApplyTemplate();
1313
        //                                instance.SetRectPath();
1314
        //                            }
1315
        //                            break;
1316
        //                        #endregion
1317
        //                        #region Triangle
1318
        //                        case "TriControl":
1319
        //                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
1320
        //                            {
1321
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1322
        //                                TriControl instance = new TriControl
1323
        //                                {
1324
        //                                    LineSize = Convert.ToDouble(data2.First()),
1325
        //                                    MidPoint = s.MP,
1326
        //                                    Paint = s.Paint,
1327
        //                                    StartPoint = s.StartPoint,
1328
        //                                    EndPoint = s.EndPoint,
1329
        //                                    Angle = s.Angle,
1330
        //                                    DashSize = s.DashSize,
1331
        //                                    PointSet = s.PointSet
1332
        //                                };
1333
        //                                Layer.Children.Add(instance);
1334
        //                                instance.ApplyTemplate();
1335
        //                                instance.SetTri();
1336
        //                            }
1337
        //                            break;
1338
        //                        #endregion
1339
        //                        #region Cicle
1340
        //                        case "CicleControl":
1341
        //                            using (S_CicleControl s = JsonSerializerHelper.JsonDeserialize<S_CicleControl>(item))
1342
        //                            {
1343
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1344
        //                                CicleControl instance = new CicleControl
1345
        //                                {
1346
        //                                    LineSize = Convert.ToDouble(data2.First()),
1347
        //                                    Paint = s.PaintState,
1348
        //                                    StartPoint = s.StartPoint,
1349
        //                                    EndPoint = s.EndPoint,
1350
        //                                    LeftBottomPoint = s.LBP,
1351
        //                                    TopRightPoint = s.TRP,
1352
        //                                    Angle = s.Angle,
1353
        //                                    DashSize = s.DashSize,
1354
        //                                    PointSet = s.PointSet,
1355
        //                                };
1356
        //                                Layer.Children.Add(instance);
1357
        //                                instance.ApplyTemplate();
1358
        //                                instance.SetCicle();
1359
        //                            }
1360
        //                            break;
1361
        //                        #endregion
1362
        //                        #region Cloud
1363
        //                        case "CloudControl":
1364
        //                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
1365
        //                            {
1366
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1367
        //                                CloudControl instance = new CloudControl
1368
        //                                {
1369
        //                                    LineSize = Convert.ToDouble(data2.First()),
1370
        //                                    Toler = s.Toler,
1371
        //                                    PointSet = new List<Point>(),
1372
        //                                    ArcLength = s.ArcLength,
1373
        //                                    Paint = s.PaintState,
1374
        //                                    isTransOn = s.IsTrans,
1375
        //                                    DashSize = s.DashSize,
1376
        //                                    isChain = s.IsChain,
1377
        //                                    //Fill = s.CloudFill,
1378
        //                                };
1379

    
1380
        //                                Layer.Children.Add(instance);
1381
        //                                instance.ApplyTemplate();
1382
        //                                instance.PointSet = s.pointSet;
1383
        //                                instance.ClosePath();
1384
        //                                instance.SetCloud();
1385
        //                            }
1386
        //                            break;
1387
        //                        #endregion
1388
        //                        #region Line
1389
        //                        case "LineControl":
1390
        //                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
1391
        //                            {
1392
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1393
        //                                LineControl instance = new LineControl()
1394
        //                                {
1395
        //                                    LineStyle = s.LnSet,
1396
        //                                    StartPoint = s.StartPoint,
1397
        //                                    EndPoint = s.EndPoint,
1398
        //                                    DashSize = s.DashSize,
1399
        //                                    PointSet = s.PointSet,
1400
        //                                    Interval = s.Interval,
1401
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
1402
        //                                    LineSize = Convert.ToDouble(data2.First()),
1403
        //                                };
1404
        //                                Layer.Children.Add(instance);
1405
        //                                instance.ApplyTemplate();
1406
        //                                instance.SetLinePath();
1407
        //                            }
1408
        //                            break;
1409
        //                        #endregion
1410
        //                        #region Text
1411
        //                        case "TextControl":
1412
        //                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
1413
        //                            {
1414
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1415
        //                                TextControl instance = new TextControl()
1416
        //                                {
1417
        //                                    Text = s.Text,
1418
        //                                    StartPoint = s.StartPoint,
1419
        //                                    EndPoint = s.EndPoint,
1420
        //                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
1421
        //                                    TextSize = Convert.ToDouble(data2[1]),
1422
        //                                    FontColor = new SolidColorBrush(StringToColorConverter.Parse(s.FontColor)),
1423
        //                                    FontSize = 10,
1424
        //                                    Angle = s.Angle,
1425
        //                                    PointSet = s.PointSet,
1426
        //                                    Paint = s.PaintState,
1427
        //                                    isHighLight = s.isHighLight,
1428
        //                                    TextFamily = new FontFamily(s.fontConfig[0]),
1429
        //                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
1430
        //                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
1431
        //                                };
1432

    
1433
        //                                instance.SetText();
1434
        //                                Layer.Children.Add(instance);
1435
        //                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
1436
        //                                {
1437
        //                                    s.fontConfig = new List<string>();
1438

    
1439
        //                                    s.fontConfig.Add("Arial");
1440
        //                                    s.fontConfig.Add("Normal");
1441
        //                                    s.fontConfig.Add("Normal");
1442
        //                                    s.fontConfig.Add("30");
1443
        //                                }
1444
        //                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
1445
        //                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
1446
        //                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
1447

    
1448
        //                                //if (s.fontConfig.Count == 3)
1449
        //                                //{
1450
        //                                //    instance.TextSize = 30;
1451
        //                                //}
1452
        //                                //else
1453
        //                                //{
1454
        //                                //    instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
1455
        //                                //}
1456
        //                                instance.ApplyTemplate();
1457
        //                                instance.DrawingCloud();
1458
        //                                if (s.fontConfig.Count() == 4)
1459
        //                                {
1460
        //                                    instance.UnderLine = TextDecorations.Underline;
1461
        //                                    instance.Base_TextBlock.TextDecorations = instance.UnderLine;
1462
        //                                }
1463
        //                                instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
1464
        //                                instance.Base_TextBox.Visibility = Visibility.Collapsed;
1465
        //                            }
1466
        //                            break;
1467
        //                        #endregion
1468
        //                        #region Arc
1469
        //                        case "ArcControl":
1470
        //                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
1471
        //                            {
1472
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1473
        //                                ArcControl instance = new ArcControl()
1474
        //                                {
1475
        //                                    StartPoint = s.StartPoint,
1476
        //                                    MidPoint = s.MP,
1477
        //                                    EndPoint = s.EndPoint,
1478
        //                                    isTransOn = s.IsTrans,
1479
        //                                    DashSize = s.DashSize,
1480
        //                                    PointSet = s.PointSet,
1481
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
1482
        //                                    LineSize = Convert.ToDouble(data2.First()),
1483
        //                                };
1484
        //                                Layer.Children.Add(instance);
1485
        //                                instance.ApplyTemplate();
1486
        //                                instance.SetArcPath();
1487
        //                            }
1488
        //                            break;
1489
        //                        #endregion
1490
        //                        #region Sign
1491
        //                        case "SignControl":
1492
        //                            {
1493
        //                                using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
1494
        //                                {
1495
        //                                    ImageSource img;
1496

    
1497

    
1498
        //                                    SignControl instance_Sign = new SignControl
1499
        //                                    {
1500
        //                                        Angle = s.Angle,
1501
        //                                        UserNumber = s.UserNumber,
1502
        //                                        StartPoint = s.StartPoint,
1503
        //                                        TopRightPoint = s.TR,
1504
        //                                        EndPoint = s.EndPoint,
1505
        //                                        LeftBottomPoint = s.LB,
1506
        //                                        PointSet = s.PointSet,
1507
        //                                    };
1508

    
1509

    
1510
        //                                    try
1511
        //                                    {
1512
        //                                        this.SignSet.TryGetValue(s.UserNumber, out img);
1513
        //                                        instance_Sign.SignImage = img;
1514
        //                                    }
1515
        //                                    catch (Exception)
1516
        //                                    {
1517
        //                                        SignUserSet.Add(instance_Sign);
1518
        //                                        this.GetSignImageLoaded(SignUserSet);
1519
        //                                    }
1520
        //                                    Layer.Children.Add(instance_Sign);
1521
        //                                    instance_Sign.ApplyTemplate();
1522
        //                                    instance_Sign.SetImage();
1523
        //                                }
1524
        //                            }
1525
        //                            break;
1526
        //                        #endregion
1527
        //                        #region Date
1528
        //                        case "DateControl":
1529
        //                            {
1530
        //                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
1531
        //                                {
1532
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1533
        //                                    DateControl instance = new DateControl
1534
        //                                    {
1535
        //                                        Angle = s.Angle,
1536
        //                                        StartPoint = s.StartPoint,
1537
        //                                        EndPoint = s.EndPoint,
1538
        //                                        LeftBottomPoint = s.LB,
1539
        //                                        TopRightPoint = s.TR,
1540
        //                                        Opacity = s.Opac,
1541
        //                                        FontColor = new SolidColorBrush(Colors.Red),
1542
        //                                        LineSize = Convert.ToDouble(data2.First()),
1543
        //                                        Text = s.Text,
1544
        //                                        PointSet = s.PointSet,
1545
        //                                    };
1546

    
1547
        //                                    Layer.Children.Add(instance);
1548
        //                                    instance.ApplyTemplate();
1549
        //                                    instance.SetDate();
1550
        //                                }
1551
        //                            }
1552
        //                            break;
1553
        //                        #endregion
1554
        //                        #region Symbol
1555
        //                        case "SymControl":
1556
        //                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1557
        //                            {
1558

    
1559
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1560
        //                                StringToPathConverter sm = new StringToPathConverter();
1561
        //                                SymControl instance = new SymControl()
1562
        //                                {
1563
        //                                    LineSize = Convert.ToDouble(data2.First()),
1564
        //                                    PointSet = s.PointSet,
1565
        //                                    Paint = s.PaintState,
1566
        //                                    StartPoint = s.StartPoint,
1567
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
1568
        //                                    EndPoint = s.EndPoint,
1569
        //                                    Angle = s.Angle,
1570
        //                                    LeftBottomPoint = s.LB,
1571
        //                                    TopRightPoint = s.TR,
1572
        //                                    PathData = sm.Convert(s.PathInfo.ToString()),
1573
        //                                    Opacity = s.Opac,
1574
        //                                };
1575
        //                                Layer.Children.Add(instance);
1576
        //                                instance.ApplyTemplate();
1577
        //                                instance.SetSymPath();
1578
        //                            }
1579
        //                            break;
1580
        //                        #endregion
1581
        //                        #region Image
1582
        //                        case "ImgControl":
1583
        //                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
1584
        //                            {
1585
        //                                ImgControl instance = new ImgControl
1586
        //                                {
1587
        //                                    Angle = s.Angle,
1588
        //                                    StartPoint = s.StartPoint,
1589
        //                                    TopRightPoint = s.TR,
1590
        //                                    EndPoint = s.EndPoint,
1591
        //                                    LeftBottomPoint = s.LB,
1592
        //                                    PointSet = s.PointSet,
1593
        //                                    Opacity = s.Opac,
1594
        //                                    FilePath = s.ImagePath,
1595
        //                                };
1596
        //                                Layer.Children.Add(instance);
1597
        //                                instance.ApplyTemplate();
1598
        //                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
1599
        //                                instance.SetImage();
1600
        //                            }
1601
        //                            break;
1602
        //                        #endregion
1603
        //                        #region SymbolN
1604
        //                        case "SymControlN":
1605
        //                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
1606
        //                            {
1607
        //                                SymControlN instance = new SymControlN()
1608
        //                                {
1609
        //                                    PointSet = s.PointSet,
1610
        //                                    StartPoint = s.StartPoint,
1611
        //                                    EndPoint = s.EndPoint,
1612
        //                                    Angle = s.Angle,
1613
        //                                    LeftBottomPoint = s.LB,
1614
        //                                    TopRightPoint = s.TR,
1615
        //                                    Opacity = s.Opac,
1616
        //                                    //PathXathData = s.DBData,
1617
        //                                };
1618

    
1619
        //                                Layer.Children.Add(instance);
1620
        //                                instance.ApplyTemplate();
1621
        //                                instance.PathXathData = JsonSerializerHelper.UnCompressString_NonPrefix(s.DBData);
1622
        //                                object obj = XamlReader.Load(JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData));
1623
        //                                instance.Base_ViewBox.Child = obj as UIElement;
1624
        //                                instance.SetViewBox();
1625
        //                            }
1626
        //                            break;
1627
        //                        #endregion
1628
        //                        #region Ink
1629
        //                        case "InkPresenter":
1630
        //                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
1631
        //                            {
1632
        //                                this._InkBoard.Strokes = s.SCC;
1633
        //                            }
1634
        //                            break;
1635
        //                        #endregion
1636
        //                        #region Poly
1637
        //                        case "PolyControl":
1638
        //                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
1639
        //                            {
1640
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1641
        //                                PolyControl instance = new PolyControl()
1642
        //                                {
1643
        //                                    //LineSize = Convert.ToDouble(data2.First()),
1644
        //                                    LineSize = LineSize,
1645
        //                                    PointSet = s.PointSet,
1646
        //                                    PointC = s.PointC,
1647
        //                                    StartPoint = s.StartPoint,
1648
        //                                    EndPoint = s.EndPoint,
1649
        //                                    Opacity = s.Opac,
1650
        //                                };
1651
        //                                Layer.Children.Add(instance);
1652
        //                                instance.ApplyTemplate();
1653
        //                                instance.SetPolyPath();
1654
        //                            };
1655
        //                            break;
1656
        //                        #endregion
1657
        //                        default:
1658
        //                            break;
1659
        //                    };
1660

    
1661
        //                    foreach (var copyData in CopyDataSet)
1662
        //                    {
1663
        //                        Layer.Children.Remove(copyData);
1664
        //                    }
1665
        //                }
1666
        //            }
1667
        //        }
1668

    
1669

    
1670
        //        /// <summary>
1671
        //        /// 복사전용
1672
        //        /// </summary>
1673
        //        /// <param name="MarkupString"></param>
1674
        //        /// <param name="Layer"></param>
1675
        //        /// <param name="ToolTipMessage"></param>
1676
        //        public MarkupEditToolKit.Adorner.AdornerFinal markupParseToAdorner(string MarkupString, Canvas Layer, string ToolTipMessage)
1677
        //        {
1678
        //            MarkupEditToolKit.Adorner.AdornerFinal af = new Adorner.AdornerFinal();
1679
        //            {
1680
        //                if (MarkupString != "False")
1681
        //                {
1682
        //                    SignUserSet = new List<SignControl>();
1683
        //                    CopyDataSet = new List<UIElement>();
1684
        //                    string[] delimiterChars = { "|DZ|" };
1685
        //                    string[] delimiterChars2 = { "|" };
1686
        //                    string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
1687
        //                    //ServiceDeepViewClient client = new ServiceDeepViewClient(this._Basebinding, this._BaseEndPoint);
1688
        //                    List<string> dataSet = new List<string>();
1689
        //                    foreach (var dataPease in data)
1690
        //                    {
1691
        //                        var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
1692
        //                        var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
1693
        //                        switch (unkownControl.Name)
1694
        //                        {
1695
        //                            #region Arrow
1696
        //                            case "ArrowControl":
1697
        //                                using (S_ArrowControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl>(item))
1698
        //                                {
1699
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1700
        //                                    ArrowControl instance = new ArrowControl
1701
        //                                    {
1702
        //                                        LineSize = Convert.ToDouble(data2.First()),
1703
        //                                        ArrowStyle = s.ArStyle,
1704
        //                                        StartPoint = s.StartPoint,
1705
        //                                        DimSize = s.DimSize,
1706
        //                                        EndPoint = s.EndPoint,
1707
        //                                        DashSize = s.DashSize,
1708
        //                                        PointSet = s.PointSet,
1709

    
1710
        //                                        StrokeColor = new SolidColorBrush(Colors.Red)
1711
        //                                    };
1712
        //                                    Layer.Children.Add(instance);
1713
        //                                    CopyDataSet.Add(instance);
1714
        //                                    instance.ApplyTemplate();
1715
        //                                    instance.SetArrowPath();
1716
        //                                    instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1717

    
1718
        //                                }
1719
        //                                break;
1720
        //        #endregion
1721
        //                            #region RectCloud
1722
        //                            case "RectCloudControl":
1723
        //                                using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
1724
        //                                {
1725
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1726
        //                                    RectCloudControl instance = new RectCloudControl()
1727
        //                                    {
1728
        //                                        StartPoint = s.StartPoint,
1729
        //                                        EndPoint = s.EndPoint,
1730
        //                                        LeftBottomPoint = s.LB,
1731
        //                                        Paint = s.PaintState,
1732
        //                                        Opacity = s.Opac,
1733
        //                                        TopRightPoint = s.TR,
1734
        //                                        PointSet = s.PointSet,
1735
        //                                        DashSize = s.DashSize,
1736
        //                                        StrokeColor = new SolidColorBrush(Colors.Red),
1737
        //                                        LineSize = Convert.ToDouble(data2.First()),
1738
        //                                    };
1739
        //                                    Layer.Children.Add(instance);
1740
        //                                    instance.ApplyTemplate();
1741
        //                                    CopyDataSet.Add(instance);
1742
        //                                    instance.SetRectCloud();
1743
        //                                    instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1744
        //                                }
1745
        //                                break;
1746
        //        #endregion
1747
        //                            #region ArrowText
1748
        //                            case "ArrowTextControl":
1749
        //                                using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
1750
        //                                {
1751
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1752
        //                                    ArrowTextControl instance = new ArrowTextControl();
1753
        //                                    Layer.Children.Add(instance);
1754
        //                                    instance.LineSize = Convert.ToDouble(data2.First());
1755
        //                                    instance.PointSet = s.PointSet;
1756
        //                                    instance.StartPoint = s.StartPoint;
1757
        //                                    instance.EndPoint = s.EndPoint;
1758
        //                                    instance.StrokeColor = new SolidColorBrush(Colors.Red);
1759
        //                                    instance.DashSize = s.DashSize;
1760
        //                                    instance.ArrowTextStyle = s.ArrowStyle;
1761
        //                                    instance.ArrowText = s.ArrowText;
1762
        //                                    instance.BorderSize = s.BorderSize;
1763
        //                                    instance.isFixed = s.isFixed;
1764
        //                                    instance.BoxWidth = s.BoxWidth;
1765
        //                                    instance.BoxHeight = s.BoxHeight;
1766
        //                                    instance.isHighLight = s.isHighLight;
1767
        //                                    instance.ApplyTemplate();
1768
        //                                    instance.SetArrowTextPath();
1769
        //                                    instance.isTrans = s.isTrans;
1770
        //                                    instance.MidPoint = s.MP;
1771
        //                                    instance.Angle = s.Angle;
1772
        //                                    if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
1773
        //                                    {
1774
        //                                        s.fontConfig = new List<string>();
1775

    
1776
        //                                        s.fontConfig.Add("Arial");
1777
        //                                        s.fontConfig.Add("Normal");
1778
        //                                        s.fontConfig.Add("Normal");
1779
        //                                        s.fontConfig.Add("30");
1780
        //                                    }
1781
        //                                    instance.TextFamily = new FontFamily(s.fontConfig[0]);
1782
        //                                    instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
1783
        //                                    instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
1784
        //                                    instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
1785
        //                                    instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1786
        //                                    CopyDataSet.Add(instance);
1787
        //                                    instance.ApplyTemplate();
1788
        //                                    instance.SetArrowTextPath();
1789
        //                                };
1790

    
1791
        //                                break;
1792
        //        #endregion
1793
        //                            #region Arrow_Multi
1794
        //                            case "ArrowControl_Multi":
1795
        //                                using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
1796
        //                                {
1797
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1798
        //                                    ArrowControl_Multi instance = new ArrowControl_Multi
1799
        //                                    {
1800
        //                                        LineSize = Convert.ToDouble(data2.First()),
1801
        //                                        StartPoint = s.StartPoint,
1802
        //                                        MiddlePoint = s.MP,
1803
        //                                        DashSize = s.DashSize,
1804
        //                                        EndPoint = s.EndPoint,
1805
        //                                        PointSet = s.PointSet,
1806
        //                                        StrokeColor = new SolidColorBrush(Colors.Red)
1807
        //                                    };
1808
        //                                    Layer.Children.Add(instance);
1809
        //                                    CopyDataSet.Add(instance);
1810
        //                                    instance.ApplyTemplate();
1811
        //                                    instance.SetArrowMultiPath();
1812
        //                                    instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1813

    
1814
        //                                }
1815
        //                                break;
1816
        //        #endregion
1817
        //                            #region Rectangle
1818
        //                            case "RectagleControl":
1819
        //                                using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
1820
        //                                {
1821
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1822
        //                                    RectagleControl instance = new RectagleControl
1823
        //                                    {
1824
        //                                        LineSize = Convert.ToDouble(data2.First()),
1825
        //                                        Paint = s.PaintState,
1826
        //                                        StartPoint = s.StartPoint,
1827
        //                                        EndPoint = s.EndPoint,
1828
        //                                        Angle = s.Angle,
1829
        //                                        LeftBottomPoint = s.LB,
1830
        //                                        TopRightPoint = s.TR,
1831
        //                                        Opacity = s.Opac,
1832
        //                                        PointSet = s.PointSet,
1833
        //                                        DashSize = s.DashSize
1834
        //                                    };
1835
        //                                    Layer.Children.Add(instance);
1836
        //                                    CopyDataSet.Add(instance);
1837
        //                                    instance.ApplyTemplate();
1838
        //                                    instance.SetRectPath();
1839
        //                                }
1840
        //                                break;
1841
        //        #endregion
1842
        //                            #region Triangle
1843
        //                            case "TriControl":
1844
        //                                using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
1845
        //                                {
1846
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1847
        //                                    TriControl instance = new TriControl
1848
        //                                    {
1849
        //                                        LineSize = Convert.ToDouble(data2.First()),
1850
        //                                        MidPoint = s.MP,
1851
        //                                        Paint = s.Paint,
1852
        //                                        StartPoint = s.StartPoint,
1853
        //                                        EndPoint = s.EndPoint,
1854
        //                                        Angle = s.Angle,
1855
        //                                        DashSize = s.DashSize,
1856
        //                                        PointSet = s.PointSet
1857
        //                                    };
1858
        //                                    Layer.Children.Add(instance);
1859
        //                                    CopyDataSet.Add(instance);
1860
        //                                    instance.ApplyTemplate();
1861
        //                                    instance.SetTri();
1862
        //                                }
1863
        //                                break;
1864
        //        #endregion
1865
        //                            #region Cicle
1866
        //                            case "CicleControl":
1867
        //                                using (S_CicleControl s = JsonSerializerHelper.JsonDeserialize<S_CicleControl>(item))
1868
        //                                {
1869
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1870
        //                                    CicleControl instance = new CicleControl
1871
        //                                    {
1872
        //                                        LineSize = Convert.ToDouble(data2.First()),
1873
        //                                        Paint = s.PaintState,
1874
        //                                        StartPoint = s.StartPoint,
1875
        //                                        EndPoint = s.EndPoint,
1876
        //                                        LeftBottomPoint = s.LBP,
1877
        //                                        TopRightPoint = s.TRP,
1878
        //                                        Angle = s.Angle,
1879
        //                                        DashSize = s.DashSize,
1880
        //                                        PointSet = s.PointSet,
1881
        //                                    };
1882
        //                                    Layer.Children.Add(instance);
1883
        //                                    CopyDataSet.Add(instance);
1884
        //                                    instance.ApplyTemplate();
1885
        //                                    instance.SetCicle();
1886
        //                                }
1887
        //                                break;
1888
        //        #endregion
1889
        //                            #region Cloud
1890
        //                            case "CloudControl":
1891
        //                                using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
1892
        //                                {
1893
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1894
        //                                    CloudControl instance = new CloudControl
1895
        //                                    {
1896
        //                                        LineSize = Convert.ToDouble(data2.First()),
1897
        //                                        Toler = s.Toler,
1898
        //                                        PointSet = new List<Point>(),
1899
        //                                        ArcLength = s.ArcLength,
1900
        //                                        Paint = s.PaintState,
1901
        //                                        isTransOn = s.IsTrans,
1902
        //                                        DashSize = s.DashSize,
1903
        //                                        isChain = s.IsChain,
1904
        //                                        //Fill = s.CloudFill,
1905
        //                                    };
1906

    
1907
        //                                    Layer.Children.Add(instance);
1908
        //                                    CopyDataSet.Add(instance);
1909
        //                                    instance.ApplyTemplate();
1910
        //                                    instance.PointSet = s.pointSet;
1911
        //                                    instance.ClosePath();
1912
        //                                }
1913
        //                                break;
1914
        //        #endregion
1915
        //                            #region Line
1916
        //                            case "LineControl":
1917
        //                                using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
1918
        //                                {
1919
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1920
        //                                    LineControl instance = new LineControl()
1921
        //                                    {
1922
        //                                        LineStyle = s.LnSet,
1923
        //                                        StartPoint = s.StartPoint,
1924
        //                                        EndPoint = s.EndPoint,
1925
        //                                        DashSize = s.DashSize,
1926
        //                                        Interval = s.Interval,
1927
        //                                        PointSet = s.PointSet,
1928
        //                                        StrokeColor = new SolidColorBrush(Colors.Red),
1929
        //                                        LineSize = Convert.ToDouble(data2.First()),
1930
        //                                    };
1931
        //                                    Layer.Children.Add(instance);
1932
        //                                    CopyDataSet.Add(instance);
1933
        //                                    instance.ApplyTemplate();
1934
        //                                    instance.SetLinePath();
1935
        //                                }
1936
        //                                break;
1937
        //        #endregion
1938
        //                            #region SymbolN
1939
        //                            case "SymControlN":
1940
        //                                using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
1941
        //                                {
1942
        //                                    SymControlN instance = new SymControlN()
1943
        //                                    {
1944
        //                                        PointSet = s.PointSet,
1945
        //                                        StartPoint = s.StartPoint,
1946
        //                                        EndPoint = s.EndPoint,
1947
        //                                        Angle = s.Angle,
1948
        //                                        LeftBottomPoint = s.LB,
1949
        //                                        TopRightPoint = s.TR,
1950
        //                                        Opacity = s.Opac,
1951
        //                                        //PathXathData = s.DBData,
1952
        //                                    };
1953
        //                                    Layer.Children.Add(instance);
1954
        //                                    CopyDataSet.Add(instance);
1955
        //                                    instance.ApplyTemplate();
1956
        //                                    instance.PathXathData = JsonSerializerHelper.UnCompressString_NonPrefix(s.DBData);
1957
        //                                    object obj = XamlReader.Load(instance.PathXathData);
1958
        //                                    instance.Base_ViewBox.Child = obj as UIElement;
1959
        //                                    instance.SetViewBox();
1960
        //                                }
1961
        //                                break;
1962
        //        #endregion
1963
        //                            #region Text
1964
        //                            case "TextControl":
1965
        //                                using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
1966
        //                                {
1967
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1968
        //                                    TextControl instance = new TextControl()
1969
        //                                    {
1970
        //                                        Text = s.Text,
1971
        //                                        StartPoint = s.StartPoint,
1972
        //                                        EndPoint = s.EndPoint,
1973
        //                                        LineSize = new Thickness(Convert.ToDouble(data2.First())),
1974
        //                                        TextSize = Convert.ToDouble(data2[1]),
1975
        //                                        FontColor = new SolidColorBrush(StringToColorConverter.Parse(s.FontColor)),
1976
        //                                        FontSize = 10,
1977
        //                                        Angle = s.Angle,
1978
        //                                        Paint = s.PaintState,
1979
        //                                        PointSet = s.PointSet,
1980
        //                                        isHighLight = s.isHighLight,
1981
        //                                        TextFamily = new FontFamily(s.fontConfig[0]),
1982
        //                                        TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
1983
        //                                        TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
1984
        //                                    };
1985

    
1986
        //                                    instance.SetText();
1987
        //                                    CopyDataSet.Add(instance);
1988
        //                                    Layer.Children.Add(instance);
1989
        //                                    if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
1990
        //                                    {
1991
        //                                        s.fontConfig = new List<string>();
1992

    
1993
        //                                        s.fontConfig.Add("Arial");
1994
        //                                        s.fontConfig.Add("Normal");
1995
        //                                        s.fontConfig.Add("Normal");
1996
        //                                        s.fontConfig.Add("30");
1997
        //                                    }
1998
        //                                    instance.TextFamily = new FontFamily(s.fontConfig[0]);
1999
        //                                    instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
2000
        //                                    instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
2001

    
2002
        //                                    if (s.fontConfig.Count == 3)
2003
        //                                    {
2004
        //                                        instance.TextSize = 30;
2005
        //                                    }
2006
        //                                    else
2007
        //                                    {
2008
        //                                        instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
2009
        //                                    }
2010
        //                                    instance.ApplyTemplate();
2011
        //                                    if (s.fontConfig.Count() == 4)
2012
        //                                    {
2013
        //                                        instance.UnderLine = TextDecorations.Underline;
2014
        //                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
2015
        //                                    }
2016
        //                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
2017
        //                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
2018
        //                                }
2019
        //                                break;
2020
        //        #endregion
2021
        //                            #region Arc
2022
        //                            case "ArcControl":
2023
        //                                using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
2024
        //                                {
2025
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2026
        //                                    ArcControl instance = new ArcControl()
2027
        //                                    {
2028
        //                                        StartPoint = s.StartPoint,
2029
        //                                        MidPoint = s.MP,
2030
        //                                        EndPoint = s.EndPoint,
2031
        //                                        DashSize = s.DashSize,
2032
        //                                        isTransOn = s.IsTrans,
2033
        //                                        PointSet = s.PointSet,
2034
        //                                        StrokeColor = new SolidColorBrush(Colors.Red),
2035
        //                                        LineSize = Convert.ToDouble(data2.First()),
2036
        //                                    };
2037
        //                                    Layer.Children.Add(instance);
2038
        //                                    CopyDataSet.Add(instance);
2039
        //                                    instance.ApplyTemplate();
2040
        //                                    instance.SetArcPath();
2041
        //                                }
2042
        //                                break;
2043
        //        #endregion
2044
        //                            #region Sign
2045
        //                            case "SignControl":
2046
        //                                {
2047
        //                                    using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
2048
        //                                    {
2049
        //                                        ImageSource img;
2050

    
2051

    
2052
        //                                        SignControl instance_Sign = new SignControl
2053
        //                                        {
2054
        //                                            Angle = s.Angle,
2055
        //                                            UserNumber = s.UserNumber,
2056
        //                                            StartPoint = s.StartPoint,
2057
        //                                            TopRightPoint = s.TR,
2058
        //                                            EndPoint = s.EndPoint,
2059
        //                                            LeftBottomPoint = s.LB,
2060
        //                                            PointSet = s.PointSet,
2061
        //                                        };
2062

    
2063

    
2064
        //                                        try
2065
        //                                        {
2066
        //                                            this.SignSet.TryGetValue(s.UserNumber, out img);
2067
        //                                            instance_Sign.SignImage = img;
2068
        //                                        }
2069
        //                                        catch (Exception)
2070
        //                                        {
2071
        //                                            SignUserSet.Add(instance_Sign);
2072
        //                                            this.GetSignImageLoaded(SignUserSet);
2073
        //                                        }
2074
        //                                        Layer.Children.Add(instance_Sign);
2075
        //                                        CopyDataSet.Add(instance_Sign);
2076
        //                                        instance_Sign.ApplyTemplate();
2077
        //                                        instance_Sign.SetImage();
2078
        //                                    }
2079
        //                                }
2080
        //                                break;
2081
        //        #endregion
2082
        //                            #region Date
2083
        //                            case "DateControl":
2084
        //                                {
2085
        //                                    using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
2086
        //                                    {
2087
        //                                        string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2088
        //                                        DateControl instance = new DateControl
2089
        //                                        {
2090
        //                                            Angle = s.Angle,
2091
        //                                            StartPoint = s.StartPoint,
2092
        //                                            EndPoint = s.EndPoint,
2093
        //                                            LeftBottomPoint = s.LB,
2094
        //                                            TopRightPoint = s.TR,
2095
        //                                            Opacity = s.Opac,
2096
        //                                            FontColor = new SolidColorBrush(Colors.Red),
2097
        //                                            LineSize = Convert.ToDouble(data2.First()),
2098
        //                                            Text = s.Text,
2099
        //                                            PointSet = s.PointSet,
2100
        //                                        };
2101

    
2102
        //                                        Layer.Children.Add(instance);
2103
        //                                        CopyDataSet.Add(instance);
2104
        //                                        instance.ApplyTemplate();
2105
        //                                        instance.SetDate();
2106
        //                                    }
2107
        //                                }
2108
        //                                break;
2109
        //        #endregion
2110
        //                            #region Symbol
2111
        //                            case "SymControl":
2112
        //                                using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
2113
        //                                {
2114

    
2115
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2116
        //                                    StringToPathConverter sm = new StringToPathConverter();
2117
        //                                    SymControl instance = new SymControl()
2118
        //                                    {
2119
        //                                        LineSize = Convert.ToDouble(data2.First()),
2120
        //                                        PointSet = s.PointSet,
2121
        //                                        Paint = s.PaintState,
2122
        //                                        StartPoint = s.StartPoint,
2123
        //                                        StrokeColor = new SolidColorBrush(Colors.Red),
2124
        //                                        EndPoint = s.EndPoint,
2125
        //                                        Angle = s.Angle,
2126
        //                                        LeftBottomPoint = s.LB,
2127
        //                                        TopRightPoint = s.TR,
2128
        //                                        PathData = sm.Convert(s.PathInfo.ToString()),
2129
        //                                        Opacity = s.Opac,
2130
        //                                    };
2131
        //                                    Layer.Children.Add(instance);
2132
        //                                    CopyDataSet.Add(instance);
2133
        //                                    instance.ApplyTemplate();
2134
        //                                    instance.SetSymPath();
2135
        //                                }
2136
        //                                break;
2137
        //        #endregion
2138
        //                            #region Ink
2139
        //                            case "InkPresenter":
2140
        //                                using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
2141
        //                                {
2142
        //                                    this._InkBoard.Strokes = s.SCC;
2143
        //                                }
2144
        //                                break;
2145
        //        #endregion
2146
        //                            #region Poly
2147
        //                            case "PolyControl":
2148
        //                                using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
2149
        //                                {
2150
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2151
        //                                    PolyControl instance = new PolyControl()
2152
        //                                    {
2153
        //                                        //LineSize = Convert.ToDouble(data2.First()),
2154
        //                                        LineSize = LineSize,
2155
        //                                        PointSet = s.PointSet,
2156
        //                                        PointC = s.PointC,
2157
        //                                        StartPoint = s.StartPoint,
2158
        //                                        EndPoint = s.EndPoint,
2159
        //                                        Opacity = s.Opac,
2160
        //                                    };
2161
        //                                    Layer.Children.Add(instance);
2162
        //                                    CopyDataSet.Add(instance);
2163
        //                                    instance.ApplyTemplate();
2164
        //                                    instance.SetPolyPath();
2165
        //                                };
2166
        //                                break;
2167
        //        #endregion
2168
        //                            #region Image
2169
        //                            case "ImgControl":
2170
        //                                using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
2171
        //                                {
2172
        //                                    ImgControl instance = new ImgControl
2173
        //                                    {
2174
        //                                        Angle = s.Angle,
2175
        //                                        StartPoint = s.StartPoint,
2176
        //                                        TopRightPoint = s.TR,
2177
        //                                        EndPoint = s.EndPoint,
2178
        //                                        LeftBottomPoint = s.LB,
2179
        //                                        PointSet = s.PointSet,
2180
        //                                        Opacity = s.Opac,
2181
        //                                        FilePath = s.ImagePath,
2182
        //                                    };
2183
        //                                    Layer.Children.Add(instance);
2184
        //                                    instance.ApplyTemplate();
2185
        //                                    instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
2186
        //                                    CopyDataSet.Add(instance);
2187
        //                                    instance.SetImage();
2188
        //                                }
2189
        //                                break;
2190
        //        #endregion
2191

    
2192
        //                            default:
2193
        //                                break;
2194
        //                        };
2195
        //                    }
2196
        //                }
2197

    
2198

    
2199
        //                foreach (var item in CopyDataSet)
2200
        //                {
2201
        //                    Layer.Children.Remove(item);
2202
        //                    af.addMemberControl(item);
2203
        //                }
2204
        //            }
2205
        //            return af;
2206
        //        } 
2207

    
2208
        //        public SolidColorBrush GetUserColor_KCOM(List<CommonLib.DisplayColorInfo> dc, string UserID)
2209
        //        {
2210
        //            var item = dc.Where(p => p.UserID == UserID).FirstOrDefault();
2211
        //            if (item != null)
2212
        //            {
2213
        //                return new SolidColorBrush(StringToColorConverter.Parse(item.DisplayColor));
2214
        //            }
2215
        //            else
2216
        //            {
2217
        //                return new SolidColorBrush(Colors.Red);
2218
        //            }
2219

    
2220
        //        }
2221

    
2222
        //        /// <summary>
2223
        //        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
2224
        //        /// </summary>
2225
        //        /// <param name="MarkupString"></param>
2226
        //        public void markupParsePrint(string MarkupString, Canvas Layer, string DisplayColor,List<CommonLib.DisplayColorInfo> dc,string ToolTipMessage)
2227
        //        {
2228
        //            if (MarkupString != "False")
2229
        //            {
2230

    
2231
        //                SolidColorBrush _SetColor = new SolidColorBrush(StringToColorConverter.Parse(DisplayColor));
2232
        //                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
2233
        //                string[] delimiterChars = { "|DZ|" };
2234
        //                string[] delimiterChars2 = { "|" };
2235
        //                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
2236
        //                List<string> dataSet = new List<string>();
2237

    
2238
        //                foreach (var dataPease in data)
2239
        //                {
2240
        //                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
2241
        //                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
2242
        //                    switch (unkownControl.Name)
2243
        //                    {
2244
        //                        #region Arrow
2245
        //                        case "ArrowControl":
2246
        //                            using (S_ArrowControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl>(item))
2247
        //                            {
2248
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2249
        //                                ArrowControl instance = new ArrowControl
2250
        //                                {
2251
        //                                    LineSize = Convert.ToDouble(data2.First()),
2252
        //                                    ArrowStyle = s.ArStyle,
2253
        //                                    DimSize = s.DimSize,
2254
        //                                    StartPoint = s.StartPoint,
2255
        //                                    EndPoint = s.EndPoint,
2256
        //                                    DashSize = s.DashSize,
2257
        //                                    UserID = s.UserID,
2258
        //                                    PointSet = s.PointSet,
2259
        //                                    //StrokeColor = _SetColor,
2260
        //                                    StrokeColor = GetUserColor_KCOM(dc, s.UserID),
2261
        //                                    Opacity = s.Opac,
2262
        //                                };
2263
        //#if SILVERLIGHT
2264
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2265
        //#endif
2266

    
2267
        //                                Layer.Children.Add(instance);
2268
        //                                instance.ApplyTemplate();
2269
        //                                instance.SetArrowPath();
2270
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
2271

    
2272
        //                            }
2273
        //                            break;
2274
        //                        #endregion
2275
        //                        #region ArrowText
2276
        //                        case "ArrowTextControl":
2277
        //                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
2278
        //                            {
2279
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2280
        //                                ArrowTextControl instance = new ArrowTextControl();
2281
        //                                Layer.Children.Add(instance);
2282
        //                                instance.LineSize = Convert.ToDouble(data2.First());
2283
        //                                instance.PointSet = s.PointSet;
2284
        //                                instance.StartPoint = s.StartPoint;
2285
        //                                instance.EndPoint = s.EndPoint;
2286
        //                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
2287
        //                                instance.DashSize = s.DashSize;
2288
        //                                instance.ArrowTextStyle = s.ArrowStyle;
2289
        //                                instance.isHighLight = s.isHighLight;
2290
        //                                instance.ArrowText = s.ArrowText;
2291
        //                                instance.Opacity = s.Opac;
2292
        //                                instance.BorderSize = s.BorderSize;
2293
        //                                instance.BoxWidth = s.BoxWidth;
2294
        //                                instance.BoxHeight = s.BoxHeight;
2295
        //                                instance.isFixed = s.isFixed;
2296
        //                                instance.Angle = s.Angle;
2297
        //                                instance.StrokeColor = _SetColor;
2298
        //                                instance.isTrans = s.isTrans;
2299
        //                                instance.UserID = s.UserID;
2300
        //                                instance.MidPoint = s.MP;
2301
        //                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
2302
        //                                {
2303
        //                                    s.fontConfig = new List<string>();
2304

    
2305
        //                                    s.fontConfig.Add("Arial");
2306
        //                                    s.fontConfig.Add("Normal");
2307
        //                                    s.fontConfig.Add("Normal");
2308
        //                                    s.fontConfig.Add("30");
2309
        //                                }
2310
        //                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
2311
        //                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
2312
        //                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
2313
        //                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
2314
        //                                instance.ApplyTemplate();
2315
        //                                instance.SetArrowTextPath();
2316
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
2317
        //                            };
2318
        //                            break;
2319
        //                        #endregion
2320
        //                        #region Arrow_Multi
2321
        //                        case "ArrowControl_Multi":
2322
        //                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
2323
        //                            {
2324
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2325
        //                                ArrowControl_Multi instance = new ArrowControl_Multi
2326
        //                                {
2327
        //                                    LineSize = Convert.ToDouble(data2.First()),
2328
        //                                    StartPoint = s.StartPoint,
2329
        //                                    MiddlePoint = s.MP,
2330
        //                                    DashSize = s.DashSize,
2331
        //                                    EndPoint = s.EndPoint,
2332
        //                                    UserID = s.UserID,
2333
        //                                    PointSet = s.PointSet,
2334
        //                                    Opacity = s.Opac,
2335
        //                                    StrokeColor = GetUserColor_KCOM(dc, s.UserID),
2336
        //                                };
2337
        //#if SILVERLIGHT
2338
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2339
        //#endif
2340
        //                                Layer.Children.Add(instance);
2341
        //                                instance.ApplyTemplate();
2342
        //                                instance.SetArrowMultiPath();
2343
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
2344

    
2345
        //                            }
2346
        //                            break;
2347
        //                        #endregion
2348
        //                        #region Rectangle
2349
        //                        case "RectagleControl":
2350
        //                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
2351
        //                            {
2352
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2353
        //                                RectagleControl instance = new RectagleControl
2354
        //                                {
2355
        //                                    LineSize = Convert.ToDouble(data2.First()),
2356
        //                                    Paint = s.PaintState,
2357
        //                                    StartPoint = s.StartPoint,
2358
        //                                    EndPoint = s.EndPoint,
2359
        //                                    Angle = s.Angle,
2360
        //                                    UserID = s.UserID,
2361
        //                                    StrokeColor = _SetColor,
2362
        //                                    DashSize = s.DashSize,
2363
        //                                    Opacity = s.Opac,
2364
        //                                    LeftBottomPoint = s.LB,
2365
        //                                    TopRightPoint = s.TR,
2366
        //                                    PointSet = s.PointSet
2367
        //                                };
2368
        //                                if (ToolTipService.GetToolTip(instance) == null)
2369
        //                                {
2370
        //#if SILVERLIGHT
2371
        //                                    ToolTipService.SetToolTip(instance, UserNumber);
2372
        //#endif
2373
        //                                }
2374

    
2375
        //                                Layer.Children.Add(instance);
2376
        //                                instance.ApplyTemplate();
2377
        //                                instance.SetRectPath();
2378
        //                            }
2379
        //                            break;
2380
        //                        #endregion
2381
        //                        #region Triangle
2382
        //                        case "TriControl":
2383
        //                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
2384
        //                            {
2385
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2386
        //                                TriControl instance = new TriControl
2387
        //                                {
2388
        //                                    LineSize = Convert.ToDouble(data2.First()),
2389
        //                                    MidPoint = s.MP,
2390
        //                                    StartPoint = s.StartPoint,
2391
        //                                    Paint = s.Paint,
2392
        //                                    EndPoint = s.EndPoint,
2393
        //                                    Opacity = s.Opac,
2394
        //                                    UserID = s.UserID,
2395
        //                                    Angle = s.Angle,
2396
        //                                    DashSize = s.DashSize,
2397
        //                                    PointSet = s.PointSet,
2398
        //                                    StrokeColor = _SetColor,
2399
        //                                };
2400
        //#if SILVERLIGHT
2401
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2402
        //#endif
2403
        //                                Layer.Children.Add(instance);
2404
        //                                instance.ApplyTemplate();
2405
        //                                instance.SetTri();
2406
        //                            }
2407
        //                            break;
2408
        //                        #endregion
2409
        //                        #region Cicle
2410
        //                        case "CicleControl":
2411
        //                            using (S_CicleControl s = JsonSerializerHelper.JsonDeserialize<S_CicleControl>(item))
2412
        //                            {
2413
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2414
        //                                CicleControl instance = new CicleControl
2415
        //                                {
2416
        //                                    LineSize = Convert.ToDouble(data2.First()),
2417
        //                                    Paint = s.PaintState,
2418
        //                                    StartPoint = s.StartPoint,
2419
        //                                    EndPoint = s.EndPoint,
2420
        //                                    LeftBottomPoint = s.LBP,
2421
        //                                    TopRightPoint = s.TRP,
2422
        //                                    UserID = s.UserID,
2423
        //                                    Opacity = s.Opac,
2424
        //                                    Angle = s.Angle,
2425
        //                                    DashSize = s.DashSize,
2426
        //                                    PointSet = s.PointSet,
2427
        //                                    StrokeColor = _SetColor,
2428
        //                                };
2429
        //#if SILVERLIGHT
2430
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2431
        //#endif
2432
        //                                Layer.Children.Add(instance);
2433
        //                                instance.ApplyTemplate();
2434
        //                                instance.SetCicle();
2435
        //                            }
2436
        //                            break;
2437
        //                        #endregion
2438
        //                        #region Cloud
2439
        //                        case "CloudControl":
2440
        //                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
2441
        //                            {
2442
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2443
        //                                CloudControl instance = new CloudControl
2444
        //                                {
2445
        //                                    LineSize = Convert.ToDouble(data2.First()),
2446
        //                                    Toler = s.Toler,
2447
        //                                    PointSet = new List<Point>(),
2448
        //                                    ArcLength = s.ArcLength,
2449
        //                                    Paint = s.PaintState,
2450
        //                                    Opacity = s.Opac,
2451
        //                                    UserID = s.UserID,
2452
        //                                    StrokeColor = _SetColor,
2453
        //                                    isTransOn = s.IsTrans,
2454
        //                                    isChain = s.IsChain,
2455
        //                                    DashSize = s.DashSize,
2456
        //                                    //Fill = s.CloudFill,
2457
        //                                };
2458
        //#if SILVERLIGHT
2459
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2460
        //#endif
2461
        //                                Layer.Children.Add(instance);
2462
        //                                instance.ApplyTemplate();
2463
        //                                instance.PointSet = s.pointSet;
2464
        //                                instance.ClosePath();
2465
        //                                instance.ChangePaint(s.PaintState);
2466
        //                            }
2467
        //                            break;
2468
        //                        #endregion
2469
        //                        #region Line
2470
        //                        case "LineControl":
2471
        //                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
2472
        //                            {
2473
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2474
        //                                LineControl instance = new LineControl()
2475
        //                                {
2476
        //                                    LineStyle = s.LnSet,
2477
        //                                    StartPoint = s.StartPoint,
2478
        //                                    EndPoint = s.EndPoint,
2479
        //                                    DashSize = s.DashSize,
2480
        //                                    Interval = s.Interval,
2481
        //                                    PointSet = s.PointSet,
2482
        //                                    Opacity = s.Opac,
2483
        //                                    UserID = s.UserID,
2484
        //                                    StrokeColor = GetUserColor_KCOM(dc, s.UserID),
2485
        //                                    LineSize = Convert.ToDouble(data2.First()),
2486
        //                                };
2487
        //#if SILVERLIGHT
2488
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2489
        //#endif
2490
        //                                Layer.Children.Add(instance);
2491
        //                                instance.ApplyTemplate();
2492
        //                                instance.SetLinePath();
2493
        //                            }
2494
        //                            break;
2495
        //                        #endregion
2496
        //                        #region Text
2497
        //                        case "TextControl":
2498
        //                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
2499
        //                            {
2500
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2501
        //                                TextControl instance = new TextControl()
2502
        //                                {
2503
        //                                    Text = s.Text,
2504
        //                                    StartPoint = s.StartPoint,
2505
        //                                    EndPoint = s.EndPoint,
2506
        //                                    Paint = s.PaintState,
2507
        //                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
2508
        //                                    TextSize = Convert.ToDouble(data2[1]),
2509
        //                                    FontColor = _SetColor,
2510
        //                                    FontSize = 10,
2511
        //                                    UserID = s.UserID,
2512
        //                                    isHighLight = s.isHighLight,
2513
        //                                    Angle = s.Angle,
2514
        //                                    PointSet = s.PointSet,
2515
        //                                    Opacity = s.Opac,
2516
        //                                    TextFamily = new FontFamily(s.fontConfig[0]),
2517
        //                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
2518
        //                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
2519
        //                                };
2520
        //#if SILVERLIGHT
2521
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2522
        //#endif
2523
        //                                if (instance.Text != null)
2524
        //                                {
2525
        //                                    Layer.Children.Add(instance);
2526
        //                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
2527
        //                                    if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
2528
        //                                    {
2529
        //                                        s.fontConfig = new List<string>();
2530

    
2531
        //                                        s.fontConfig.Add("Arial");
2532
        //                                        s.fontConfig.Add("Normal");
2533
        //                                        s.fontConfig.Add("Normal");
2534
        //                                        s.fontConfig.Add("30");
2535
        //                                    }
2536
        //                                    instance.TextFamily = new FontFamily(s.fontConfig[0]);
2537
        //                                    instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
2538
        //                                    instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
2539

    
2540
        //                                    //if (s.fontConfig.Count == 3)
2541
        //                                    //{
2542
        //                                    //    instance.TextSize = 30;
2543
        //                                    //}
2544
        //                                    //else
2545
        //                                    //{
2546
        //                                    //    instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
2547
        //                                    //}
2548
        //                                    instance.ApplyTemplate();
2549
        //                                    if (s.fontConfig.Count() == 4)
2550
        //                                    {
2551
        //                                        instance.UnderLine = TextDecorations.Underline;
2552
        //                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
2553
        //                                    }
2554
        //                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
2555
        //                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
2556

    
2557
        //                                    instance.DrawingCloud();
2558
        //                                }
2559
        //                            }
2560
        //                            break;
2561
        //                        #endregion
2562
        //                        #region Arc
2563
        //                        case "ArcControl":
2564
        //                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
2565
        //                            {
2566
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2567
        //                                ArcControl instance = new ArcControl()
2568
        //                                {
2569
        //                                    StartPoint = s.StartPoint,
2570
        //                                    EndPoint = s.EndPoint,
2571
        //                                    DashSize = s.DashSize,
2572
        //                                    PointSet = s.PointSet,
2573
        //                                    isTransOn = s.IsTrans,
2574
        //                                    MidPoint = s.MP,
2575
        //                                    StrokeColor = _SetColor,
2576
        //                                    UserID = s.UserID,
2577
        //                                    LineSize = Convert.ToDouble(data2.First()),
2578
        //                                };
2579
        //#if SILVERLIGHT
2580
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2581
        //#endif
2582
        //                                Layer.Children.Add(instance);
2583
        //                                instance.ApplyTemplate();
2584
        //                                instance.SetArcPath();
2585
        //                            }
2586
        //                            break;
2587
        //                        #endregion
2588
        //                        #region RectCloud
2589
        //                        case "RectCloudControl":
2590
        //                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
2591
        //                            {
2592
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2593
        //                                RectCloudControl instance = new RectCloudControl()
2594
        //                                {
2595
        //                                    StartPoint = s.StartPoint,
2596
        //                                    EndPoint = s.EndPoint,
2597
        //                                    LeftBottomPoint = s.LB,
2598
        //                                    UserID = s.UserID,
2599
        //                                    Paint = s.PaintState,
2600
        //                                    Opacity = s.Opac,
2601
        //                                    DashSize = s.DashSize,
2602
        //                                    TopRightPoint = s.TR,
2603
        //                                    PointSet = s.PointSet,
2604
        //                                    StrokeColor = _SetColor,
2605
        //                                    LineSize = Convert.ToDouble(data2.First()),
2606
        //                                };
2607
        //#if SILVERLIGHT
2608
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2609
        //#endif
2610
        //                                Layer.Children.Add(instance);
2611
        //                                instance.ApplyTemplate();
2612
        //                                instance.SetRectCloud();
2613
        //                            }
2614
        //                            break;
2615
        //                        #endregion
2616
        //                        #region Sign
2617
        //                        case "SignControl":
2618
        //                            {
2619
        //                                using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
2620
        //                                {
2621
        //                                    SignControl instance = new SignControl
2622
        //                                    {
2623
        //                                        Angle = s.Angle,
2624
        //                                        UserNumber = s.UserNumber,
2625
        //                                        StartPoint = s.StartPoint,
2626
        //                                        UserID = s.UserID,
2627
        //                                        TopRightPoint = s.TR,
2628
        //                                        EndPoint = s.EndPoint,
2629
        //                                        LeftBottomPoint = s.LB,
2630
        //                                        PointSet = s.PointSet,
2631
        //                                        SignImage = null,
2632
        //                                    };
2633
        //#if SILVERLIGHT
2634
        //                                    ToolTipService.SetToolTip(instance, UserNumber);
2635
        //#endif
2636
        //#if SILVERLIGHT
2637
        //                                    SignUserSet.Add(instance);
2638
        //#endif
2639
        //                                    Layer.Children.Add(instance);
2640
        //                                    instance.ApplyTemplate();
2641
        //                                    instance.SetImage();
2642
        //                                }
2643
        //                            }
2644
        //                            break;
2645
        //                        #endregion
2646
        //                        #region Ink
2647
        //                        case "InkPresenter":
2648
        //                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
2649
        //                            {
2650
        //#if SILVERLIGHT
2651
        //                                this._InkBoard.Strokes = s.SCC;
2652
        //#endif
2653
        //                            }
2654
        //                            break;
2655
        //                        #endregion
2656
        //                        #region Date
2657
        //                        case "DateControl":
2658
        //                            {
2659
        //                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
2660
        //                                {
2661
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2662
        //                                    DateControl instance = new DateControl
2663
        //                                    {
2664
        //                                        Angle = s.Angle,
2665
        //                                        StartPoint = s.StartPoint,
2666
        //                                        UserID = s.UserID,
2667
        //                                        EndPoint = s.EndPoint,
2668
        //                                        LeftBottomPoint = s.LB,
2669
        //                                        TopRightPoint = s.TR,
2670
        //                                        Opacity = s.Opac,
2671
        //                                        FontColor = _SetColor,
2672
        //                                        LineSize = Convert.ToDouble(data2.First()),
2673
        //                                        Text = s.Text,
2674
        //                                        PointSet = s.PointSet,
2675
        //                                    };
2676
        //#if SILVERLIGHT
2677
        //                                    ToolTipService.SetToolTip(instance, UserNumber);
2678
        //#endif
2679
        //                                    Layer.Children.Add(instance);
2680
        //                                    instance.ApplyTemplate();
2681
        //                                    instance.SetDate();
2682
        //                                }
2683
        //                            }
2684
        //                            break;
2685
        //                        #endregion
2686
        //                        #region Symbol
2687
        //                        case "SymControl":
2688
        //                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
2689
        //                            {
2690
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2691
        //                                StringToPathConverter sm = new StringToPathConverter();
2692
        //                                SymControl instance = new SymControl()
2693
        //                                {
2694
        //                                    LineSize = Convert.ToDouble(data2.First()),
2695
        //                                    PointSet = s.PointSet,
2696
        //                                    Paint = s.PaintState,
2697
        //                                    StartPoint = s.StartPoint,
2698
        //                                    StrokeColor = _SetColor,
2699
        //                                    EndPoint = s.EndPoint,
2700
        //                                    Angle = s.Angle,
2701
        //                                    UserID = s.UserID,
2702
        //                                    LeftBottomPoint = s.LB,
2703
        //                                    TopRightPoint = s.TR,
2704
        //                                    PathData = sm.Convert(s.PathInfo.ToString()),
2705
        //                                    Opacity = s.Opac,
2706
        //                                };
2707
        //                                //if (ToolTipService.GetToolTip(instance).ToString() == "")
2708
        //                                //{
2709
        //#if SILVERLIGHT
2710
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2711
        //#endif
2712
        //                                //} //조장원
2713
        //                                Layer.Children.Add(instance);
2714
        //                                instance.ApplyTemplate();
2715
        //                                instance.SetSymPath();
2716
        //                            }
2717
        //                            break;
2718
        //                        #endregion
2719
        //                        #region Image
2720
        //                        case "ImgControl":
2721
        //                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
2722
        //                            {
2723
        //                                ImgControl instance = new ImgControl
2724
        //                                {
2725
        //                                    Angle = s.Angle,
2726
        //                                    StartPoint = s.StartPoint,
2727
        //                                    TopRightPoint = s.TR,
2728
        //                                    EndPoint = s.EndPoint,
2729
        //                                    LeftBottomPoint = s.LB,
2730
        //                                    PointSet = s.PointSet,
2731
        //                                    Opacity = s.Opac,
2732
        //                                    UserID = s.UserID,
2733
        //                                    FilePath = s.ImagePath,
2734
        //                                };
2735
        //                                Layer.Children.Add(instance);
2736
        //                                instance.ApplyTemplate();
2737

    
2738
        //                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
2739
        //                                instance.SetImage();
2740
        //                                //                                if (ToolTipService.GetToolTip(instance).ToString() == "")
2741
        //                                //                                {
2742
        //                                //#if SILVERLIGHT
2743
        //                                //                                    ToolTipService.SetToolTip(instance, UserNumber);
2744
        //                                //#endif
2745
        //                                //                                }
2746
        //                            }
2747
        //                            break;
2748
        //                        #endregion
2749
        //                        #region SymbolN
2750
        //                        case "SymControlN":
2751
        //                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
2752
        //                            {
2753
        //                                SymControlN instance = new SymControlN()
2754
        //                                {
2755
        //                                    PointSet = s.PointSet,
2756
        //                                    StartPoint = s.StartPoint,
2757
        //                                    EndPoint = s.EndPoint,
2758
        //                                    Angle = s.Angle,
2759
        //                                    LeftBottomPoint = s.LB,
2760
        //                                    TopRightPoint = s.TR,
2761
        //                                    Opacity = s.Opac,
2762
        //                                    UserID = s.UserID,
2763
        //                                    //PathXathData = s.DBData,
2764
        //                                };
2765

    
2766
        //                                //if (ToolTipService.GetToolTip(instance).ToString() == "")
2767
        //                                //{
2768
        //#if SILVERLIGHT
2769
        //                                //ToolTipService.SetToolTip(instance, UserNumber);
2770
        //#endif
2771
        //                                //}
2772
        //                                Layer.Children.Add(instance);
2773
        //                                instance.ApplyTemplate();
2774
        //#if SILVERLIGHT
2775

    
2776
        //                                instance.PathXathData = JsonSerializerHelper.UnCompressString_NonPrefix(s.DBData);
2777
        //                                object obj = XamlReader.Load(JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData));
2778
        //                                //object obj = XamlReader.Load(instance.PathXathData);
2779
        //                                instance.Base_ViewBox.Child = obj as UIElement;
2780
        //#else
2781
        //                                MemoryStream memoryStream = new MemoryStream(Convert.FromBase64String(instance.PathXathData));
2782
        //                                object obj = XamlReader.Load(memoryStream);
2783
        //#endif
2784
        //                                instance.SetViewBox();
2785
        //                            }
2786
        //                            break;
2787
        //                        #endregion
2788
        //                        default:
2789
        //                            break;
2790
        //                    };
2791
        //                }
2792
        //            }
2793
        //#if SILVERLIGHT
2794
        //            this.GetSignImageLoaded(SignUserSet);
2795
        //#endif
2796
        //        } 
2797
        #endregion
2798

    
2799

    
2800
        public string markupParse_GetMemo(string MarkupString)
2801
        {
2802
            var item = JsonSerializerHelper.UnCompressString(MarkupString); //언패킹작업
2803
            var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
2804
            return unknownData.Memo;
2805
        }
2806

    
2807
        //프린트
2808
        public void markupParse(string MarkupString, Canvas Layer, string DisplayColor, string ToolTipMessage)
2809
        {
2810
            if (MarkupString != "False")
2811
            {
2812
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
2813
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
2814
                string[] delimiterChars = { "|DZ|" };
2815
                string[] delimiterChars2 = { "|" };
2816
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
2817
                List<string> dataSet = new List<string>();
2818

    
2819
                foreach (var dataPease in data)
2820
                {
2821
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
2822
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
2823
                    switch (unkownControl.Name)
2824
                    {
2825
                        #region Shape
2826
                        #region Rectangle
2827
                        case "RectangleControl":
2828
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
2829
                            {
2830
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2831
                                RectangleControl instance = new RectangleControl
2832
                                {
2833
                                    LineSize = Convert.ToDouble(data2.First()),
2834
                                    Paint = s.PaintState,
2835
                                    StartPoint = s.StartPoint,
2836
                                    EndPoint = s.EndPoint,
2837
                                    Angle = s.Angle,
2838
                                    StrokeColor = _SetColor,
2839
                                    DashSize = s.DashSize,
2840
                                    Opacity = s.Opac,
2841
                                    LeftBottomPoint = s.LB,
2842
                                    TopRightPoint = s.TR,
2843
                                    PointSet = s.PointSet,
2844
                                    UserID = s.UserID
2845
                                };
2846

    
2847
                                Layer.Children.Add(instance);
2848
                                instance.ApplyTemplate();
2849
                                instance.SetRectPath();
2850
                            }
2851
                            break;
2852
                        #endregion
2853
                        #region Triangle
2854
                        case "TriControl":
2855
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
2856
                            {
2857
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2858
                                TriControl instance = new TriControl
2859
                                {
2860
                                    LineSize = Convert.ToDouble(data2.First()),
2861
                                    MidPoint = s.MidPoint,
2862
                                    StartPoint = s.StartPoint,
2863
                                    Paint = s.Paint,
2864
                                    EndPoint = s.EndPoint,
2865
                                    Opacity = s.Opac,
2866
                                    Angle = s.Angle,
2867
                                    DashSize = s.DashSize,
2868
                                    PointSet = s.PointSet,
2869
                                    StrokeColor = _SetColor,
2870
                                    UserID = s.UserID,
2871
                                };
2872

    
2873
                                Layer.Children.Add(instance);
2874
                                instance.ApplyTemplate();
2875
                                instance.SetTri();
2876
                            }
2877
                            break;
2878
                        #endregion
2879
                        #region Cicle
2880
                        case "CircleControl":
2881
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
2882
                            {
2883
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2884
                                CircleControl instance = new CircleControl
2885
                                {
2886
                                    LineSize = Convert.ToDouble(data2.First()),
2887
                                    Paint = s.PaintState,
2888
                                    StartPoint = s.StartPoint,
2889
                                    EndPoint = s.EndPoint,
2890
                                    LeftBottomPoint = s.LBP,
2891
                                    TopRightPoint = s.TRP,
2892
                                    Opacity = s.Opac,
2893
                                    Angle = s.Angle,
2894
                                    DashSize = s.DashSize,
2895
                                    PointSet = s.PointSet,
2896
                                    StrokeColor = _SetColor,
2897
                                    UserID = s.UserID,
2898
                                };
2899

    
2900
                                Layer.Children.Add(instance);
2901
                                instance.ApplyTemplate();
2902
                                instance.SetCircle();
2903
                            }
2904
                            break;
2905
                        #endregion
2906
                        #region RectCloud
2907
                        case "RectCloudControl":
2908
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
2909
                            {
2910
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2911
                                RectCloudControl instance = new RectCloudControl()
2912
                                {
2913
                                    StartPoint = s.StartPoint,
2914
                                    EndPoint = s.EndPoint,
2915
                                    LeftBottomPoint = s.LB,
2916
                                    Paint = s.PaintState,
2917
                                    Opacity = s.Opac,
2918
                                    DashSize = s.DashSize,
2919
                                    TopRightPoint = s.TR,
2920
                                    PointSet = s.PointSet,
2921
                                    StrokeColor = _SetColor,
2922
                                    LineSize = Convert.ToDouble(data2.First()),
2923
                                    ArcLength = s.ArcLength,
2924
                                    UserID = s.UserID
2925
                                };
2926

    
2927
                                Layer.Children.Add(instance);
2928
                                instance.ApplyTemplate();
2929
                                instance.SetRectCloud();
2930
                            }
2931
                            break;
2932
                        #endregion
2933
                        #endregion
2934

    
2935
                        #region Polygon
2936
                        #region Poly
2937
                        case "PolygonControl":
2938
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
2939
                            {
2940
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2941
                                PolygonControl instance = new PolygonControl
2942
                                {
2943
                                    LineSize = Convert.ToDouble(data2.First()),
2944
                                    //Toler = s.Toler,
2945
                                    IsCompleted = s.IsCompleted,
2946
                                    //PointSet = new List<Point>(),
2947
                                    Opacity = s.Opac,
2948
                                    StrokeColor = _SetColor,
2949
                                    StartPoint = s.StartPoint,
2950
                                    EndPoint = s.EndPoint,
2951
                                    PointSet = s.PointSet,
2952
                                    UserID = s.UserID,
2953
                                    DashSize = s.DashSize,
2954
                                    Paint = s.PaintState,
2955
                                    //강인구 추가(Chain인지 Polygon인지 구분)
2956
                                    ControlType = s.Type,
2957
                                    //PointC = s.PointC,
2958
                                };
2959
                                Layer.Children.Add(instance);
2960

    
2961
                                instance.ApplyTemplate();
2962
                                instance.SetPolyPath();
2963

    
2964
                                //instance.PointSet = s.PointSet;
2965
                                //instance.ClosePath();
2966
                                //instance.ChangePaint(s.PaintState);
2967
                            }
2968
                            break;
2969
                        #endregion
2970
                        #region InkControl
2971
                        case "InkControl":
2972
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
2973
                            {
2974
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2975
                                InkControl instance = new InkControl
2976
                                {
2977
                                    LineSize = Convert.ToDouble(data2.First()),
2978
                                    //Toler = s.Toler,
2979
                                    IsCompleted = s.IsCompleted,
2980
                                    //PointSet = new List<Point>(),
2981
                                    Opacity = s.Opac,
2982
                                    StrokeColor = _SetColor,
2983
                                    StartPoint = s.StartPoint,
2984
                                    EndPoint = s.EndPoint,
2985
                                    PointSet = s.PointSet,
2986
                                    UserID = s.UserID,
2987
                                    DashSize = s.DashSize,
2988
                                    Paint = s.PaintState,
2989
                                    //강인구 추가(Chain인지 Polygon인지 구분)
2990
                                    ControlType = s.Type,
2991
                                    //PointC = s.PointC,
2992
                                };
2993
                                Layer.Children.Add(instance);
2994

    
2995
                                instance.ApplyTemplate();
2996
                                instance.SetPolyPath();
2997

    
2998
                                //instance.PointSet = s.PointSet;
2999
                                //instance.ClosePath();
3000
                                //instance.ChangePaint(s.PaintState);
3001
                            }
3002
                            break;
3003
                        #endregion
3004
                        #region Cloud
3005
                        case "CloudControl":
3006
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
3007
                            {
3008
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3009
                                CloudControl instance = new CloudControl
3010
                                {
3011
                                    LineSize = Convert.ToDouble(data2.First()),
3012
                                    Toler = s.Toler,
3013
                                    PointSet = new List<Point>(),
3014
                                    ArcLength = s.ArcLength,
3015
                                    Paint = s.PaintState,
3016
                                    Opacity = s.Opac,
3017
                                    StrokeColor = _SetColor,
3018
                                    isTransOn = s.IsTrans,
3019
                                    isChain = s.IsChain,
3020
                                    DashSize = s.DashSize,
3021
                                    UserID = s.UserID,
3022
                                    StartPoint = s.StartPoint,
3023
                                    EndPoint = s.EndPoint,
3024
                                    //Fill = s.CloudFill,
3025
                                };
3026
                                Layer.Children.Add(instance);
3027
                                instance.pointSet = s.PointSet;
3028
                                instance.PointSet = s.PointSet;
3029
                                instance.ApplyTemplate();
3030
                                instance.ClosePath();
3031
                                instance.ChangePaint(s.PaintState);
3032
                            }
3033
                            break;
3034
                        #endregion
3035
                        #endregion
3036

    
3037
                        #region Line
3038
                        #region Line
3039
                        case "LineControl":
3040
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
3041
                            {
3042
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3043
                                LineControl instance = new LineControl()
3044
                                {
3045
                                    LineStyleSet = s.LineStyleSet,
3046
                                    StartPoint = s.StartPoint,
3047
                                    DimSize = s.DimSize,
3048
                                    EndPoint = s.EndPoint,
3049
                                    DashSize = s.DashSize,
3050
                                    Interval = s.Interval,
3051
                                    PointSet = s.PointSet,
3052
                                    Opacity = s.Opac,
3053
                                    StrokeColor = _SetColor,
3054
                                    UserID = s.UserID,
3055
                                    LineSize = Convert.ToDouble(data2.First()),
3056
                                };
3057
                                Layer.Children.Add(instance);
3058
                                instance.ApplyTemplate();
3059
                                instance.SetLinePath();
3060
                            }
3061
                            break;
3062
                        #endregion
3063
                        #region Arrow_Multi
3064
                        case "ArrowControl_Multi":
3065
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
3066
                            {
3067
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3068
                                ArrowControl_Multi instance = new ArrowControl_Multi
3069
                                {
3070
                                    LineSize = Convert.ToDouble(data2.First()),
3071
                                    StartPoint = s.StartPoint,
3072
                                    MiddlePoint = s.MidPoint,
3073
                                    DashSize = s.DashSize,
3074
                                    EndPoint = s.EndPoint,
3075
                                    PointSet = s.PointSet,
3076
                                    Opacity = s.Opac,
3077
                                    StrokeColor = _SetColor,
3078
                                    UserID = s.UserID
3079
                                };
3080

    
3081
                                Layer.Children.Add(instance);
3082
                                instance.ApplyTemplate();
3083
                                instance.SetArrowMultiPath();
3084
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3085

    
3086
                            }
3087
                            break;
3088
                        #endregion
3089
                        #region Arc
3090
                        case "ArcControl":
3091
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
3092
                            {
3093
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3094
                                ArcControl instance = new ArcControl()
3095
                                {
3096
                                    StartPoint = s.StartPoint,
3097
                                    EndPoint = s.EndPoint,
3098
                                    DashSize = s.DashSize,
3099
                                    PointSet = s.PointSet,
3100
                                    isTransOn = s.IsTransOn,
3101
                                    MidPoint = s.MidPoint,
3102
                                    StrokeColor = _SetColor,
3103
                                    Opacity = s.Opac,
3104
                                    Clock = s.Clock,
3105
                                    LineSize = Convert.ToDouble(data2.First()),
3106
                                    UserID = s.UserID,
3107
                                };
3108

    
3109
                                Layer.Children.Add(instance);
3110
                                instance.ApplyTemplate();
3111
                                instance.SetArcPath();
3112
                            }
3113
                            break;
3114
                        #endregion
3115
                        #endregion
3116

    
3117
                        #region Text
3118
                        case "TextControl":
3119
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
3120
                            {
3121
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3122
                                TextControl instance = new TextControl()
3123
                                {
3124
                                    Text = s.Text,
3125
                                    StartPoint = s.StartPoint,
3126
                                    EndPoint = s.EndPoint,
3127
                                    CanvasX = s.StartPoint.X,
3128
                                    CanvasY = s.StartPoint.Y,
3129
                                    BoxWidth = s.BoxW,
3130
                                    BoxHeight = s.BoxH,
3131
                                    ControlType_No = s.paintMethod,
3132
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
3133
                                    TextSize = Convert.ToDouble(data2[1]),
3134
                                    FontColor = _SetColor,
3135
                                    FontSize = 10,
3136
                                    UserID = s.UserID,
3137
                                    //isHighLight = s.isHighLight,
3138
                                    Angle = s.Angle,
3139
                                    PointSet = s.PointSet,
3140
                                    Opacity = s.Opac,
3141
                                    TextFamily = new FontFamily(s.fontConfig[0]),
3142
                                    //인구 추가(2018.04.17)
3143
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
3144
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
3145
                                };
3146

    
3147
                                if (instance.Text != null)
3148
                                {
3149
                                    Layer.Children.Add(instance);
3150
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
3151
                                    instance.ApplyTemplate();
3152
                                    if (s.fontConfig.Count() == 4)
3153
                                    {
3154
                                        instance.UnderLine = TextDecorations.Underline;
3155
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
3156
                                    }
3157
                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
3158

    
3159
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3160
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3161
                                    instance.DrawingCloud();
3162
                                    instance.SetText();
3163
                                }
3164
                            }
3165
                            break;
3166
                        #endregion
3167

    
3168
                        #region ArrowText
3169
                        case "ArrowTextControl":
3170
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
3171
                            {
3172
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3173
                                ArrowTextControl instance = new ArrowTextControl();
3174
                                Layer.Children.Add(instance);
3175
                                //instance.LineSize = Convert.ToDouble(data2.First());
3176
                                instance.PointSet = s.PointSet;
3177
                                instance.StartPoint = s.StartPoint;
3178
                                instance.EndPoint = s.EndPoint;
3179
                                instance.StrokeColor = _SetColor;
3180
                                //instance.DashSize = s.DashSize;
3181
                                instance.ArrowTextStyle = s.ArrowStyle;
3182
                                instance.isHighLight = s.isHighLight;
3183
                                instance.ArrowText = s.ArrowText;
3184
                                instance.Opacity = s.Opac;
3185
                                instance.BorderSize = s.BorderSize;
3186
                                instance.BoxWidth = s.BoxWidth;
3187
                                instance.BoxHeight = s.BoxHeight;
3188
                                instance.isFixed = s.isFixed;
3189
                                instance.Angle = s.Angle;
3190
                                instance.UserID = s.UserID;
3191
                                instance.isTrans = s.isTrans;
3192
                                instance.MidPoint = s.MidPoint;
3193
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
3194
                                {
3195
                                    s.fontConfig = new List<string>();
3196

    
3197
                                    s.fontConfig.Add("Arial");
3198
                                    s.fontConfig.Add("Normal");
3199
                                    s.fontConfig.Add("Normal");
3200
                                    s.fontConfig.Add("30");
3201
                                }
3202
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
3203
                                //인구 추가(2018.04.17)
3204
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
3205
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
3206
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
3207

    
3208
                                instance.ApplyTemplate();
3209

    
3210
                                if (s.fontConfig.Count() == 5)
3211
                                {
3212
                                    instance.UnderLine = TextDecorations.Underline;
3213
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
3214
                                }
3215
                                instance.SetArrowTextPath();
3216

    
3217
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3218
                            };
3219
                            break;
3220
                        #endregion
3221

    
3222
                        #region Date
3223
                        case "DateControl":
3224
                            {
3225
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
3226
                                {
3227
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3228
                                    DateControl instance = new DateControl
3229
                                    {
3230
                                        Angle = s.Angle,
3231
                                        StartPoint = s.StartPoint,
3232
                                        EndPoint = s.EndPoint,
3233
                                        LeftBottomPoint = s.LB,
3234
                                        TopRightPoint = s.TR,
3235
                                        Opacity = s.Opac,
3236
                                        FontColor = _SetColor,
3237
                                        LineSize = Convert.ToDouble(data2.First()),
3238
                                        Text = s.Text,
3239
                                        PointSet = s.PointSet,
3240
                                        UserID = s.UserID
3241
                                    };
3242

    
3243
                                    Layer.Children.Add(instance);
3244
                                    instance.ApplyTemplate();
3245
                                    instance.SetDate();
3246
                                }
3247
                            }
3248
                            break;
3249
                        #endregion
3250

    
3251
                        #region Image
3252
                        case "ImgControl":
3253
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
3254
                            {
3255
                                Image img = new Image();
3256
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
3257

    
3258
                                ImgControl instance = new ImgControl
3259
                                {
3260
                                    Angle = s.Angle,
3261
                                    StartPoint = s.StartPoint,
3262
                                    TopRightPoint = s.TR,
3263
                                    EndPoint = s.EndPoint,
3264
                                    LeftBottomPoint = s.LB,
3265
                                    PointSet = s.PointSet,
3266
                                    Opacity = s.Opac,
3267
                                    FilePath = s.ImagePath,
3268
                                    UserID = s.UserID,
3269
                                    ImageData = img.Source
3270
                                };
3271
                                Layer.Children.Add(instance);
3272
                                instance.ApplyTemplate();
3273
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3274
                                instance.SetImage();
3275

    
3276
                            }
3277
                            break;
3278
                        #endregion
3279

    
3280
                        #region Symbol
3281
                        case "SymControl":
3282
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
3283
                            {
3284
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3285
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
3286
                                SymControl instance = new SymControl()
3287
                                {
3288
                                    LineSize = Convert.ToDouble(data2.First()),
3289
                                    PointSet = s.PointSet,
3290
                                    Paint = s.PaintState,
3291
                                    StartPoint = s.StartPoint,
3292
                                    StrokeColor = _SetColor,
3293
                                    EndPoint = s.EndPoint,
3294
                                    Angle = s.Angle,
3295
                                    LeftBottomPoint = s.LB,
3296
                                    TopRightPoint = s.TR,
3297
                                    PathData = sm.Convert(s.PathInfo.ToString()),
3298
                                    Opacity = s.Opac,
3299
                                };
3300
                                instance.Memo = s.Memo;
3301
                                Layer.Children.Add(instance);
3302
                                instance.ApplyTemplate();
3303
                                instance.SetSymPath();
3304
                            }
3305
                            break;
3306
                        #endregion
3307

    
3308
                        #region SymbolN
3309
                        case "SymControlN":
3310
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
3311
                            {
3312
                                SymControlN instance = new SymControlN()
3313
                                {
3314
                                    PointSet = s.PointSet,
3315
                                    StartPoint = s.StartPoint,
3316
                                    EndPoint = s.EndPoint,
3317
                                    Angle = s.Angle,
3318
                                    LeftBottomPoint = s.LB,
3319
                                    TopRightPoint = s.TR,
3320
                                    Opacity = s.Opac,
3321
                                    PathXathData = s.DBData,
3322
                                };
3323

    
3324
                                instance.Memo = s.Memo;
3325
                                Layer.Children.Add(instance);
3326
                                instance.ApplyTemplate();
3327

    
3328
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3329
                                //instance.PathXathData = s.DBData;
3330

    
3331
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3332
                                //xamlData = xamlData.Replace("daelim", "DAELIM");
3333
                                //System.IO.MemoryStream stream = new System.IO.MemoryStream();
3334
                                //System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
3335
                                //writer.Write(xamlData);
3336
                                //writer.Flush();
3337
                                //stream.Position = 0;
3338

    
3339
                                //object obj = XamlReader.Load(stream);
3340
                                //instance.Base_ViewBox.Child = obj as UIElement;
3341
                                //instance.PathXathData = appovalData;
3342
                                //instance.SetViewBox();
3343
                            }
3344
                            break;
3345
                        #endregion
3346

    
3347
                        #region Sign
3348
                        case "SignControl":
3349
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
3350
                            {
3351
                                SignControl instance = new SignControl
3352
                                {
3353
                                    Angle = s.Angle,
3354
                                    StartPoint = s.StartPoint,
3355
                                    TopRightPoint = s.TR,
3356
                                    EndPoint = s.EndPoint,
3357
                                    LeftBottomPoint = s.LB,
3358
                                    PointSet = s.PointSet,
3359
                                    Opacity = s.Opac,
3360
                                    SignImage = null,
3361
                                    UserID = s.UserID,
3362
                                };
3363
                                instance.ApplyTemplate();
3364
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3365

    
3366
                                if (s.UserNumber != null)
3367
                                {
3368
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
3369
                                    if (_sign != null)
3370
                                    {
3371
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
3372

    
3373
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
3374
                                        stream.Write(imageBytes, 0, imageBytes.Length);
3375
                                        stream.Position = 0;
3376
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
3377
                                        BitmapImage returnImage = new BitmapImage();
3378
                                        returnImage.BeginInit();
3379
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
3380
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
3381
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
3382
                                        returnImage.StreamSource = ms;
3383
                                        returnImage.EndInit();
3384
                                        stream.Close();
3385
                                        instance.SignImage = returnImage;
3386
                                    }
3387
                                }
3388

    
3389

    
3390
                                instance.Memo = s.Memo;
3391
                                Layer.Children.Add(instance);
3392
                                instance.ApplyTemplate();
3393
                                instance.SetImage();
3394
                            }
3395
                            break;
3396
                        #endregion
3397

    
3398

    
3399

    
3400
                        default:
3401
                            break;
3402
                    };
3403
                }
3404
            }
3405
        }
3406

    
3407
        /// <summary>
3408
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
3409
        /// </summary>
3410
        /// <param name="MarkupString"></param>
3411
        public void markupParse(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID)
3412
        {
3413
            if (MarkupString != "False")
3414
            {
3415
                //GetUserSign getUser = new GetUserSign();
3416
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
3417
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
3418
                string[] delimiterChars = { "|DZ|" };
3419
                string[] delimiterChars2 = { "|" };
3420
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
3421
                List<string> dataSet = new List<string>();
3422

    
3423
                foreach (var dataPease in data)
3424
                {
3425
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
3426
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
3427
                    switch (unkownControl.Name)
3428
                    {
3429
                        #region ArrowText
3430
                        case "ArrowTextControl":
3431
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
3432
                            {
3433
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3434
                                ArrowTextControl instance = new ArrowTextControl();
3435
                                instance.MarkupInfoID = markupInfoID;
3436
                                //Layer.Children.Add(instance);
3437
                                baseLayer.Add(instance);
3438
                                //instance.LineSize = Convert.ToDouble(data2.First());
3439
                                instance.PointSet = s.PointSet;
3440
                                instance.StartPoint = s.StartPoint;
3441
                                instance.EndPoint = s.EndPoint;
3442
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
3443
                                //instance.DashSize = s.DashSize;
3444
                                instance.ArrowTextStyle = s.ArrowStyle;
3445
                                instance.isHighLight = s.isHighLight;
3446
                                instance.ArrowText = s.ArrowText;
3447
                                instance.Opacity = s.Opac;
3448
                                instance.BorderSize = s.BorderSize;
3449
                                instance.BoxWidth = s.BoxWidth;
3450
                                instance.BoxHeight = s.BoxHeight;
3451
                                instance.isFixed = s.isFixed;
3452
                                instance.Angle = s.Angle;
3453
                                instance.UserID = s.UserID;
3454
                                instance.StrokeColor = _SetColor;
3455
                                instance.isTrans = s.isTrans;
3456
                                instance.MidPoint = s.MidPoint;
3457
                                instance.Memo = s.Memo;
3458
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
3459
                                {
3460
                                    s.fontConfig = new List<string>();
3461

    
3462
                                    s.fontConfig.Add("Arial");
3463
                                    s.fontConfig.Add("Normal");
3464
                                    s.fontConfig.Add("Normal");
3465
                                    s.fontConfig.Add("30");
3466
                                }
3467
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
3468
                                //인구 추가(2018.04.17)
3469
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
3470
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
3471
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
3472
                                instance.ApplyTemplate();
3473

    
3474
                                if (s.fontConfig.Count() == 5)
3475
                                {
3476
                                    instance.UnderLine = TextDecorations.Underline;
3477
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
3478
                                }
3479
                                instance.SetArrowTextPath();
3480
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3481
                            };
3482
                            break;
3483
                        #endregion
3484
                        #region Arrow_Multi
3485
                        case "ArrowControl_Multi":
3486
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
3487
                            {
3488
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3489
                                ArrowControl_Multi instance = new ArrowControl_Multi
3490
                                {
3491
                                    LineSize = Convert.ToDouble(data2.First()),
3492
                                    StartPoint = s.StartPoint,
3493
                                    MiddlePoint = s.MidPoint,
3494
                                    DashSize = s.DashSize,
3495
                                    EndPoint = s.EndPoint,
3496
                                    PointSet = s.PointSet,
3497
                                    Opacity = s.Opac,
3498
                                    StrokeColor = _SetColor,
3499
                                    UserID = s.UserID
3500
                                };
3501

    
3502
                                //Layer.Children.Add(instance);
3503
                                instance.MarkupInfoID = markupInfoID;
3504
                                baseLayer.Add(instance);
3505
                                instance.ApplyTemplate();
3506
                                instance.SetArrowMultiPath();
3507
                                instance.Memo = s.Memo;
3508
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3509

    
3510
                            }
3511
                            break;
3512
                        #endregion
3513
                        #region Rectangle
3514
                        case "RectangleControl":
3515
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
3516
                            {
3517
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3518
                                RectangleControl instance = new RectangleControl
3519
                                {
3520
                                    LineSize = Convert.ToDouble(data2.First()),
3521
                                    Paint = s.PaintState,
3522
                                    StartPoint = s.StartPoint,
3523
                                    EndPoint = s.EndPoint,
3524
                                    Angle = s.Angle,
3525
                                    StrokeColor = _SetColor,
3526
                                    DashSize = s.DashSize,
3527
                                    Opacity = s.Opac,
3528
                                    LeftBottomPoint = s.LB,
3529
                                    TopRightPoint = s.TR,
3530
                                    PointSet = s.PointSet,
3531
                                    UserID = s.UserID
3532
                                };
3533

    
3534
                                instance.Memo = s.Memo;
3535
                                //Layer.Children.Add(instance);
3536
                                instance.MarkupInfoID = markupInfoID;
3537
                                baseLayer.Add(instance);
3538
                                instance.ApplyTemplate();
3539
                                instance.SetRectPath();
3540
                            }
3541
                            break;
3542
                        #endregion
3543
                        #region Triangle
3544
                        case "TriControl":
3545
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
3546
                            {
3547
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3548
                                TriControl instance = new TriControl
3549
                                {
3550
                                    LineSize = Convert.ToDouble(data2.First()),
3551
                                    MidPoint = s.MidPoint,
3552
                                    StartPoint = s.StartPoint,
3553
                                    Paint = s.Paint,
3554
                                    EndPoint = s.EndPoint,
3555
                                    Opacity = s.Opac,
3556
                                    Angle = s.Angle,
3557
                                    DashSize = s.DashSize,
3558
                                    PointSet = s.PointSet,
3559
                                    StrokeColor = _SetColor,
3560
                                    UserID = s.UserID,
3561
                                };
3562
                                instance.Memo = s.Memo;
3563
                                //Layer.Children.Add(instance);
3564
                                instance.MarkupInfoID = markupInfoID;
3565
                                baseLayer.Add(instance);
3566
                                instance.ApplyTemplate();
3567
                                instance.SetTri();
3568
                            }
3569
                            break;
3570
                        #endregion
3571
                        #region Cicle
3572
                        case "CircleControl":
3573
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
3574
                            {
3575
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3576
                                CircleControl instance = new CircleControl
3577
                                {
3578
                                    LineSize = Convert.ToDouble(data2.First()),
3579
                                    Paint = s.PaintState,
3580
                                    StartPoint = s.StartPoint,
3581
                                    EndPoint = s.EndPoint,
3582
                                    LeftBottomPoint = s.LBP,
3583
                                    TopRightPoint = s.TRP,
3584
                                    Opacity = s.Opac,
3585
                                    Angle = s.Angle,
3586
                                    DashSize = s.DashSize,
3587
                                    PointSet = s.PointSet,
3588
                                    StrokeColor = _SetColor,
3589
                                    UserID = s.UserID,
3590
                                };
3591
                                instance.Memo = s.Memo;
3592
                                //Layer.Children.Add(instance);
3593
                                instance.MarkupInfoID = markupInfoID;
3594
                                baseLayer.Add(instance);
3595
                                instance.ApplyTemplate();
3596
                                instance.SetCircle();
3597
                            }
3598
                            break;
3599
                        #endregion
3600
                        #region Poly
3601
                        case "PolygonControl":
3602
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
3603
                            {
3604
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3605
                                PolygonControl instance = new PolygonControl
3606
                                {
3607
                                    LineSize = Convert.ToDouble(data2.First()),
3608
                                    //Toler = s.Toler,
3609
                                    IsCompleted = s.IsCompleted,
3610
                                    //PointSet = new List<Point>(),
3611
                                    Opacity = s.Opac,
3612
                                    StrokeColor = _SetColor,
3613
                                    DashSize = s.DashSize,
3614
                                    StartPoint = s.StartPoint,
3615
                                    EndPoint = s.EndPoint,
3616
                                    PointSet = s.PointSet,
3617
                                    UserID = s.UserID,
3618
                                    //강인구 추가(Chain인지 Polygon인지 구분)
3619
                                    ControlType = s.Type,
3620
                                    Paint = s.PaintState,
3621
                                    //PointC = s.PointC,
3622
                                };
3623
                                //Layer.Children.Add(instance);
3624
                                instance.MarkupInfoID = markupInfoID;
3625
                                baseLayer.Add(instance);
3626
                                instance.Memo = s.Memo;
3627
                                instance.ApplyTemplate();
3628
                                instance.SetPolyPath();
3629

    
3630
                                //instance.PointSet = s.PointSet;
3631
                                //instance.ClosePath();
3632
                                //instance.ChangePaint(s.PaintState);
3633
                            }
3634
                            break;
3635
                        #endregion
3636
                        #region InkControl
3637
                        case "InkControl":
3638
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
3639
                            {
3640
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3641
                                InkControl instance = new InkControl
3642
                                {
3643
                                    LineSize = Convert.ToDouble(data2.First()),
3644
                                    //Toler = s.Toler,
3645
                                    IsCompleted = s.IsCompleted,
3646
                                    //PointSet = new List<Point>(),
3647
                                    Opacity = s.Opac,
3648
                                    StrokeColor = _SetColor,
3649
                                    DashSize = s.DashSize,
3650
                                    StartPoint = s.StartPoint,
3651
                                    PointSet = s.PointSet,
3652
                                    UserID = s.UserID,
3653
                                    //강인구 추가(Chain인지 Polygon인지 구분)
3654
                                    ControlType = s.Type,
3655
                                    Paint = s.PaintState,
3656
                                    EndPoint = s.EndPoint,
3657
                                    //PointC = s.PointC,
3658
                                };
3659
                                //Layer.Children.Add(instance);
3660
                                instance.MarkupInfoID = markupInfoID;
3661
                                baseLayer.Add(instance);
3662
                                instance.Memo = s.Memo;
3663
                                instance.ApplyTemplate();
3664
                                instance.SetPolyPath();
3665

    
3666
                                //instance.PointSet = s.PointSet;
3667
                                //instance.ClosePath();
3668
                                //instance.ChangePaint(s.PaintState);
3669
                            }
3670
                            break;
3671
                        #endregion
3672
                        #region Cloud
3673
                        case "CloudControl":
3674
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
3675
                            {
3676
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3677
                                CloudControl instance = new CloudControl
3678
                                {
3679
                                    LineSize = Convert.ToDouble(data2.First()),
3680
                                    Toler = s.Toler,
3681
                                    PointSet = new List<Point>(),
3682
                                    ArcLength = s.ArcLength,
3683
                                    Paint = s.PaintState,
3684
                                    Opacity = s.Opac,
3685
                                    StrokeColor = _SetColor,
3686
                                    isTransOn = s.IsTrans,
3687
                                    isChain = s.IsChain,
3688
                                    DashSize = s.DashSize,
3689
                                    UserID = s.UserID,
3690
                                    StartPoint = s.StartPoint,
3691
                                    EndPoint = s.EndPoint,
3692
                                    //Fill = s.CloudFill,
3693
                                };
3694
                                instance.Memo = s.Memo;
3695
                                //Layer.Children.Add(instance);
3696
                                instance.MarkupInfoID = markupInfoID;
3697
                                baseLayer.Add(instance);
3698
                                instance.PointSet = s.PointSet;
3699
                                instance.ApplyTemplate();
3700
                                instance.ClosePath();
3701
                                instance.ChangePaint(s.PaintState);
3702
                            }
3703
                            break;
3704
                        #endregion
3705
                        #region Line
3706
                        case "LineControl":
3707
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
3708
                            {
3709
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3710
                                LineControl instance = new LineControl()
3711
                                {
3712
                                    LineStyleSet = s.LineStyleSet,
3713
                                    StartPoint = s.StartPoint,
3714
                                    DimSize = s.DimSize,
3715
                                    EndPoint = s.EndPoint,
3716
                                    DashSize = s.DashSize,
3717
                                    Interval = s.Interval,
3718
                                    PointSet = s.PointSet,
3719
                                    Opacity = s.Opac,
3720
                                    StrokeColor = _SetColor,
3721
                                    UserID = s.UserID,
3722
                                    LineSize = Convert.ToDouble(data2.First()),
3723
                                };
3724
                                instance.Memo = s.Memo;
3725
                                //Layer.Children.Add(instance);
3726
                                instance.MarkupInfoID = markupInfoID;
3727
                                baseLayer.Add(instance);
3728
                                instance.ApplyTemplate();
3729
                                instance.SetLinePath();
3730
                            }
3731
                            break;
3732
                        #endregion
3733
                        #region Text
3734
                        case "TextControl":
3735
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
3736
                            {
3737
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3738
                                TextControl instance = new TextControl()
3739
                                {
3740
                                    Text = s.Text,
3741
                                    StartPoint = s.StartPoint,
3742
                                    EndPoint = s.EndPoint,
3743
                                    CanvasX = s.StartPoint.X,
3744
                                    CanvasY = s.StartPoint.Y,
3745
                                    BoxWidth = s.BoxW,
3746
                                    BoxHeight = s.BoxH,
3747
                                    ControlType_No = s.paintMethod,
3748
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
3749
                                    TextSize = Convert.ToDouble(data2[1]),
3750
                                    FontColor = _SetColor,
3751
                                    FontSize = 10,
3752
                                    UserID = s.UserID,
3753
                                    //isHighLight = s.isHighLight,
3754
                                    Angle = s.Angle,
3755
                                    PointSet = s.PointSet,
3756
                                    Opacity = s.Opac,
3757
                                    TextFamily = new FontFamily(s.fontConfig[0]),
3758
                                    //인구 추가(2018.04.17)
3759
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
3760
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
3761
                                };
3762

    
3763
                                if (instance.Text != null)
3764
                                {
3765
                                    //Layer.Children.Add(instance);
3766
                                    instance.MarkupInfoID = markupInfoID;
3767
                                    baseLayer.Add(instance);
3768
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
3769
                                    instance.ApplyTemplate();
3770
                                    instance.Memo = s.Memo;
3771
                                    if (s.fontConfig.Count() == 4)
3772
                                    {
3773
                                        instance.UnderLine = TextDecorations.Underline;
3774
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
3775
                                    }
3776
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
3777
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3778
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3779
                                    instance.DrawingCloud();
3780
                                    instance.SetText();
3781
                                }
3782
                            }
3783
                            break;
3784
                        #endregion
3785
                        #region Arc
3786
                        case "ArcControl":
3787
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
3788
                            {
3789
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3790
                                ArcControl instance = new ArcControl()
3791
                                {
3792
                                    StartPoint = s.StartPoint,
3793
                                    EndPoint = s.EndPoint,
3794
                                    DashSize = s.DashSize,
3795
                                    PointSet = s.PointSet,
3796
                                    isTransOn = s.IsTransOn,
3797
                                    MidPoint = s.MidPoint,
3798
                                    StrokeColor = _SetColor,
3799
                                    Clock = s.Clock,
3800
                                    Opacity = s.Opac,
3801
                                    LineSize = Convert.ToDouble(data2.First()),
3802
                                    UserID = s.UserID,
3803
                                };
3804
                                instance.Memo = s.Memo;
3805
                                //Layer.Children.Add(instance);
3806
                                instance.MarkupInfoID = markupInfoID;
3807
                                baseLayer.Add(instance);
3808
                                instance.ApplyTemplate();
3809
                                instance.SetArcPath();
3810
                            }
3811
                            break;
3812
                        #endregion
3813
                        #region RectCloud
3814
                        case "RectCloudControl":
3815
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
3816
                            {
3817
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3818
                                RectCloudControl instance = new RectCloudControl()
3819
                                {
3820
                                    StartPoint = s.StartPoint,
3821
                                    EndPoint = s.EndPoint,
3822
                                    LeftBottomPoint = s.LB,
3823
                                    Paint = s.PaintState,
3824
                                    Opacity = s.Opac,
3825
                                    DashSize = s.DashSize,
3826
                                    TopRightPoint = s.TR,
3827
                                    PointSet = s.PointSet,
3828
                                    StrokeColor = _SetColor,
3829
                                    ArcLength = s.ArcLength,
3830
                                    LineSize = Convert.ToDouble(data2.First()),
3831
                                    UserID = s.UserID
3832
                                };
3833
                                instance.Memo = s.Memo;
3834
                                //Layer.Children.Add(instance);
3835
                                instance.MarkupInfoID = markupInfoID;
3836
                                baseLayer.Add(instance);
3837
                                instance.ApplyTemplate();
3838
                                instance.SetRectCloud();
3839
                            }
3840
                            break;
3841
                        #endregion
3842
                        #region Sign
3843
                        case "SignControl":
3844
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
3845
                            {
3846
                                SignControl instance = new SignControl
3847
                                {
3848
                                    Angle = s.Angle,
3849
                                    StartPoint = s.StartPoint,
3850
                                    TopRightPoint = s.TR,
3851
                                    EndPoint = s.EndPoint,
3852
                                    LeftBottomPoint = s.LB,
3853
                                    PointSet = s.PointSet,
3854
                                    Opacity = s.Opac,
3855
                                    SignImage = null,
3856
                                    UserID = s.UserID,
3857
                                };
3858
                                instance.ApplyTemplate();
3859
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3860

    
3861
                                if (s.UserNumber != null)
3862
                                {
3863
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
3864
                                    if (_sign != null)
3865
                                    {
3866
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
3867

    
3868
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
3869
                                        stream.Write(imageBytes, 0, imageBytes.Length);
3870
                                        stream.Position = 0;
3871
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
3872
                                        BitmapImage returnImage = new BitmapImage();
3873
                                        returnImage.BeginInit();
3874
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
3875
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
3876
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
3877
                                        returnImage.StreamSource = ms;
3878
                                        returnImage.EndInit();
3879
                                        stream.Close();
3880
                                        instance.SignImage = returnImage;
3881
                                    }
3882
                                }
3883

    
3884
                                instance.Memo = s.Memo;
3885
                                //Layer.Children.Add(instance);
3886
                                instance.MarkupInfoID = markupInfoID;
3887
                                baseLayer.Add(instance);
3888
                                instance.ApplyTemplate();
3889
                                instance.SetImage();
3890

    
3891
                                //baseLayer.Add(instance);
3892
                                //instance.ApplyTemplate();
3893
                                //instance.SetImage();
3894
                                //return_control = instance;
3895
                            }
3896
                            break;
3897
                        #endregion
3898
                        #region Ink
3899
                        case "InkPresenter":
3900
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
3901
                            {
3902
#if SILVERLIGHT
3903
                                this._InkBoard.Strokes = s.SCC; 
3904
#endif
3905
                            }
3906
                            break;
3907
                        #endregion
3908
                        #region Date
3909
                        case "DateControl":
3910
                            {
3911
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
3912
                                {
3913
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3914
                                    DateControl instance = new DateControl
3915
                                    {
3916
                                        Angle = s.Angle,
3917
                                        StartPoint = s.StartPoint,
3918
                                        EndPoint = s.EndPoint,
3919
                                        LeftBottomPoint = s.LB,
3920
                                        TopRightPoint = s.TR,
3921
                                        Opacity = s.Opac,
3922
                                        FontColor = _SetColor,
3923
                                        LineSize = Convert.ToDouble(data2.First()),
3924
                                        Text = s.Text,
3925
                                        PointSet = s.PointSet,
3926
                                        UserID = s.UserID
3927
                                    };
3928
                                    instance.Memo = s.Memo;
3929
                                    instance.MarkupInfoID = markupInfoID;
3930
                                    //Layer.Children.Add(instance);
3931
                                    baseLayer.Add(instance);
3932
                                    instance.ApplyTemplate();
3933
                                    instance.SetDate();
3934
                                }
3935
                            }
3936
                            break;
3937
                        #endregion
3938
                        #region Symbol
3939
                        //                        case "SymControl":
3940
                        //                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
3941
                        //                            {
3942
                        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3943
                        //                                StringToPathConverter sm = new StringToPathConverter();
3944
                        //                                SymControl instance = new SymControl()
3945
                        //                                {
3946
                        //                                    LineSize = Convert.ToDouble(data2.First()),
3947
                        //                                    PointSet = s.PointSet,
3948
                        //                                    Paint = s.PaintState,
3949
                        //                                    StartPoint = s.StartPoint,
3950
                        //                                    StrokeColor = _SetColor,
3951
                        //                                    EndPoint = s.EndPoint,
3952
                        //                                    Angle = s.Angle,
3953
                        //                                    LeftBottomPoint = s.LB,
3954
                        //                                    TopRightPoint = s.TR,
3955
                        //                                    PathData = sm.Convert(s.PathInfo.ToString()),
3956
                        //                                    Opacity = s.Opac,
3957
                        //                                };
3958
                        //                                //if (ToolTipService.GetToolTip(instance).ToString() == "")
3959
                        //                                //{
3960
                        //#if SILVERLIGHT
3961
                        //                                ToolTipService.SetToolTip(instance, UserNumber);
3962
                        //#endif
3963
                        //                                //} //조장원
3964
                        //                                Layer.Children.Add(instance);
3965
                        //                                instance.ApplyTemplate();
3966
                        //                                instance.SetSymPath();
3967
                        //                            }
3968
                        //                            break;
3969
                        #endregion
3970
                        #region Image
3971
                        case "ImgControl":
3972
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
3973
                            {
3974
                                Image img = new Image();
3975
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
3976

    
3977
                                ImgControl instance = new ImgControl
3978
                                {
3979
                                    Angle = s.Angle,
3980
                                    StartPoint = s.StartPoint,
3981
                                    TopRightPoint = s.TR,
3982
                                    EndPoint = s.EndPoint,
3983
                                    LeftBottomPoint = s.LB,
3984
                                    PointSet = s.PointSet,
3985
                                    Opacity = s.Opac,
3986
                                    FilePath = s.ImagePath,
3987
                                    UserID = s.UserID,
3988
                                    ImageData = img.Source
3989
                                };
3990
                                //Layer.Children.Add(instance);
3991
                                instance.Memo = s.Memo;
3992
                                baseLayer.Add(instance);
3993
                                instance.MarkupInfoID = markupInfoID;
3994
                                instance.ApplyTemplate();
3995
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3996
                                instance.SetImage();
3997

    
3998
                            }
3999
                            break;
4000
                        #endregion
4001
                        #region SymbolN
4002
                        case "SymControlN":
4003
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
4004
                            {
4005
                                SymControlN instance = new SymControlN()
4006
                                {
4007
                                    PointSet = s.PointSet,
4008
                                    StartPoint = s.StartPoint,
4009
                                    EndPoint = s.EndPoint,
4010
                                    Angle = s.Angle,
4011
                                    LeftBottomPoint = s.LB,
4012
                                    TopRightPoint = s.TR,
4013
                                    Opacity = s.Opac,
4014
                                    PathXathData = s.DBData,
4015
                                };
4016
                                instance.Memo = s.Memo;
4017
                                instance.MarkupInfoID = markupInfoID;
4018
                                baseLayer.Add(instance);                                
4019
                                instance.ApplyTemplate();
4020

    
4021
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData);
4022
                                xamlData = xamlData.Replace("daelim", "DAELIM");
4023
                                xamlData = xamlData.Replace("#FFFF0000", DisplayColor);
4024
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
4025
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
4026
                                writer.Write(xamlData);
4027
                                writer.Flush();
4028
                                stream.Position = 0;
4029

    
4030
                                object obj = XamlReader.Load(stream);
4031
                                instance.Base_ViewBox.Child = obj as UIElement;
4032
                                instance.SetViewBox();
4033
                            }
4034
                            break;
4035
                        #endregion
4036
                        default:
4037
                            break;
4038
                    };
4039
                }
4040
            }
4041
        }
4042

    
4043

    
4044
        /// <summary>
4045
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
4046
        /// </summary>
4047
        /// <param name="MarkupString"></param>
4048
        public void markupParseEx(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId)
4049
        {
4050
            if (MarkupString != "False")
4051
            {
4052
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
4053
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
4054
                string[] delimiterChars = { "|DZ|" };
4055
                string[] delimiterChars2 = { "|" };
4056
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
4057
                List<string> dataSet = new List<string>();
4058

    
4059
                foreach (var dataPease in data)
4060
                {
4061
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
4062
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
4063
                    switch (unkownControl.Name)
4064
                    {
4065
                        #region ArrowText
4066
                        case "ArrowTextControl":
4067
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
4068
                            {
4069
                                ////string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4070
                                //ArrowTextControl instance = new ArrowTextControl();
4071
                                //instance.MarkupInfoID = markupInfoID;
4072
                                ////Layer.Children.Add(instance);
4073
                                //baseLayer.Add(instance);
4074
                                ////instance.LineSize = Convert.ToDouble(data2.First());
4075
                                //instance.PointSet = s.PointSet;
4076
                                //instance.StartPoint = s.StartPoint;
4077
                                //instance.EndPoint = s.EndPoint;
4078
                                //instance.StrokeColor = new SolidColorBrush(Colors.Red);
4079
                                ////instance.DashSize = s.DashSize;
4080
                                //instance.ArrowTextStyle = s.ArrowStyle;
4081
                                //instance.isHighLight = s.isHighLight;
4082
                                //instance.ArrowText = s.ArrowText;
4083
                                //instance.Opacity = s.Opac;
4084
                                //instance.BorderSize = s.BorderSize;
4085
                                //instance.BoxWidth = s.BoxWidth;
4086
                                //instance.BoxHeight = s.BoxHeight;
4087
                                //instance.isFixed = s.isFixed;
4088
                                //instance.Angle = s.Angle;
4089
                                //instance.UserID = s.UserID;
4090
                                //instance.StrokeColor = _SetColor;
4091
                                //instance.isTrans = s.isTrans;
4092
                                //instance.MidPoint = s.MidPoint;
4093
                                //instance.Memo = s.Memo;
4094
                                //if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
4095
                                //{
4096
                                //    s.fontConfig = new List<string>();
4097

    
4098
                                //    s.fontConfig.Add("Arial");
4099
                                //    s.fontConfig.Add("Normal");
4100
                                //    s.fontConfig.Add("Normal");
4101
                                //    s.fontConfig.Add("30");
4102
                                //}
4103
                                //instance.TextFamily = new FontFamily(s.fontConfig[0]);
4104
                                ////instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
4105
                                ////instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
4106
                                //instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
4107
                                //instance.ApplyTemplate();
4108
                                //instance.SetArrowTextPath();
4109
                                //instance.CommentID = commentId;
4110
                                ////instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
4111

    
4112

    
4113
                                #region 신규
4114
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4115
                                ArrowTextControl instance = new ArrowTextControl();
4116
                                instance.MarkupInfoID = markupInfoID;
4117
                                //Layer.Children.Add(instance);
4118
                                baseLayer.Add(instance);
4119
                                instance.ApplyTemplate();
4120
                                //instance.LineSize = Convert.ToDouble(data2.First());
4121
                                instance.PointSet = s.PointSet;
4122
                                instance.StartPoint = s.StartPoint;
4123
                                instance.EndPoint = s.EndPoint;
4124
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
4125
                                //instance.DashSize = s.DashSize;
4126
                                instance.ArrowTextStyle = s.ArrowStyle;
4127
                                instance.isHighLight = s.isHighLight;
4128
                                instance.ArrowText = s.ArrowText;
4129
                                instance.Opacity = s.Opac;
4130
                                instance.BorderSize = s.BorderSize;
4131
                                instance.BoxWidth = s.BoxWidth;
4132
                                instance.BoxHeight = s.BoxHeight;
4133
                                instance.isFixed = s.isFixed;
4134
                                instance.Angle = s.Angle;
4135
                                instance.UserID = s.UserID;
4136
                                instance.StrokeColor = _SetColor;
4137
                                instance.isTrans = s.isTrans;
4138
                                instance.MidPoint = s.MidPoint;
4139
                                instance.Memo = s.Memo;
4140
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
4141
                                {
4142
                                    s.fontConfig = new List<string>();
4143

    
4144
                                    s.fontConfig.Add("Arial");
4145
                                    s.fontConfig.Add("Normal");
4146
                                    s.fontConfig.Add("Normal");
4147
                                    s.fontConfig.Add("30");
4148
                                }
4149

    
4150
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
4151
                                //인구 추가(2018.04.17)
4152
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
4153
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
4154
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
4155

    
4156
                                if (s.fontConfig.Count() == 5)
4157
                                {
4158
                                    instance.UnderLine = TextDecorations.Underline;
4159
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
4160
                                }
4161

    
4162
                                instance.SetArrowTextPath();
4163
                                instance.Base_TextBox.IsHitTestVisible = false;
4164
                                instance.CommentID = commentId;
4165
                                #endregion
4166

    
4167

    
4168
                            };
4169
                            break;
4170
                        #endregion
4171
                        #region Arrow_Multi
4172
                        case "ArrowControl_Multi":
4173
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
4174
                            {
4175
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4176
                                ArrowControl_Multi instance = new ArrowControl_Multi
4177
                                {
4178
                                    LineSize = Convert.ToDouble(data2.First()),
4179
                                    StartPoint = s.StartPoint,
4180
                                    MiddlePoint = s.MidPoint,
4181
                                    DashSize = s.DashSize,
4182
                                    EndPoint = s.EndPoint,
4183
                                    PointSet = s.PointSet,
4184
                                    Opacity = s.Opac,
4185
                                    StrokeColor = _SetColor,
4186
                                    UserID = s.UserID
4187
                                };
4188

    
4189
                                //Layer.Children.Add(instance);
4190
                                instance.MarkupInfoID = markupInfoID;
4191
                                baseLayer.Add(instance);
4192
                                instance.ApplyTemplate();
4193
                                instance.SetArrowMultiPath();
4194
                                instance.Memo = s.Memo;
4195
                                instance.CommentID = commentId;
4196
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
4197

    
4198
                            }
4199
                            break;
4200
                        #endregion
4201
                        #region Rectangle
4202
                        case "RectangleControl":
4203
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
4204
                            {
4205
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4206
                                RectangleControl instance = new RectangleControl
4207
                                {
4208
                                    LineSize = Convert.ToDouble(data2.First()),
4209
                                    Paint = s.PaintState,
4210
                                    StartPoint = s.StartPoint,
4211
                                    EndPoint = s.EndPoint,
4212
                                    Angle = s.Angle,
4213
                                    StrokeColor = _SetColor,
4214
                                    DashSize = s.DashSize,
4215
                                    Opacity = s.Opac,
4216
                                    LeftBottomPoint = s.LB,
4217
                                    TopRightPoint = s.TR,
4218
                                    PointSet = s.PointSet,
4219
                                    UserID = s.UserID
4220
                                };
4221

    
4222
                                instance.Memo = s.Memo;
4223
                                //Layer.Children.Add(instance);
4224
                                instance.CommentID = commentId;
4225
                                instance.MarkupInfoID = markupInfoID;
4226
                                baseLayer.Add(instance);
4227
                                instance.ApplyTemplate();
4228
                                instance.SetRectPath();
4229
                            }
4230
                            break;
4231
                        #endregion
4232
                        #region Triangle
4233
                        case "TriControl":
4234
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
4235
                            {
4236
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4237
                                TriControl instance = new TriControl
4238
                                {
4239
                                    LineSize = Convert.ToDouble(data2.First()),
4240
                                    MidPoint = s.MidPoint,
4241
                                    StartPoint = s.StartPoint,
4242
                                    Paint = s.Paint,
4243
                                    EndPoint = s.EndPoint,
4244
                                    Opacity = s.Opac,
4245
                                    Angle = s.Angle,
4246
                                    DashSize = s.DashSize,
4247
                                    PointSet = s.PointSet,
4248
                                    StrokeColor = _SetColor,
4249
                                    UserID = s.UserID,
4250
                                };
4251
                                instance.Memo = s.Memo;
4252
                                //Layer.Children.Add(instance);
4253
                                instance.CommentID = commentId;
4254
                                instance.MarkupInfoID = markupInfoID;
4255
                                baseLayer.Add(instance);
4256
                                instance.ApplyTemplate();
4257
                                instance.SetTri();
4258
                            }
4259
                            break;
4260
                        #endregion
4261
                        #region Cicle
4262
                        case "CircleControl":
4263
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
4264
                            {
4265
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4266
                                CircleControl instance = new CircleControl
4267
                                {
4268
                                    LineSize = Convert.ToDouble(data2.First()),
4269
                                    Paint = s.PaintState,
4270
                                    StartPoint = s.StartPoint,
4271
                                    EndPoint = s.EndPoint,
4272
                                    LeftBottomPoint = s.LBP,
4273
                                    TopRightPoint = s.TRP,
4274
                                    Opacity = s.Opac,
4275
                                    Angle = s.Angle,
4276
                                    DashSize = s.DashSize,
4277
                                    PointSet = s.PointSet,
4278
                                    StrokeColor = _SetColor,
4279
                                    UserID = s.UserID,
4280
                                };
4281
                                instance.Memo = s.Memo;
4282
                                //Layer.Children.Add(instance);
4283
                                instance.CommentID = commentId;
4284
                                instance.MarkupInfoID = markupInfoID;
4285
                                baseLayer.Add(instance);
4286
                                instance.ApplyTemplate();
4287
                                instance.SetCircle();
4288
                            }
4289
                            break;
4290
                        #endregion
4291
                        #region Poly
4292
                        case "PolygonControl":
4293
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4294
                            {
4295
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4296
                                PolygonControl instance = new PolygonControl
4297
                                {
4298
                                    LineSize = Convert.ToDouble(data2.First()),
4299
                                    //Toler = s.Toler,
4300
                                    IsCompleted = s.IsCompleted,
4301
                                    //PointSet = new List<Point>(),
4302
                                    Opacity = s.Opac,
4303
                                    StrokeColor = _SetColor,
4304
                                    StartPoint = s.StartPoint,
4305
                                    PointSet = s.PointSet,
4306
                                    EndPoint = s.EndPoint,
4307
                                    UserID = s.UserID,
4308
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4309
                                    ControlType = s.Type,
4310
                                    DashSize = s.DashSize,
4311
                                    Paint = s.PaintState,
4312
                                    //PointC = s.PointC,
4313
                                };
4314
                                //Layer.Children.Add(instance);
4315
                                instance.MarkupInfoID = markupInfoID;
4316
                                baseLayer.Add(instance);
4317
                                instance.CommentID = commentId;
4318
                                instance.Memo = s.Memo;
4319
                                instance.ApplyTemplate();
4320
                                instance.SetPolyPath();
4321

    
4322
                                //instance.PointSet = s.PointSet;
4323
                                //instance.ClosePath();
4324
                                //instance.ChangePaint(s.PaintState);
4325
                            }
4326
                            break;
4327
                        #endregion
4328
                        #region InkControl
4329
                        case "InkControl":
4330
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4331
                            {
4332
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4333
                                InkControl instance = new InkControl
4334
                                {
4335
                                    LineSize = Convert.ToDouble(data2.First()),
4336
                                    //Toler = s.Toler,
4337
                                    IsCompleted = s.IsCompleted,
4338
                                    //PointSet = new List<Point>(),
4339
                                    Opacity = s.Opac,
4340
                                    StrokeColor = _SetColor,
4341
                                    StartPoint = s.StartPoint,
4342
                                    PointSet = s.PointSet,
4343
                                    UserID = s.UserID,
4344
                                    EndPoint = s.EndPoint,
4345
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4346
                                    ControlType = s.Type,
4347
                                    DashSize = s.DashSize,
4348
                                    Paint = s.PaintState,
4349
                                    //PointC = s.PointC,
4350
                                };
4351
                                //Layer.Children.Add(instance);
4352
                                instance.MarkupInfoID = markupInfoID;
4353
                                baseLayer.Add(instance);
4354
                                instance.CommentID = commentId;
4355
                                instance.Memo = s.Memo;
4356
                                instance.ApplyTemplate();
4357
                                instance.SetPolyPath();
4358

    
4359
                                //instance.PointSet = s.PointSet;
4360
                                //instance.ClosePath();
4361
                                //instance.ChangePaint(s.PaintState);
4362
                            }
4363
                            break;
4364
                        #endregion
4365
                        #region Cloud
4366
                        case "CloudControl":
4367
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
4368
                            {
4369
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4370
                                CloudControl instance = new CloudControl
4371
                                {
4372
                                    LineSize = Convert.ToDouble(data2.First()),
4373
                                    Toler = s.Toler,
4374
                                    PointSet = new List<Point>(),
4375
                                    ArcLength = s.ArcLength,
4376
                                    Paint = s.PaintState,
4377
                                    Opacity = s.Opac,
4378
                                    StrokeColor = _SetColor,
4379
                                    isTransOn = s.IsTrans,
4380
                                    isChain = s.IsChain,
4381
                                    DashSize = s.DashSize,
4382
                                    UserID = s.UserID,
4383
                                    StartPoint = s.StartPoint,
4384
                                    EndPoint = s.EndPoint,
4385
                                    //Fill = s.CloudFill,
4386
                                };
4387
                                instance.Memo = s.Memo;
4388
                                //Layer.Children.Add(instance);
4389
                                instance.MarkupInfoID = markupInfoID;
4390
                                baseLayer.Add(instance);
4391
                                instance.CommentID = commentId;
4392
                                instance.PointSet = s.PointSet;
4393
                                instance.ApplyTemplate();
4394
                                instance.ClosePath();
4395
                                instance.ChangePaint(s.PaintState);
4396
                            }
4397
                            break;
4398
                        #endregion
4399
                        #region Line
4400
                        case "LineControl":
4401
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
4402
                            {
4403
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4404
                                LineControl instance = new LineControl()
4405
                                {
4406
                                    LineStyleSet = s.LineStyleSet,
4407
                                    StartPoint = s.StartPoint,
4408
                                    DimSize = s.DimSize,
4409
                                    EndPoint = s.EndPoint,
4410
                                    DashSize = s.DashSize,
4411
                                    Interval = s.Interval,
4412
                                    PointSet = s.PointSet,
4413
                                    Opacity = s.Opac,
4414
                                    StrokeColor = _SetColor,
4415
                                    UserID = s.UserID,
4416
                                    LineSize = Convert.ToDouble(data2.First()),
4417
                                };
4418
                                instance.Memo = s.Memo;
4419
                                //Layer.Children.Add(instance);
4420
                                instance.CommentID = commentId;
4421
                                instance.MarkupInfoID = markupInfoID;
4422
                                baseLayer.Add(instance);
4423
                                instance.ApplyTemplate();
4424
                                instance.SetLinePath();
4425
                            }
4426
                            break;
4427
                        #endregion
4428
                        #region Text
4429
                        case "TextControl":
4430
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
4431
                            {
4432
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4433
                                TextControl instance = new TextControl()
4434
                                {
4435
                                    Text = s.Text,
4436
                                    StartPoint = s.StartPoint,
4437
                                    EndPoint = s.EndPoint,
4438
                                    CanvasX = s.StartPoint.X,
4439
                                    CanvasY = s.StartPoint.Y,
4440
                                    BoxWidth = s.BoxW,
4441
                                    BoxHeight = s.BoxH,
4442
                                    ControlType_No = s.paintMethod,
4443
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
4444
                                    TextSize = Convert.ToDouble(data2[1]),
4445
                                    FontColor = _SetColor,
4446
                                    //FontSize = 10,
4447
                                    UserID = s.UserID,
4448
                                    //isHighLight = s.isHighLight,
4449
                                    Angle = s.Angle,
4450
                                    PointSet = s.PointSet,
4451
                                    Opacity = s.Opac,
4452
                                    TextFamily = new FontFamily(s.fontConfig[0]),
4453
                                    //인구 추가(2018.04.17)
4454
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
4455
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
4456
                                };
4457

    
4458
                                if (instance.Text != null)
4459
                                {
4460
                                    //Layer.Children.Add(instance);
4461
                                    instance.MarkupInfoID = markupInfoID;
4462
                                    baseLayer.Add(instance);
4463
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
4464
                                    instance.ApplyTemplate();
4465
                                    instance.Memo = s.Memo;
4466
                                    if (s.fontConfig.Count() == 4)
4467
                                    {
4468
                                        instance.UnderLine = TextDecorations.Underline;
4469
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
4470
                                    }
4471
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
4472

    
4473
                                    //instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
4474

    
4475
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
4476
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
4477

    
4478
                                    instance.CommentID = commentId;
4479
                                    instance.DrawingCloud();
4480
                                    instance.SetText();
4481
                                }
4482
                            }
4483
                            break;
4484
                        #endregion
4485
                        #region Arc
4486
                        case "ArcControl":
4487
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
4488
                            {
4489
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4490
                                ArcControl instance = new ArcControl()
4491
                                {
4492
                                    StartPoint = s.StartPoint,
4493
                                    EndPoint = s.EndPoint,
4494
                                    DashSize = s.DashSize,
4495
                                    PointSet = s.PointSet,
4496
                                    isTransOn = s.IsTransOn,
4497
                                    MidPoint = s.MidPoint,
4498
                                    StrokeColor = _SetColor,
4499
                                    Clock = s.Clock,
4500
                                    Opacity = s.Opac,
4501
                                    LineSize = Convert.ToDouble(data2.First()),
4502
                                    UserID = s.UserID,
4503
                                };
4504
                                instance.Memo = s.Memo;
4505
                                //Layer.Children.Add(instance);
4506
                                instance.MarkupInfoID = markupInfoID;
4507
                                baseLayer.Add(instance);
4508
                                instance.CommentID = commentId;
4509
                                instance.ApplyTemplate();
4510
                                instance.SetArcPath();
4511
                            }
4512
                            break;
4513
                        #endregion
4514
                        #region RectCloud
4515
                        case "RectCloudControl":
4516
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
4517
                            {
4518
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4519
                                RectCloudControl instance = new RectCloudControl()
4520
                                {
4521
                                    StartPoint = s.StartPoint,
4522
                                    EndPoint = s.EndPoint,
4523
                                    LeftBottomPoint = s.LB,
4524
                                    Paint = s.PaintState,
4525
                                    Opacity = s.Opac,
4526
                                    DashSize = s.DashSize,
4527
                                    TopRightPoint = s.TR,
4528
                                    PointSet = s.PointSet,
4529
                                    StrokeColor = _SetColor,
4530
                                    LineSize = Convert.ToDouble(data2.First()),
4531
                                    UserID = s.UserID,
4532
                                    ArcLength = s.ArcLength
4533
                                };
4534
                                instance.Memo = s.Memo;
4535
                                //Layer.Children.Add(instance);
4536
                                instance.MarkupInfoID = markupInfoID;
4537
                                baseLayer.Add(instance);
4538
                                instance.CommentID = commentId;
4539
                                instance.ApplyTemplate();
4540
                                instance.SetRectCloud();
4541
                            }
4542
                            break;
4543
                        #endregion
4544
                        #region Sign
4545
                        case "SignControl":
4546
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
4547
                            {
4548
                                SignControl instance = new SignControl
4549
                                {
4550
                                    Angle = s.Angle,
4551
                                    StartPoint = s.StartPoint,
4552
                                    TopRightPoint = s.TR,
4553
                                    EndPoint = s.EndPoint,
4554
                                    LeftBottomPoint = s.LB,
4555
                                    PointSet = s.PointSet,
4556
                                    Opacity = s.Opac,
4557
                                    SignImage = null,
4558
                                    UserID = s.UserID,
4559
                                };
4560
                                instance.ApplyTemplate();
4561
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4562

    
4563
                                if (s.UserNumber != null)
4564
                                {
4565
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
4566
                                    if (_sign != null)
4567
                                    {
4568
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
4569

    
4570
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
4571
                                        stream.Write(imageBytes, 0, imageBytes.Length);
4572
                                        stream.Position = 0;
4573
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
4574
                                        BitmapImage returnImage = new BitmapImage();
4575
                                        returnImage.BeginInit();
4576
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
4577
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
4578
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
4579
                                        returnImage.StreamSource = ms;
4580
                                        returnImage.EndInit();
4581
                                        stream.Close();
4582
                                        instance.SignImage = returnImage;
4583
                                    }
4584
                                }
4585

    
4586
                                instance.MarkupInfoID = markupInfoID;
4587
                                instance.CommentID = commentId;
4588
                                baseLayer.Add(instance);
4589
                                instance.ApplyTemplate();
4590
                                instance.SetImage();
4591
                            }
4592
                            break;
4593
                        #endregion
4594
                        #region Ink
4595
                        case "InkPresenter":
4596
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
4597
                            {
4598
#if SILVERLIGHT
4599
                                this._InkBoard.Strokes = s.SCC; 
4600
#endif
4601
                            }
4602
                            break;
4603
                        #endregion
4604
                        #region Date
4605
                        case "DateControl":
4606
                            {
4607
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
4608
                                {
4609
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4610
                                    DateControl instance = new DateControl
4611
                                    {
4612
                                        Angle = s.Angle,
4613
                                        StartPoint = s.StartPoint,
4614
                                        EndPoint = s.EndPoint,
4615
                                        LeftBottomPoint = s.LB,
4616
                                        TopRightPoint = s.TR,
4617
                                        Opacity = s.Opac,
4618
                                        FontColor = _SetColor,
4619
                                        LineSize = Convert.ToDouble(data2.First()),
4620
                                        Text = s.Text,
4621
                                        PointSet = s.PointSet,
4622
                                        UserID = s.UserID
4623
                                    };
4624
                                    instance.Memo = s.Memo;
4625
                                    //Layer.Children.Add(instance);
4626
                                    baseLayer.Add(instance);
4627
                                    instance.CommentID = commentId;
4628
                                    instance.ApplyTemplate();
4629
                                    instance.SetDate();
4630
                                }
4631
                            }
4632
                            break;
4633
                        #endregion
4634
                        #region Symbol
4635
                        case "SymControl":
4636
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
4637
                            {
4638
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4639
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
4640
                                SymControl instance = new SymControl()
4641
                                {
4642
                                    LineSize = Convert.ToDouble(data2.First()),
4643
                                    PointSet = s.PointSet,
4644
                                    Paint = s.PaintState,
4645
                                    StartPoint = s.StartPoint,
4646
                                    StrokeColor = _SetColor,
4647
                                    EndPoint = s.EndPoint,
4648
                                    Angle = s.Angle,
4649
                                    LeftBottomPoint = s.LB,
4650
                                    TopRightPoint = s.TR,
4651
                                    PathData = sm.Convert(s.PathInfo.ToString()),
4652
                                    Opacity = s.Opac,
4653
                                };
4654

    
4655
                                instance.Memo = s.Memo;
4656
                                baseLayer.Add(instance);
4657
                                instance.CommentID = commentId;
4658
                                instance.ApplyTemplate();
4659
                                instance.SetSymPath();
4660
                            }
4661
                            break;
4662
                        #endregion
4663
                        #region Image
4664
                        case "ImgControl":
4665
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
4666
                            {
4667
                                Image img = new Image();
4668
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
4669

    
4670
                                ImgControl instance = new ImgControl
4671
                                {
4672
                                    Angle = s.Angle,
4673
                                    StartPoint = s.StartPoint,
4674
                                    TopRightPoint = s.TR,
4675
                                    EndPoint = s.EndPoint,
4676
                                    LeftBottomPoint = s.LB,
4677
                                    PointSet = s.PointSet,
4678
                                    Opacity = s.Opac,
4679
                                    FilePath = s.ImagePath,
4680
                                    UserID = s.UserID,
4681
                                    ImageData = img.Source
4682
                                };
4683
                                //Layer.Children.Add(instance);
4684
                                instance.Memo = s.Memo;
4685
                                baseLayer.Add(instance);
4686
                                instance.CommentID = commentId;
4687
                                instance.ApplyTemplate();
4688
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4689
                                instance.SetImage();
4690

    
4691
                            }
4692
                            break;
4693
                        #endregion
4694
                        #region SymbolN
4695
                        case "SymControlN":
4696
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
4697
                            {
4698
                                SymControlN instance = new SymControlN()
4699
                                {
4700
                                    PointSet = s.PointSet,
4701
                                    StartPoint = s.StartPoint,
4702
                                    EndPoint = s.EndPoint,
4703
                                    Angle = s.Angle,
4704
                                    LeftBottomPoint = s.LB,
4705
                                    TopRightPoint = s.TR,
4706
                                    Opacity = s.Opac,
4707
                                    PathXathData = s.DBData,
4708
                                };
4709
                                instance.Memo = s.Memo;
4710
                                instance.MarkupInfoID = markupInfoID;
4711
                                baseLayer.Add(instance);
4712
                                instance.CommentID = commentId;
4713
                                instance.ApplyTemplate();
4714

    
4715
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData);
4716
                                xamlData = xamlData.Replace("daelim", "DAELIM");
4717
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
4718
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
4719
                                writer.Write(xamlData);
4720
                                writer.Flush();
4721
                                stream.Position = 0;
4722

    
4723
                                object obj = XamlReader.Load(stream);
4724
                                instance.Base_ViewBox.Child = obj as UIElement;                                
4725
                                instance.SetViewBox();
4726
                            }
4727
                            break;
4728
                        #endregion
4729
                        default:
4730

    
4731
                            break;
4732
                    };
4733
                }
4734
            }
4735
        }
4736

    
4737
        //강인구 추가(12/12)
4738
        public Control markupParse_Paste(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer)
4739
        {
4740
            //GetUserSign getUser = new GetUserSign();
4741
            Control return_control = new Control();
4742
            if (MarkupString != "False")
4743
            {
4744
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(""));
4745
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
4746
                string[] delimiterChars = { "|DZ|" };
4747
                string[] delimiterChars2 = { "|" };
4748
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
4749
                List<string> dataSet = new List<string>();
4750

    
4751
                foreach (var dataPease in data)
4752
                {
4753
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
4754
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
4755
                    switch (unkownControl.Name)
4756
                    {
4757
                        #region Shape
4758
                        #region Rectangle
4759
                        case "RectangleControl":
4760
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
4761
                            {
4762
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4763
                                RectangleControl instance = new RectangleControl
4764
                                {
4765
                                    LineSize = Convert.ToDouble(data2.First()),
4766
                                    Paint = s.PaintState,
4767
                                    StartPoint = s.StartPoint,
4768
                                    EndPoint = s.EndPoint,
4769
                                    Angle = s.Angle,
4770
                                    StrokeColor = _SetColor,
4771
                                    DashSize = s.DashSize,
4772
                                    Opacity = s.Opac,
4773
                                    LeftBottomPoint = s.LB,
4774
                                    TopRightPoint = s.TR,
4775
                                    PointSet = s.PointSet,
4776
                                    UserID = s.UserID
4777
                                };
4778
                                baseLayer.Add(instance);
4779
                                instance.ApplyTemplate();
4780

    
4781
                                return_control = instance;
4782
                            }
4783
                            break;
4784
                        #endregion
4785
                        #region Triangle
4786
                        case "TriControl":
4787
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
4788
                            {
4789
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4790
                                TriControl instance = new TriControl
4791
                                {
4792
                                    LineSize = Convert.ToDouble(data2.First()),
4793
                                    MidPoint = s.MidPoint,
4794
                                    StartPoint = s.StartPoint,
4795
                                    Paint = s.Paint,
4796
                                    EndPoint = s.EndPoint,
4797
                                    Opacity = s.Opac,
4798
                                    Angle = s.Angle,
4799
                                    DashSize = s.DashSize,
4800
                                    PointSet = s.PointSet,
4801
                                    StrokeColor = _SetColor,
4802

    
4803
                                    UserID = s.UserID,
4804
                                };
4805
                                baseLayer.Add(instance);
4806
                                instance.ApplyTemplate();
4807
                                return_control = instance;
4808
                            }
4809
                            break;
4810
                        #endregion
4811
                        #region Cicle
4812
                        case "CircleControl":
4813
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
4814
                            {
4815
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4816
                                CircleControl instance = new CircleControl
4817
                                {
4818
                                    LineSize = Convert.ToDouble(data2.First()),
4819
                                    Paint = s.PaintState,
4820
                                    StartPoint = s.StartPoint,
4821
                                    EndPoint = s.EndPoint,
4822
                                    LeftBottomPoint = s.LBP,
4823
                                    TopRightPoint = s.TRP,
4824
                                    Opacity = s.Opac,
4825
                                    Angle = s.Angle,
4826
                                    DashSize = s.DashSize,
4827
                                    PointSet = s.PointSet,
4828
                                    StrokeColor = _SetColor,
4829
                                    UserID = s.UserID,
4830
                                };
4831
                                baseLayer.Add(instance);
4832
                                instance.ApplyTemplate();
4833
                                return_control = instance;
4834
                            }
4835
                            break;
4836
                        #endregion
4837
                        #region RectCloud
4838
                        case "RectCloudControl":
4839
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
4840
                            {
4841
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4842
                                RectCloudControl instance = new RectCloudControl()
4843
                                {
4844
                                    StartPoint = s.StartPoint,
4845
                                    EndPoint = s.EndPoint,
4846
                                    LeftBottomPoint = s.LB,
4847
                                    Paint = s.PaintState,
4848
                                    Opacity = s.Opac,
4849
                                    DashSize = s.DashSize,
4850
                                    TopRightPoint = s.TR,
4851
                                    PointSet = s.PointSet,
4852
                                    StrokeColor = _SetColor,
4853
                                    ArcLength = s.ArcLength,
4854
                                    LineSize = Convert.ToDouble(data2.First()),
4855
                                    UserID = s.UserID
4856
                                };
4857
                                baseLayer.Add(instance);
4858
                                instance.ApplyTemplate();
4859
                                return_control = instance;
4860
                            }
4861
                            break;
4862
                        #endregion
4863
                        #endregion
4864

    
4865
                        #region Polygon
4866
                        #region Poly
4867
                        case "PolygonControl":
4868
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4869
                            {
4870
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4871
                                PolygonControl instance = new PolygonControl
4872
                                {
4873
                                    LineSize = Convert.ToDouble(data2.First()),
4874
                                    //Toler = s.Toler,
4875
                                    IsCompleted = s.IsCompleted,
4876
                                    //PointSet = new List<Point>(),
4877
                                    Opacity = s.Opac,
4878
                                    StrokeColor = _SetColor,
4879
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4880
                                    ControlType = s.Type,
4881
                                    DashSize = s.DashSize,
4882
                                    StartPoint = s.StartPoint,
4883
                                    EndPoint = s.EndPoint,
4884
                                    PointSet = s.PointSet,
4885
                                    UserID = s.UserID,
4886
                                    Paint = s.PaintState,
4887
                                    //PointC = s.PointC,
4888
                                };
4889
                                baseLayer.Add(instance);
4890
                                instance.ApplyTemplate();
4891
                                return_control = instance;
4892
                            }
4893
                            break;
4894
                        #endregion
4895
                        #region InkControl
4896
                        case "InkControl":
4897
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4898
                            {
4899
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4900
                                InkControl instance = new InkControl
4901
                                {
4902
                                    LineSize = Convert.ToDouble(data2.First()),
4903
                                    //Toler = s.Toler,
4904
                                    IsCompleted = s.IsCompleted,
4905
                                    //PointSet = new List<Point>(),
4906
                                    Opacity = s.Opac,
4907
                                    StrokeColor = _SetColor,
4908
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4909
                                    ControlType = s.Type,
4910
                                    DashSize = s.DashSize,
4911
                                    StartPoint = s.StartPoint,
4912
                                    PointSet = s.PointSet,
4913
                                    UserID = s.UserID,
4914
                                    Paint = s.PaintState,
4915
                                    EndPoint = s.EndPoint,
4916
                                    //PointC = s.PointC,
4917
                                };
4918
                                baseLayer.Add(instance);
4919
                                instance.ApplyTemplate();
4920
                                return_control = instance;
4921
                            }
4922
                            break;
4923
                        #endregion
4924
                        #region Cloud
4925
                        case "CloudControl":
4926
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
4927
                            {
4928
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4929
                                CloudControl instance = new CloudControl
4930
                                {
4931
                                    LineSize = Convert.ToDouble(data2.First()),
4932
                                    Toler = s.Toler,
4933
                                    PointSet = s.PointSet,
4934
                                    ArcLength = s.ArcLength,
4935
                                    Paint = s.PaintState,
4936
                                    Opacity = s.Opac,
4937
                                    StrokeColor = _SetColor,
4938

    
4939
                                    isTransOn = s.IsTrans,
4940
                                    isChain = s.IsChain,
4941
                                    DashSize = s.DashSize,
4942
                                    UserID = s.UserID,
4943

    
4944
                                    StartPoint = s.StartPoint,
4945
                                    EndPoint = s.EndPoint,
4946

    
4947
                                    //Fill = s.CloudFill,
4948
                                };
4949
                                //instance.PointSet = s.PointSet;
4950
                                //instance.ClosePath();
4951
                                //instance.ChangePaint(s.PaintState);
4952
                                baseLayer.Add(instance);
4953
                                instance.ApplyTemplate();
4954
                                instance.SetCloud();
4955
                                //instance.ClosePath();
4956
                                //instance.ChangePaint(s.PaintState);
4957
                                return_control = instance;
4958
                            }
4959
                            break;
4960
                        #endregion
4961
                        #endregion
4962

    
4963
                        #region Line
4964
                        #region Line
4965
                        case "LineControl":
4966
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
4967
                            {
4968
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4969
                                LineControl instance = new LineControl()
4970
                                {
4971
                                    LineStyleSet = s.LineStyleSet,
4972
                                    StartPoint = s.StartPoint,
4973
                                    DimSize = s.DimSize,
4974
                                    EndPoint = s.EndPoint,
4975
                                    DashSize = s.DashSize,
4976
                                    Interval = s.Interval,
4977
                                    PointSet = s.PointSet,
4978
                                    Opacity = s.Opac,
4979
                                    StrokeColor = _SetColor,
4980
                                    UserID = s.UserID,
4981
                                    LineSize = Convert.ToDouble(data2.First()),
4982
                                };
4983

    
4984
                                baseLayer.Add(instance);
4985
                                instance.ApplyTemplate();
4986
                                instance.SetLinePath();
4987
                                return_control = instance;
4988
                            }
4989
                            break;
4990
                        #endregion
4991
                        #region Arrow_Multi
4992
                        case "ArrowControl_Multi":
4993
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
4994
                            {
4995
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4996
                                ArrowControl_Multi instance = new ArrowControl_Multi
4997
                                {
4998
                                    LineSize = Convert.ToDouble(data2.First()),
4999
                                    StartPoint = s.StartPoint,
5000
                                    MiddlePoint = s.MidPoint,
5001
                                    DashSize = s.DashSize,
5002
                                    EndPoint = s.EndPoint,
5003
                                    PointSet = s.PointSet,
5004
                                    Opacity = s.Opac,
5005
                                    StrokeColor = _SetColor,
5006

    
5007
                                    UserID = s.UserID
5008
                                };
5009
                                baseLayer.Add(instance);
5010
                                instance.ApplyTemplate();
5011
                                instance.SetArrowMultiPath();
5012
                                return_control = instance;
5013
                            }
5014
                            break;
5015
                        #endregion
5016
                        #region Arc
5017
                        case "ArcControl":
5018
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
5019
                            {
5020
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5021
                                ArcControl instance = new ArcControl()
5022
                                {
5023
                                    StartPoint = s.StartPoint,
5024
                                    EndPoint = s.EndPoint,
5025
                                    DashSize = s.DashSize,
5026
                                    PointSet = s.PointSet,
5027
                                    isTransOn = s.IsTransOn,
5028
                                    MidPoint = s.MidPoint,
5029
                                    StrokeColor = _SetColor,
5030
                                    Opacity = s.Opac,
5031

    
5032
                                    Clock = s.Clock,
5033
                                    LineSize = Convert.ToDouble(data2.First()),
5034
                                    UserID = s.UserID,
5035
                                };
5036
                                baseLayer.Add(instance);
5037
                                instance.ApplyTemplate();
5038
                                instance.OnApplyTemplate();
5039
                                instance.SetArcPath();
5040
                                return_control = instance;
5041
                            }
5042
                            break;
5043
                        #endregion
5044
                        #endregion
5045

    
5046
                        #region Text
5047
                        case "TextControl":
5048
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
5049
                            {
5050
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5051
                                TextControl instance = new TextControl()
5052
                                {
5053
                                    Text = s.Text,
5054
                                    StartPoint = s.StartPoint,
5055
                                    EndPoint = s.EndPoint,
5056
                                    CanvasX = s.StartPoint.X,
5057
                                    CanvasY = s.StartPoint.Y,
5058
                                    BoxWidth = s.BoxW,
5059
                                    BoxHeight = s.BoxH,
5060
                                    ControlType_No = s.paintMethod,
5061
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
5062
                                    TextSize = Convert.ToDouble(data2[1]),
5063
                                    FontColor = _SetColor,
5064
                                    FontSize = 10,
5065
                                    UserID = s.UserID,
5066
                                    //isHighLight = s.isHighLight,
5067
                                    Angle = s.Angle,
5068
                                    PointSet = s.PointSet,
5069
                                    Opacity = s.Opac,
5070
                                    TextFamily = new FontFamily(s.fontConfig[0]),
5071
                                    //인구 추가(2018.04.17)
5072
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
5073
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
5074
                                };
5075

    
5076
                                if (instance.Text != null)
5077
                                {
5078
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
5079
                                    instance.ApplyTemplate();
5080
                                    if (s.fontConfig.Count() == 4)
5081
                                    {
5082
                                        instance.UnderLine = TextDecorations.Underline;
5083
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
5084
                                    }
5085
                                }
5086
                                baseLayer.Add(instance);
5087
                                instance.ApplyTemplate();
5088

    
5089
                                instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
5090

    
5091
                                instance.Base_TextBox.Visibility = Visibility.Collapsed;
5092
                                instance.Base_TextBlock.Visibility = Visibility.Visible;
5093

    
5094
                                return_control = instance;
5095
                            }
5096
                            break;
5097
                        #endregion
5098

    
5099
                        #region ArrowText
5100
                        case "ArrowTextControl":
5101
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
5102
                            {
5103
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5104
                                ArrowTextControl instance = new ArrowTextControl();
5105
                                //instance.LineSize = Convert.ToDouble(data2.First());
5106
                                instance.PointSet = s.PointSet;
5107
                                instance.StartPoint = s.StartPoint;
5108
                                instance.EndPoint = s.EndPoint;
5109
                                instance.StrokeColor = _SetColor;
5110
                                //instance.DashSize = s.DashSize;
5111
                                instance.ArrowTextStyle = s.ArrowStyle;
5112
                                instance.isHighLight = s.isHighLight;
5113
                                instance.ArrowText = s.ArrowText;
5114
                                instance.Opacity = s.Opac;
5115
                                instance.BorderSize = s.BorderSize;
5116
                                instance.BoxWidth = s.BoxWidth;
5117
                                instance.BoxHeight = s.BoxHeight;
5118
                                instance.isFixed = s.isFixed;
5119
                                instance.Angle = s.Angle;
5120
                                instance.UserID = s.UserID;
5121
                                instance.isTrans = s.isTrans;
5122
                                instance.MidPoint = s.MidPoint;
5123
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
5124
                                {
5125
                                    s.fontConfig = new List<string>();
5126

    
5127
                                    s.fontConfig.Add("Arial");
5128
                                    s.fontConfig.Add("Normal");
5129
                                    s.fontConfig.Add("Normal");
5130
                                    s.fontConfig.Add("30");
5131
                                }
5132
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
5133
                                //인구 추가(2018.04.17)
5134
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
5135
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
5136
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
5137

    
5138
                                baseLayer.Add(instance);
5139
                                instance.ApplyTemplate();
5140

    
5141
                                if (s.fontConfig.Count() == 5)
5142
                                {
5143
                                    instance.UnderLine = TextDecorations.Underline;
5144
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
5145
                                }
5146
                                instance.SetArrowTextPath();
5147
                                return_control = instance;
5148
                            };
5149
                            break;
5150
                        #endregion
5151

    
5152
                        #region ETC
5153
                        #region Ink
5154
                        case "InkPresenter":
5155
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
5156
                            {
5157

    
5158
                            }
5159
                            break;
5160
                        #endregion
5161
                        #region Date
5162
                        case "DateControl":
5163
                            {
5164
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
5165
                                {
5166
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5167
                                    DateControl instance = new DateControl
5168
                                    {
5169
                                        Angle = s.Angle,
5170
                                        StartPoint = s.StartPoint,
5171
                                        EndPoint = s.EndPoint,
5172
                                        LeftBottomPoint = s.LB,
5173
                                        TopRightPoint = s.TR,
5174
                                        Opacity = s.Opac,
5175
                                        FontColor = _SetColor,
5176
                                        LineSize = Convert.ToDouble(data2.First()),
5177
                                        Text = s.Text,
5178
                                        PointSet = s.PointSet,
5179
                                        UserID = s.UserID
5180
                                    };
5181
                                    baseLayer.Add(instance);
5182
                                    instance.ApplyTemplate();
5183
                                    return_control = instance;
5184
                                }
5185
                            }
5186
                            break;
5187
                        #endregion
5188
                        #region Image
5189
                        case "ImgControl":
5190
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
5191
                            {
5192
                                Image img = new Image();
5193
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
5194

    
5195
                                ImgControl instance = new ImgControl
5196
                                {
5197
                                    Angle = s.Angle,
5198
                                    StartPoint = s.StartPoint,
5199
                                    TopRightPoint = s.TR,
5200
                                    EndPoint = s.EndPoint,
5201
                                    LeftBottomPoint = s.LB,
5202
                                    PointSet = s.PointSet,
5203
                                    Opacity = s.Opac,
5204
                                    FilePath = s.ImagePath,
5205
                                    UserID = s.UserID,
5206
                                    ImageData = img.Source
5207
                                };
5208

    
5209
                                instance.ApplyTemplate();
5210
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5211
                                baseLayer.Add(instance);
5212
                                instance.ApplyTemplate();
5213
                                instance.SetImage();
5214
                                return_control = instance;
5215
                            }
5216
                            break;
5217
                        #endregion
5218
                        #region Sign
5219
                        case "SignControl":
5220
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
5221
                            {
5222
                                SignControl instance = new SignControl
5223
                                {
5224
                                    Angle = s.Angle,
5225
                                    StartPoint = s.StartPoint,
5226
                                    TopRightPoint = s.TR,
5227
                                    EndPoint = s.EndPoint,
5228
                                    LeftBottomPoint = s.LB,
5229
                                    PointSet = s.PointSet,
5230
                                    Opacity = s.Opac,
5231
                                    SignImage = null,
5232
                                    UserID = s.UserID,
5233
                                };
5234
                                instance.ApplyTemplate();
5235
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5236

    
5237
                                if (s.UserNumber != null)
5238
                                {
5239
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
5240
                                    if (_sign != null)
5241
                                    {
5242
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
5243

    
5244
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
5245
                                        stream.Write(imageBytes, 0, imageBytes.Length);
5246
                                        stream.Position = 0;
5247
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
5248
                                        BitmapImage returnImage = new BitmapImage();
5249
                                        returnImage.BeginInit();
5250
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
5251
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
5252
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
5253
                                        returnImage.StreamSource = ms;
5254
                                        returnImage.EndInit();
5255
                                        stream.Close();
5256
                                        instance.SignImage = returnImage;
5257
                                    }
5258
                                }
5259

    
5260
                                baseLayer.Add(instance);
5261
                                instance.ApplyTemplate();
5262
                                instance.SetImage();
5263
                                return_control = instance;
5264
                            }
5265
                            break;
5266
                        #endregion
5267
                        #region Symbol
5268
                        case "SymControl":
5269
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
5270
                            {
5271
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5272
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
5273
                                SymControl instance = new SymControl
5274
                                {
5275
                                    //Angle = s.Angle,
5276
                                    //StartPoint = s.StartPoint,
5277
                                    //TopRightPoint = s.TR,
5278
                                    //EndPoint = s.EndPoint,
5279
                                    //LeftBottomPoint = s.LB,
5280
                                    //PointSet = s.PointSet,
5281
                                    //Opacity = s.Opac,
5282
                                    //FilePath = s.ImagePath,
5283
                                    //UserID = s.UserID,
5284
                                    //ImageData = s.ImageData
5285
                                    LineSize = Convert.ToDouble(data2.First()),
5286
                                    PointSet = s.PointSet,
5287
                                    Paint = s.PaintState,
5288
                                    StartPoint = s.StartPoint,
5289
                                    StrokeColor = _SetColor,
5290
                                    EndPoint = s.EndPoint,
5291
                                    Angle = s.Angle,
5292
                                    UserID = s.UserID,
5293
                                    LeftBottomPoint = s.LB,
5294
                                    TopRightPoint = s.TR,
5295
                                    PathData = sm.Convert(s.PathInfo.ToString()),
5296
                                    Opacity = s.Opac,
5297
                                };
5298

    
5299
                                baseLayer.Add(instance);
5300
                                //instance.OnApplyTemplate();
5301
                                instance.ApplyTemplate();
5302
                                instance.SetSymPath();
5303
                                return_control = instance;
5304
                            }
5305
                            break;
5306
                        #endregion
5307

    
5308
                        #region SymbolN
5309
                        case "SymControlN":
5310
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
5311
                            {
5312
                                SymControlN instance = new SymControlN()
5313
                                {
5314
                                    PointSet = s.PointSet,
5315
                                    StartPoint = s.StartPoint,
5316
                                    EndPoint = s.EndPoint,
5317
                                    Angle = s.Angle,
5318
                                    LeftBottomPoint = s.LB,
5319
                                    TopRightPoint = s.TR,
5320
                                    Opacity = s.Opac,
5321
                                    PathXathData = s.DBData,
5322
                                };
5323
                                instance.Memo = s.Memo;
5324
                                baseLayer.Add(instance);
5325
                                instance.ApplyTemplate();
5326

    
5327
                                return_control = instance;
5328

    
5329
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
5330
                                //instance.PathXathData = s.DBData;
5331

    
5332
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
5333
                                //xamlData = xamlData.Replace("daelim", "DAELIM");
5334
                                //System.IO.MemoryStream stream = new System.IO.MemoryStream();
5335
                                //System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
5336
                                //writer.Write(xamlData);
5337
                                //writer.Flush();
5338
                                //stream.Position = 0;
5339

    
5340
                                //object obj = XamlReader.Load(stream);
5341
                                //instance.Base_ViewBox.Child = obj as UIElement;
5342
                                //instance.PathXathData = appovalData;
5343
                                //instance.SetViewBox();
5344
                            }
5345
                            break;
5346
                        #endregion
5347
                        #endregion 
5348
                        default:
5349
                            break;
5350
                    };
5351
                }
5352
            }
5353
            return return_control;
5354
        }
5355

    
5356
        public S_BaseControl markupParse_GetBaseControl(string MarkupString)
5357
        {
5358
            var item = JsonSerializerHelper.UnCompressString(MarkupString); //언패킹작업
5359
            var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
5360
            return unknownData;
5361
        }
5362
        
5363
        //Temp
5364
        public Control TempMarkupParseEx(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId)
5365
        {
5366
            Control return_control = new Control();
5367
            if (MarkupString != "False")
5368
            {   
5369
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
5370
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
5371
                string[] delimiterChars = { "|DZ|" };
5372
                string[] delimiterChars2 = { "|" };
5373
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
5374
                List<string> dataSet = new List<string>();
5375

    
5376
                foreach (var dataPease in data)
5377
                {
5378
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
5379
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
5380
                    switch (unkownControl.Name)
5381
                    {
5382
                        #region ArrowText
5383
                        case "ArrowTextControl":
5384
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
5385
                            {
5386
                                #region 신규
5387
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5388
                                ArrowTextControl instance = new ArrowTextControl();
5389
                                instance.MarkupInfoID = markupInfoID;
5390
                                //Layer.Children.Add(instance);
5391
                                baseLayer.Add(instance);
5392
                                instance.ApplyTemplate();
5393
                                //instance.LineSize = Convert.ToDouble(data2.First());
5394
                                instance.PointSet = s.PointSet;
5395
                                instance.StartPoint = s.StartPoint;
5396
                                instance.EndPoint = s.EndPoint;
5397
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
5398
                                //instance.DashSize = s.DashSize;
5399
                                instance.ArrowTextStyle = s.ArrowStyle;
5400
                                instance.isHighLight = s.isHighLight;
5401
                                instance.ArrowText = s.ArrowText;
5402
                                instance.Opacity = s.Opac;
5403
                                instance.BorderSize = s.BorderSize;
5404
                                instance.BoxWidth = s.BoxWidth;
5405
                                instance.BoxHeight = s.BoxHeight;
5406
                                instance.isFixed = s.isFixed;
5407
                                instance.Angle = s.Angle;
5408
                                instance.UserID = s.UserID;
5409
                                instance.StrokeColor = _SetColor;
5410
                                instance.isTrans = s.isTrans;
5411
                                instance.MidPoint = s.MidPoint;
5412
                                instance.Memo = s.Memo;
5413
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
5414
                                {
5415
                                    s.fontConfig = new List<string>();
5416

    
5417
                                    s.fontConfig.Add("Arial");
5418
                                    s.fontConfig.Add("Normal");
5419
                                    s.fontConfig.Add("Normal");
5420
                                    s.fontConfig.Add("30");
5421
                                }
5422

    
5423
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
5424
                                //인구 추가(2018.04.17)
5425
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
5426
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
5427
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
5428

    
5429
                                if (s.fontConfig.Count() == 5)
5430
                                {
5431
                                    instance.UnderLine = TextDecorations.Underline;
5432
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
5433
                                }
5434

    
5435
                                instance.SetArrowTextPath();
5436
                                instance.Base_TextBox.IsHitTestVisible = false;
5437
                                instance.CommentID = commentId;
5438
                                #endregion
5439

    
5440

    
5441
                                return_control = instance;
5442

    
5443
                            };
5444
                            break;
5445
                        #endregion
5446
                        #region Arrow_Multi
5447
                        case "ArrowControl_Multi":
5448
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
5449
                            {
5450
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5451
                                ArrowControl_Multi instance = new ArrowControl_Multi
5452
                                {
5453
                                    LineSize = Convert.ToDouble(data2.First()),
5454
                                    StartPoint = s.StartPoint,
5455
                                    MiddlePoint = s.MidPoint,
5456
                                    DashSize = s.DashSize,
5457
                                    EndPoint = s.EndPoint,
5458
                                    PointSet = s.PointSet,
5459
                                    Opacity = s.Opac,
5460
                                    StrokeColor = _SetColor,
5461
                                    UserID = s.UserID
5462
                                };
5463

    
5464
                                //Layer.Children.Add(instance);
5465
                                instance.MarkupInfoID = markupInfoID;
5466
                                baseLayer.Add(instance);
5467
                                instance.ApplyTemplate();
5468
                                instance.SetArrowMultiPath();
5469
                                instance.Memo = s.Memo;
5470
                                instance.CommentID = commentId;
5471
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
5472
                                
5473
                                return_control = instance;
5474
                            }
5475
                            break;
5476
                        #endregion
5477
                        #region Rectangle
5478
                        case "RectangleControl":
5479
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
5480
                            {
5481
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5482
                                RectangleControl instance = new RectangleControl
5483
                                {
5484
                                    LineSize = Convert.ToDouble(data2.First()),
5485
                                    Paint = s.PaintState,
5486
                                    StartPoint = s.StartPoint,
5487
                                    EndPoint = s.EndPoint,
5488
                                    Angle = s.Angle,
5489
                                    StrokeColor = _SetColor,
5490
                                    DashSize = s.DashSize,
5491
                                    Opacity = s.Opac,
5492
                                    LeftBottomPoint = s.LB,
5493
                                    TopRightPoint = s.TR,
5494
                                    PointSet = s.PointSet,
5495
                                    UserID = s.UserID
5496
                                };
5497

    
5498
                                instance.Memo = s.Memo;
5499
                                //Layer.Children.Add(instance);
5500
                                instance.CommentID = commentId;
5501
                                instance.MarkupInfoID = markupInfoID;
5502
                                baseLayer.Add(instance);
5503
                                instance.ApplyTemplate();
5504
                                instance.SetRectPath();
5505

    
5506
                                return_control = instance;
5507
                            }
5508
                            break;
5509
                        #endregion
5510
                        #region Triangle
5511
                        case "TriControl":
5512
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
5513
                            {
5514
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5515
                                TriControl instance = new TriControl
5516
                                {
5517
                                    LineSize = Convert.ToDouble(data2.First()),
5518
                                    MidPoint = s.MidPoint,
5519
                                    StartPoint = s.StartPoint,
5520
                                    Paint = s.Paint,
5521
                                    EndPoint = s.EndPoint,
5522
                                    Opacity = s.Opac,
5523
                                    Angle = s.Angle,
5524
                                    DashSize = s.DashSize,
5525
                                    PointSet = s.PointSet,
5526
                                    StrokeColor = _SetColor,
5527
                                    UserID = s.UserID,
5528
                                };
5529
                                instance.Memo = s.Memo;
5530
                                //Layer.Children.Add(instance);
5531
                                instance.CommentID = commentId;
5532
                                instance.MarkupInfoID = markupInfoID;
5533
                                baseLayer.Add(instance);
5534
                                instance.ApplyTemplate();
5535
                                instance.SetTri();
5536
                                return_control = instance;
5537
                            }
5538
                            break;
5539
                        #endregion
5540
                        #region Cicle
5541
                        case "CircleControl":
5542
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
5543
                            {
5544
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5545
                                CircleControl instance = new CircleControl
5546
                                {
5547
                                    LineSize = Convert.ToDouble(data2.First()),
5548
                                    Paint = s.PaintState,
5549
                                    StartPoint = s.StartPoint,
5550
                                    EndPoint = s.EndPoint,
5551
                                    LeftBottomPoint = s.LBP,
5552
                                    TopRightPoint = s.TRP,
5553
                                    Opacity = s.Opac,
5554
                                    Angle = s.Angle,
5555
                                    DashSize = s.DashSize,
5556
                                    PointSet = s.PointSet,
5557
                                    StrokeColor = _SetColor,
5558
                                    UserID = s.UserID,
5559
                                };
5560
                                instance.Memo = s.Memo;
5561
                                //Layer.Children.Add(instance);
5562
                                instance.CommentID = commentId;
5563
                                instance.MarkupInfoID = markupInfoID;
5564
                                baseLayer.Add(instance);
5565
                                instance.ApplyTemplate();
5566
                                instance.SetCircle();
5567
                                return_control = instance;
5568
                            }
5569
                            break;
5570
                        #endregion
5571
                        #region Poly
5572
                        case "PolygonControl":
5573
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
5574
                            {
5575
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5576
                                PolygonControl instance = new PolygonControl
5577
                                {
5578
                                    LineSize = Convert.ToDouble(data2.First()),
5579
                                    //Toler = s.Toler,
5580
                                    IsCompleted = s.IsCompleted,
5581
                                    //PointSet = new List<Point>(),
5582
                                    Opacity = s.Opac,
5583
                                    StrokeColor = _SetColor,
5584
                                    StartPoint = s.StartPoint,
5585
                                    PointSet = s.PointSet,
5586
                                    EndPoint = s.EndPoint,
5587
                                    UserID = s.UserID,
5588
                                    //강인구 추가(Chain인지 Polygon인지 구분)
5589
                                    ControlType = s.Type,
5590
                                    DashSize = s.DashSize,
5591
                                    Paint = s.PaintState,
5592
                                    //PointC = s.PointC,
5593
                                };
5594
                                //Layer.Children.Add(instance);
5595
                                instance.MarkupInfoID = markupInfoID;
5596
                                baseLayer.Add(instance);
5597
                                instance.CommentID = commentId;
5598
                                instance.Memo = s.Memo;
5599
                                instance.ApplyTemplate();
5600
                                instance.SetPolyPath();
5601
                                return_control = instance;
5602
                                //instance.PointSet = s.PointSet;
5603
                                //instance.ClosePath();
5604
                                //instance.ChangePaint(s.PaintState);
5605
                            }
5606
                            break;
5607
                        #endregion
5608
                        #region InkControl
5609
                        case "InkControl":
5610
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
5611
                            {
5612
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5613
                                InkControl instance = new InkControl
5614
                                {
5615
                                    LineSize = Convert.ToDouble(data2.First()),
5616
                                    //Toler = s.Toler,
5617
                                    IsCompleted = s.IsCompleted,
5618
                                    //PointSet = new List<Point>(),
5619
                                    Opacity = s.Opac,
5620
                                    StrokeColor = _SetColor,
5621
                                    StartPoint = s.StartPoint,
5622
                                    PointSet = s.PointSet,
5623
                                    UserID = s.UserID,
5624
                                    EndPoint = s.EndPoint,
5625
                                    //강인구 추가(Chain인지 Polygon인지 구분)
5626
                                    ControlType = s.Type,
5627
                                    DashSize = s.DashSize,
5628
                                    Paint = s.PaintState,
5629
                                    //PointC = s.PointC,
5630
                                };
5631
                                //Layer.Children.Add(instance);
5632
                                instance.MarkupInfoID = markupInfoID;
5633
                                baseLayer.Add(instance);
5634
                                instance.CommentID = commentId;
5635
                                instance.Memo = s.Memo;
5636
                                instance.ApplyTemplate();
5637
                                instance.SetPolyPath();
5638
                                return_control = instance;
5639
                                //instance.PointSet = s.PointSet;
5640
                                //instance.ClosePath();
5641
                                //instance.ChangePaint(s.PaintState);
5642
                            }
5643
                            break;
5644
                        #endregion
5645
                        #region Cloud
5646
                        case "CloudControl":
5647
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
5648
                            {
5649
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5650
                                CloudControl instance = new CloudControl
5651
                                {
5652
                                    LineSize = Convert.ToDouble(data2.First()),
5653
                                    Toler = s.Toler,
5654
                                    PointSet = new List<Point>(),
5655
                                    ArcLength = s.ArcLength,
5656
                                    Paint = s.PaintState,
5657
                                    Opacity = s.Opac,
5658
                                    StrokeColor = _SetColor,
5659
                                    isTransOn = s.IsTrans,
5660
                                    isChain = s.IsChain,
5661
                                    DashSize = s.DashSize,
5662
                                    UserID = s.UserID,
5663
                                    StartPoint = s.StartPoint,
5664
                                    EndPoint = s.EndPoint,
5665
                                    //Fill = s.CloudFill,
5666
                                };
5667
                                instance.Memo = s.Memo;
5668
                                //Layer.Children.Add(instance);
5669
                                instance.MarkupInfoID = markupInfoID;
5670
                                baseLayer.Add(instance);
5671
                                instance.CommentID = commentId;
5672
                                instance.PointSet = s.PointSet;
5673
                                instance.ApplyTemplate();
5674
                                instance.ClosePath();
5675
                                instance.ChangePaint(s.PaintState);
5676
                                return_control = instance;
5677
                            }
5678
                            break;
5679
                        #endregion
5680
                        #region Line
5681
                        case "LineControl":
5682
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
5683
                            {
5684
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5685
                                LineControl instance = new LineControl()
5686
                                {
5687
                                    LineStyleSet = s.LineStyleSet,
5688
                                    StartPoint = s.StartPoint,
5689
                                    DimSize = s.DimSize,
5690
                                    EndPoint = s.EndPoint,
5691
                                    DashSize = s.DashSize,
5692
                                    Interval = s.Interval,
5693
                                    PointSet = s.PointSet,
5694
                                    Opacity = s.Opac,
5695
                                    StrokeColor = _SetColor,
5696
                                    UserID = s.UserID,
5697
                                    LineSize = Convert.ToDouble(data2.First()),
5698
                                };
5699
                                instance.Memo = s.Memo;
5700
                                //Layer.Children.Add(instance);
5701
                                instance.CommentID = commentId;
5702
                                instance.MarkupInfoID = markupInfoID;
5703
                                baseLayer.Add(instance);
5704
                                instance.ApplyTemplate();
5705
                                instance.SetLinePath();
5706
                                return_control = instance;
5707
                            }
5708
                            break;
5709
                        #endregion
5710
                        #region Text
5711
                        case "TextControl":
5712
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
5713
                            {
5714
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5715
                                TextControl instance = new TextControl()
5716
                                {
5717
                                    Text = s.Text,
5718
                                    StartPoint = s.StartPoint,
5719
                                    EndPoint = s.EndPoint,
5720
                                    CanvasX = s.StartPoint.X,
5721
                                    CanvasY = s.StartPoint.Y,
5722
                                    BoxWidth = s.BoxW,
5723
                                    BoxHeight = s.BoxH,
5724
                                    ControlType_No = s.paintMethod,
5725
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
5726
                                    TextSize = Convert.ToDouble(data2[1]),
5727
                                    FontColor = _SetColor,
5728
                                    //FontSize = 10,
5729
                                    UserID = s.UserID,
5730
                                    //isHighLight = s.isHighLight,
5731
                                    Angle = s.Angle,
5732
                                    PointSet = s.PointSet,
5733
                                    Opacity = s.Opac,
5734
                                    TextFamily = new FontFamily(s.fontConfig[0]),
5735
                                    //인구 추가(2018.04.17)
5736
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
5737
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
5738
                                };
5739

    
5740
                                if (instance.Text != null)
5741
                                {
5742
                                    //Layer.Children.Add(instance);
5743
                                    instance.MarkupInfoID = markupInfoID;
5744
                                    baseLayer.Add(instance);
5745
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
5746
                                    instance.ApplyTemplate();
5747
                                    instance.Memo = s.Memo;
5748
                                    if (s.fontConfig.Count() == 4)
5749
                                    {
5750
                                        instance.UnderLine = TextDecorations.Underline;
5751
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
5752
                                    }
5753
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
5754

    
5755
                                    //instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
5756

    
5757
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
5758
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
5759

    
5760
                                    instance.CommentID = commentId;
5761
                                    instance.DrawingCloud();
5762
                                    instance.SetText();
5763
                                    return_control = instance;
5764
                                }
5765
                            }
5766
                            break;
5767
                        #endregion
5768
                        #region Arc
5769
                        case "ArcControl":
5770
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
5771
                            {
5772
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5773
                                ArcControl instance = new ArcControl()
5774
                                {
5775
                                    StartPoint = s.StartPoint,
5776
                                    EndPoint = s.EndPoint,
5777
                                    DashSize = s.DashSize,
5778
                                    PointSet = s.PointSet,
5779
                                    isTransOn = s.IsTransOn,
5780
                                    MidPoint = s.MidPoint,
5781
                                    StrokeColor = _SetColor,
5782
                                    Clock = s.Clock,
5783
                                    Opacity = s.Opac,
5784
                                    LineSize = Convert.ToDouble(data2.First()),
5785
                                    UserID = s.UserID,
5786
                                };
5787
                                instance.Memo = s.Memo;
5788
                                //Layer.Children.Add(instance);
5789
                                instance.MarkupInfoID = markupInfoID;
5790
                                baseLayer.Add(instance);
5791
                                instance.CommentID = commentId;
5792
                                instance.ApplyTemplate();
5793
                                instance.SetArcPath();
5794
                                return_control = instance;
5795
                            }
5796
                            break;
5797
                        #endregion
5798
                        #region RectCloud
5799
                        case "RectCloudControl":
5800
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
5801
                            {
5802
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5803
                                RectCloudControl instance = new RectCloudControl()
5804
                                {
5805
                                    StartPoint = s.StartPoint,
5806
                                    EndPoint = s.EndPoint,
5807
                                    LeftBottomPoint = s.LB,
5808
                                    Paint = s.PaintState,
5809
                                    Opacity = s.Opac,
5810
                                    DashSize = s.DashSize,
5811
                                    TopRightPoint = s.TR,
5812
                                    PointSet = s.PointSet,
5813
                                    StrokeColor = _SetColor,
5814
                                    LineSize = Convert.ToDouble(data2.First()),
5815
                                    UserID = s.UserID,
5816
                                    ArcLength = s.ArcLength
5817
                                };
5818
                                instance.Memo = s.Memo;
5819
                                //Layer.Children.Add(instance);
5820
                                instance.MarkupInfoID = markupInfoID;
5821
                                baseLayer.Add(instance);
5822
                                instance.CommentID = commentId;
5823
                                instance.ApplyTemplate();
5824
                                instance.SetRectCloud();
5825
                                return_control = instance;
5826
                            }
5827
                            break;
5828
                        #endregion
5829
                        #region Sign
5830
                        case "SignControl":
5831
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
5832
                            {
5833
                                SignControl instance = new SignControl
5834
                                {
5835
                                    Angle = s.Angle,
5836
                                    StartPoint = s.StartPoint,
5837
                                    TopRightPoint = s.TR,
5838
                                    EndPoint = s.EndPoint,
5839
                                    LeftBottomPoint = s.LB,
5840
                                    PointSet = s.PointSet,
5841
                                    Opacity = s.Opac,
5842
                                    SignImage = null,
5843
                                    UserID = s.UserID,
5844
                                };
5845
                                instance.ApplyTemplate();
5846
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5847

    
5848
                                if (s.UserNumber != null)
5849
                                {
5850
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
5851
                                    if (_sign != null)
5852
                                    {
5853
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
5854

    
5855
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
5856
                                        stream.Write(imageBytes, 0, imageBytes.Length);
5857
                                        stream.Position = 0;
5858
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
5859
                                        BitmapImage returnImage = new BitmapImage();
5860
                                        returnImage.BeginInit();
5861
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
5862
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
5863
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
5864
                                        returnImage.StreamSource = ms;
5865
                                        returnImage.EndInit();
5866
                                        stream.Close();
5867
                                        instance.SignImage = returnImage;
5868
                                    }
5869
                                }
5870

    
5871
                                instance.MarkupInfoID = markupInfoID;
5872
                                instance.CommentID = commentId;
5873
                                baseLayer.Add(instance);
5874
                                instance.ApplyTemplate();
5875
                                instance.SetImage();
5876
                                return_control = instance;
5877
                            }
5878
                            break;
5879
                        #endregion
5880
                        #region Ink
5881
                        case "InkPresenter":
5882
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
5883
                            {
5884
#if SILVERLIGHT
5885
                                this._InkBoard.Strokes = s.SCC; 
5886
#endif
5887
                            }
5888
                            break;
5889
                        #endregion
5890
                        #region Date
5891
                        case "DateControl":
5892
                            {
5893
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
5894
                                {
5895
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5896
                                    DateControl instance = new DateControl
5897
                                    {
5898
                                        Angle = s.Angle,
5899
                                        StartPoint = s.StartPoint,
5900
                                        EndPoint = s.EndPoint,
5901
                                        LeftBottomPoint = s.LB,
5902
                                        TopRightPoint = s.TR,
5903
                                        Opacity = s.Opac,
5904
                                        FontColor = _SetColor,
5905
                                        LineSize = Convert.ToDouble(data2.First()),
5906
                                        Text = s.Text,
5907
                                        PointSet = s.PointSet,
5908
                                        UserID = s.UserID
5909
                                    };
5910
                                    instance.Memo = s.Memo;
5911
                                    //Layer.Children.Add(instance);
5912
                                    baseLayer.Add(instance);
5913
                                    instance.CommentID = commentId;
5914
                                    instance.ApplyTemplate();
5915
                                    instance.SetDate();
5916
                                    return_control = instance;
5917
                                }
5918
                            }
5919
                            break;
5920
                        #endregion
5921
                        #region Symbol
5922
                        case "SymControl":
5923
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
5924
                            {
5925
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5926
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
5927
                                SymControl instance = new SymControl()
5928
                                {
5929
                                    LineSize = Convert.ToDouble(data2.First()),
5930
                                    PointSet = s.PointSet,
5931
                                    Paint = s.PaintState,
5932
                                    StartPoint = s.StartPoint,
5933
                                    StrokeColor = _SetColor,
5934
                                    EndPoint = s.EndPoint,
5935
                                    Angle = s.Angle,
5936
                                    LeftBottomPoint = s.LB,
5937
                                    TopRightPoint = s.TR,
5938
                                    PathData = sm.Convert(s.PathInfo.ToString()),
5939
                                    Opacity = s.Opac,
5940
                                };
5941

    
5942
                                instance.Memo = s.Memo;
5943
                                baseLayer.Add(instance);
5944
                                instance.CommentID = commentId;
5945
                                instance.ApplyTemplate();
5946
                                instance.SetSymPath();
5947
                                return_control = instance;
5948
                            }
5949
                            break;
5950
                        #endregion
5951
                        #region Image
5952
                        case "ImgControl":
5953
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
5954
                            {
5955
                                Image img = new Image();
5956
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
5957

    
5958
                                ImgControl instance = new ImgControl
5959
                                {
5960
                                    Angle = s.Angle,
5961
                                    StartPoint = s.StartPoint,
5962
                                    TopRightPoint = s.TR,
5963
                                    EndPoint = s.EndPoint,
5964
                                    LeftBottomPoint = s.LB,
5965
                                    PointSet = s.PointSet,
5966
                                    Opacity = s.Opac,
5967
                                    FilePath = s.ImagePath,
5968
                                    UserID = s.UserID,
5969
                                    ImageData = img.Source
5970
                                };
5971
                                //Layer.Children.Add(instance);
5972
                                instance.Memo = s.Memo;
5973
                                baseLayer.Add(instance);
5974
                                instance.CommentID = commentId;
5975
                                instance.ApplyTemplate();
5976
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5977
                                instance.SetImage();
5978
                                return_control = instance;
5979
                            }
5980
                            break;
5981
                        #endregion
5982
                        #region SymbolN
5983
                        case "SymControlN":
5984
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
5985
                            {
5986
                                SymControlN instance = new SymControlN()
5987
                                {
5988
                                    PointSet = s.PointSet,
5989
                                    StartPoint = s.StartPoint,
5990
                                    EndPoint = s.EndPoint,
5991
                                    Angle = s.Angle,
5992
                                    LeftBottomPoint = s.LB,
5993
                                    TopRightPoint = s.TR,
5994
                                    Opacity = s.Opac,
5995
                                    PathXathData = s.DBData,
5996
                                };
5997
                                instance.Memo = s.Memo;
5998
                                instance.MarkupInfoID = markupInfoID;
5999
                                baseLayer.Add(instance);
6000
                                instance.CommentID = commentId;
6001
                                instance.ApplyTemplate();
6002

    
6003
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData);
6004
                                xamlData = xamlData.Replace("daelim", "DAELIM");
6005
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
6006
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
6007
                                writer.Write(xamlData);
6008
                                writer.Flush();
6009
                                stream.Position = 0;
6010

    
6011
                                object obj = XamlReader.Load(stream);
6012
                                instance.Base_ViewBox.Child = obj as UIElement;
6013
                                instance.SetViewBox();
6014
                                return_control = instance;
6015
                            }
6016
                            break;
6017
                        #endregion
6018
                        default:
6019

    
6020
                            break;
6021
                    };
6022
                }
6023
            }
6024
            return return_control;
6025
        }
6026

    
6027
    }
6028
}
클립보드 이미지 추가 (최대 크기: 500 MB)