프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Controls / Parsing / MarkupParse.cs @ 4538d5e7

이력 | 보기 | 이력해설 | 다운로드 (369 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
                        #region ArrowArc
3116
                        case "ArrowArcControl":
3117
                            using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item))
3118
                            {
3119
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3120
                                ArrowArcControl instance = new ArrowArcControl()
3121
                                {
3122
                                    StartPoint = s.StartPoint,
3123
                                    EndPoint = s.EndPoint,
3124
                                    DashSize = s.DashSize,
3125
                                    PointSet = s.PointSet,
3126
                                    isTransOn = s.IsTransOn,
3127
                                    MidPoint = s.MidPoint,
3128
                                    StrokeColor = _SetColor,
3129
                                    Opacity = s.Opac,
3130
                                    Clock = s.Clock,
3131
                                    LineSize = Convert.ToDouble(data2.First()),
3132
                                    UserID = s.UserID,
3133
                                };
3134

    
3135
                                Layer.Children.Add(instance);
3136
                                instance.ApplyTemplate();
3137
                                instance.SetArcPath();
3138
                            }
3139
                            break;
3140
                        #endregion
3141
                        #endregion
3142
                        #region Text
3143
                        case "TextControl":
3144
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
3145
                            {
3146
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3147
                                TextControl instance = new TextControl()
3148
                                {
3149
                                    Text = s.Text,
3150
                                    StartPoint = s.StartPoint,
3151
                                    EndPoint = s.EndPoint,
3152
                                    CanvasX = s.StartPoint.X,
3153
                                    CanvasY = s.StartPoint.Y,
3154
                                    BoxWidth = s.BoxW,
3155
                                    BoxHeight = s.BoxH,
3156
                                    ControlType_No = s.paintMethod,
3157
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
3158
                                    TextSize = Convert.ToDouble(data2[1]),
3159
                                    FontColor = _SetColor,
3160
                                    FontSize = 10,
3161
                                    UserID = s.UserID,
3162
                                    //isHighLight = s.isHighLight,
3163
                                    Angle = s.Angle,
3164
                                    PointSet = s.PointSet,
3165
                                    Opacity = s.Opac,
3166
                                    TextFamily = new FontFamily(s.fontConfig[0]),
3167
                                    //인구 추가(2018.04.17)
3168
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
3169
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
3170
                                };
3171

    
3172
                                if (instance.Text != null)
3173
                                {
3174
                                    Layer.Children.Add(instance);
3175
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
3176
                                    instance.ApplyTemplate();
3177
                                    if (s.fontConfig.Count() == 4)
3178
                                    {
3179
                                        instance.UnderLine = TextDecorations.Underline;
3180
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
3181
                                    }
3182
                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
3183

    
3184
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3185
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3186
                                    instance.DrawingCloud();
3187
                                    instance.SetText();
3188
                                }
3189
                            }
3190
                            break;
3191
                        #endregion
3192

    
3193
                        #region ArrowText
3194
                        case "ArrowTextControl":
3195
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
3196
                            {
3197
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3198
                                ArrowTextControl instance = new ArrowTextControl();
3199
                                Layer.Children.Add(instance);
3200
                                instance.LineSize = Convert.ToDouble(data2.First());
3201
                                instance.PointSet = s.PointSet;
3202
                                instance.StartPoint = s.StartPoint;
3203
                                instance.EndPoint = s.EndPoint;
3204
                                instance.StrokeColor = _SetColor;
3205
                                //instance.DashSize = s.DashSize;
3206
                                instance.ArrowTextStyle = s.ArrowStyle;
3207
                                instance.isHighLight = s.isHighLight;
3208
                                instance.ArrowText = s.ArrowText;
3209
                                instance.Opacity = s.Opac;
3210
                                instance.BorderSize = s.BorderSize;
3211
                                instance.BoxWidth = s.BoxWidth;
3212
                                instance.BoxHeight = s.BoxHeight;
3213
                                instance.isFixed = s.isFixed;
3214
                                instance.Angle = s.Angle;
3215
                                instance.UserID = s.UserID;
3216
                                instance.isTrans = s.isTrans;
3217
                                instance.MidPoint = s.MidPoint;
3218
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
3219
                                {
3220
                                    s.fontConfig = new List<string>();
3221

    
3222
                                    s.fontConfig.Add("Arial");
3223
                                    s.fontConfig.Add("Normal");
3224
                                    s.fontConfig.Add("Normal");
3225
                                    s.fontConfig.Add("30");
3226
                                }
3227
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
3228
                                //인구 추가(2018.04.17)
3229
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
3230
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
3231
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
3232

    
3233
                                instance.ApplyTemplate();
3234

    
3235
                                if (s.fontConfig.Count() == 5)
3236
                                {
3237
                                    instance.UnderLine = TextDecorations.Underline;
3238
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
3239
                                }
3240
                                instance.SetArrowTextPath();
3241

    
3242
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3243
                            };
3244
                            break;
3245
                        #endregion
3246

    
3247
                        #region Date
3248
                        case "DateControl":
3249
                            {
3250
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
3251
                                {
3252
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3253
                                    DateControl instance = new DateControl
3254
                                    {
3255
                                        Angle = s.Angle,
3256
                                        StartPoint = s.StartPoint,
3257
                                        EndPoint = s.EndPoint,
3258
                                        LeftBottomPoint = s.LB,
3259
                                        TopRightPoint = s.TR,
3260
                                        Opacity = s.Opac,
3261
                                        FontColor = _SetColor,
3262
                                        LineSize = Convert.ToDouble(data2.First()),
3263
                                        Text = s.Text,
3264
                                        PointSet = s.PointSet,
3265
                                        UserID = s.UserID
3266
                                    };
3267

    
3268
                                    Layer.Children.Add(instance);
3269
                                    instance.ApplyTemplate();
3270
                                    instance.SetDate();
3271
                                }
3272
                            }
3273
                            break;
3274
                        #endregion
3275

    
3276
                        #region Image
3277
                        case "ImgControl":
3278
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
3279
                            {
3280
                                Image img = new Image();
3281
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
3282

    
3283
                                ImgControl instance = new ImgControl
3284
                                {
3285
                                    Angle = s.Angle,
3286
                                    StartPoint = s.StartPoint,
3287
                                    TopRightPoint = s.TR,
3288
                                    EndPoint = s.EndPoint,
3289
                                    LeftBottomPoint = s.LB,
3290
                                    PointSet = s.PointSet,
3291
                                    Opacity = s.Opac,
3292
                                    FilePath = s.ImagePath,
3293
                                    UserID = s.UserID,
3294
                                    ImageData = img.Source
3295
                                };
3296
                                Layer.Children.Add(instance);
3297
                                instance.ApplyTemplate();
3298
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3299
                                instance.SetImage();
3300
                            }
3301
                            break;
3302
                        #endregion
3303

    
3304
                        #region Symbol
3305
                        case "SymControl":
3306
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
3307
                            {
3308
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3309
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
3310
                                SymControl instance = new SymControl()
3311
                                {
3312
                                    LineSize = Convert.ToDouble(data2.First()),
3313
                                    PointSet = s.PointSet,
3314
                                    Paint = s.PaintState,
3315
                                    StartPoint = s.StartPoint,
3316
                                    StrokeColor = _SetColor,
3317
                                    EndPoint = s.EndPoint,
3318
                                    Angle = s.Angle,
3319
                                    LeftBottomPoint = s.LB,
3320
                                    TopRightPoint = s.TR,
3321
                                    PathData = sm.Convert(s.PathInfo.ToString()),
3322
                                    Opacity = s.Opac,
3323
                                };
3324
                                instance.Memo = s.Memo;
3325
                                Layer.Children.Add(instance);
3326
                                instance.ApplyTemplate();
3327
                                instance.SetSymPath();
3328
                            }
3329
                            break;
3330
                        #endregion
3331

    
3332
                        #region SymbolN
3333
                        case "SymControlN":
3334
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
3335
                            {
3336
                                SymControlN instance = new SymControlN()
3337
                                {
3338
                                    PointSet = s.PointSet,
3339
                                    StartPoint = s.StartPoint,
3340
                                    EndPoint = s.EndPoint,
3341
                                    Angle = s.Angle,
3342
                                    LeftBottomPoint = s.LB,
3343
                                    TopRightPoint = s.TR,
3344
                                    Opacity = s.Opac,
3345
                                    PathXathData = s.DBData,
3346
                                };
3347

    
3348
                                instance.Memo = s.Memo;
3349
                                Layer.Children.Add(instance);
3350
                                instance.ApplyTemplate();
3351

    
3352
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3353
                                //instance.PathXathData = s.DBData;
3354

    
3355
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3356
                                //xamlData = xamlData.Replace("daelim", "DAELIM");
3357
                                //System.IO.MemoryStream stream = new System.IO.MemoryStream();
3358
                                //System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
3359
                                //writer.Write(xamlData);
3360
                                //writer.Flush();
3361
                                //stream.Position = 0;
3362

    
3363
                                //object obj = XamlReader.Load(stream);
3364
                                //instance.Base_ViewBox.Child = obj as UIElement;
3365
                                //instance.PathXathData = appovalData;
3366
                                //instance.SetViewBox();
3367
                            }
3368
                            break;
3369
                        #endregion
3370

    
3371
                        #region Sign
3372
                        case "SignControl":
3373
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
3374
                            {
3375
                                SignControl instance = new SignControl
3376
                                {
3377
                                    Angle = s.Angle,
3378
                                    StartPoint = s.StartPoint,
3379
                                    TopRightPoint = s.TR,
3380
                                    EndPoint = s.EndPoint,
3381
                                    LeftBottomPoint = s.LB,
3382
                                    PointSet = s.PointSet,
3383
                                    Opacity = s.Opac,
3384
                                    SignImage = null,
3385
                                    UserID = s.UserID,
3386
                                };
3387
                                instance.ApplyTemplate();
3388
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3389

    
3390
                                if (s.UserNumber != null)
3391
                                {
3392
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
3393
                                    if (_sign != null)
3394
                                    {
3395
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
3396

    
3397
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
3398
                                        stream.Write(imageBytes, 0, imageBytes.Length);
3399
                                        stream.Position = 0;
3400
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
3401
                                        BitmapImage returnImage = new BitmapImage();
3402
                                        returnImage.BeginInit();
3403
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
3404
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
3405
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
3406
                                        returnImage.StreamSource = ms;
3407
                                        returnImage.EndInit();
3408
                                        stream.Close();
3409
                                        instance.SignImage = returnImage;
3410
                                    }
3411
                                }
3412

    
3413

    
3414
                                instance.Memo = s.Memo;
3415
                                Layer.Children.Add(instance);
3416
                                instance.ApplyTemplate();
3417
                                instance.SetImage();
3418
                            }
3419
                            break;
3420
                        #endregion
3421

    
3422

    
3423

    
3424
                        default:
3425
                            break;
3426
                    };
3427
                }
3428
            }
3429
        }
3430

    
3431
        /// <summary>
3432
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
3433
        /// </summary>
3434
        /// <param name="MarkupString"></param>
3435
        public void markupParse(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID)
3436
        {
3437
            if (MarkupString != "False")
3438
            {
3439
                //GetUserSign getUser = new GetUserSign();
3440
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
3441
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
3442
                string[] delimiterChars = { "|DZ|" };
3443
                string[] delimiterChars2 = { "|" };
3444
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
3445
                List<string> dataSet = new List<string>();
3446

    
3447
                foreach (var dataPease in data)
3448
                {
3449
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
3450
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
3451
                    switch (unkownControl.Name)
3452
                    {
3453
                        #region ArrowText
3454
                        case "ArrowTextControl":
3455
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
3456
                            {
3457
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3458
                                ArrowTextControl instance = new ArrowTextControl();
3459
                                instance.MarkupInfoID = markupInfoID;
3460
                                //Layer.Children.Add(instance);
3461
                                baseLayer.Add(instance);
3462
                                instance.LineSize = Convert.ToDouble(data2.First());
3463
                                instance.PointSet = s.PointSet;
3464
                                instance.StartPoint = s.StartPoint;
3465
                                instance.EndPoint = s.EndPoint;
3466
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
3467
                                //instance.DashSize = s.DashSize;
3468
                                instance.ArrowTextStyle = s.ArrowStyle;
3469
                                instance.isHighLight = s.isHighLight;
3470
                                instance.ArrowText = s.ArrowText;
3471
                                instance.Opacity = s.Opac;
3472
                                instance.BorderSize = s.BorderSize;
3473
                                instance.BoxWidth = s.BoxWidth;
3474
                                instance.BoxHeight = s.BoxHeight;
3475
                                instance.isFixed = s.isFixed;
3476
                                instance.Angle = s.Angle;
3477
                                instance.UserID = s.UserID;
3478
                                instance.StrokeColor = _SetColor;
3479
                                instance.isTrans = s.isTrans;
3480
                                instance.MidPoint = s.MidPoint;
3481
                                instance.Memo = s.Memo;
3482
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
3483
                                {
3484
                                    s.fontConfig = new List<string>();
3485

    
3486
                                    s.fontConfig.Add("Arial");
3487
                                    s.fontConfig.Add("Normal");
3488
                                    s.fontConfig.Add("Normal");
3489
                                    s.fontConfig.Add("30");
3490
                                }
3491
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
3492
                                //인구 추가(2018.04.17)
3493
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
3494
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
3495
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
3496
                                instance.ApplyTemplate();
3497

    
3498
                                if (s.fontConfig.Count() == 5)
3499
                                {
3500
                                    instance.UnderLine = TextDecorations.Underline;
3501
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
3502
                                }
3503
                                instance.SetArrowTextPath();
3504
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3505
                            };
3506
                            break;
3507
                        #endregion
3508
                        #region Arrow_Multi
3509
                        case "ArrowControl_Multi":
3510
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
3511
                            {
3512
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3513
                                ArrowControl_Multi instance = new ArrowControl_Multi
3514
                                {
3515
                                    LineSize = Convert.ToDouble(data2.First()),
3516
                                    StartPoint = s.StartPoint,
3517
                                    MiddlePoint = s.MidPoint,
3518
                                    DashSize = s.DashSize,
3519
                                    EndPoint = s.EndPoint,
3520
                                    PointSet = s.PointSet,
3521
                                    Opacity = s.Opac,
3522
                                    StrokeColor = _SetColor,
3523
                                    UserID = s.UserID
3524
                                };
3525

    
3526
                                //Layer.Children.Add(instance);
3527
                                instance.MarkupInfoID = markupInfoID;
3528
                                baseLayer.Add(instance);
3529
                                instance.ApplyTemplate();
3530
                                instance.SetArrowMultiPath();
3531
                                instance.Memo = s.Memo;
3532
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3533

    
3534
                            }
3535
                            break;
3536
                        #endregion
3537
                        #region Rectangle
3538
                        case "RectangleControl":
3539
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
3540
                            {
3541
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3542
                                RectangleControl instance = new RectangleControl
3543
                                {
3544
                                    LineSize = Convert.ToDouble(data2.First()),
3545
                                    Paint = s.PaintState,
3546
                                    StartPoint = s.StartPoint,
3547
                                    EndPoint = s.EndPoint,
3548
                                    Angle = s.Angle,
3549
                                    StrokeColor = _SetColor,
3550
                                    DashSize = s.DashSize,
3551
                                    Opacity = s.Opac,
3552
                                    LeftBottomPoint = s.LB,
3553
                                    TopRightPoint = s.TR,
3554
                                    PointSet = s.PointSet,
3555
                                    UserID = s.UserID
3556
                                };
3557

    
3558
                                instance.Memo = s.Memo;
3559
                                //Layer.Children.Add(instance);
3560
                                instance.MarkupInfoID = markupInfoID;
3561
                                baseLayer.Add(instance);
3562
                                instance.ApplyTemplate();
3563
                                instance.SetRectPath();
3564
                            }
3565
                            break;
3566
                        #endregion
3567
                        #region Triangle
3568
                        case "TriControl":
3569
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
3570
                            {
3571
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3572
                                TriControl instance = new TriControl
3573
                                {
3574
                                    LineSize = Convert.ToDouble(data2.First()),
3575
                                    MidPoint = s.MidPoint,
3576
                                    StartPoint = s.StartPoint,
3577
                                    Paint = s.Paint,
3578
                                    EndPoint = s.EndPoint,
3579
                                    Opacity = s.Opac,
3580
                                    Angle = s.Angle,
3581
                                    DashSize = s.DashSize,
3582
                                    PointSet = s.PointSet,
3583
                                    StrokeColor = _SetColor,
3584
                                    UserID = s.UserID,
3585
                                };
3586
                                instance.Memo = s.Memo;
3587
                                //Layer.Children.Add(instance);
3588
                                instance.MarkupInfoID = markupInfoID;
3589
                                baseLayer.Add(instance);
3590
                                instance.ApplyTemplate();
3591
                                instance.SetTri();
3592
                            }
3593
                            break;
3594
                        #endregion
3595
                        #region Cicle
3596
                        case "CircleControl":
3597
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
3598
                            {
3599
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3600
                                CircleControl instance = new CircleControl
3601
                                {
3602
                                    LineSize = Convert.ToDouble(data2.First()),
3603
                                    Paint = s.PaintState,
3604
                                    StartPoint = s.StartPoint,
3605
                                    EndPoint = s.EndPoint,
3606
                                    LeftBottomPoint = s.LBP,
3607
                                    TopRightPoint = s.TRP,
3608
                                    Opacity = s.Opac,
3609
                                    Angle = s.Angle,
3610
                                    DashSize = s.DashSize,
3611
                                    PointSet = s.PointSet,
3612
                                    StrokeColor = _SetColor,
3613
                                    UserID = s.UserID,
3614
                                };
3615
                                instance.Memo = s.Memo;
3616
                                //Layer.Children.Add(instance);
3617
                                instance.MarkupInfoID = markupInfoID;
3618
                                baseLayer.Add(instance);
3619
                                instance.ApplyTemplate();
3620
                                instance.SetCircle();
3621
                            }
3622
                            break;
3623
                        #endregion
3624
                        #region Poly
3625
                        case "PolygonControl":
3626
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
3627
                            {
3628
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3629
                                PolygonControl instance = new PolygonControl
3630
                                {
3631
                                    LineSize = Convert.ToDouble(data2.First()),
3632
                                    //Toler = s.Toler,
3633
                                    IsCompleted = s.IsCompleted,
3634
                                    //PointSet = new List<Point>(),
3635
                                    Opacity = s.Opac,
3636
                                    StrokeColor = _SetColor,
3637
                                    DashSize = s.DashSize,
3638
                                    StartPoint = s.StartPoint,
3639
                                    EndPoint = s.EndPoint,
3640
                                    PointSet = s.PointSet,
3641
                                    UserID = s.UserID,
3642
                                    //강인구 추가(Chain인지 Polygon인지 구분)
3643
                                    ControlType = s.Type,
3644
                                    Paint = s.PaintState,
3645
                                    //PointC = s.PointC,
3646
                                };
3647
                                //Layer.Children.Add(instance);
3648
                                instance.MarkupInfoID = markupInfoID;
3649
                                baseLayer.Add(instance);
3650
                                instance.Memo = s.Memo;
3651
                                instance.ApplyTemplate();
3652
                                instance.SetPolyPath();
3653

    
3654
                                //instance.PointSet = s.PointSet;
3655
                                //instance.ClosePath();
3656
                                //instance.ChangePaint(s.PaintState);
3657
                            }
3658
                            break;
3659
                        #endregion
3660
                        #region InkControl
3661
                        case "InkControl":
3662
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
3663
                            {
3664
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3665
                                InkControl instance = new InkControl
3666
                                {
3667
                                    LineSize = Convert.ToDouble(data2.First()),
3668
                                    //Toler = s.Toler,
3669
                                    IsCompleted = s.IsCompleted,
3670
                                    //PointSet = new List<Point>(),
3671
                                    Opacity = s.Opac,
3672
                                    StrokeColor = _SetColor,
3673
                                    DashSize = s.DashSize,
3674
                                    StartPoint = s.StartPoint,
3675
                                    PointSet = s.PointSet,
3676
                                    UserID = s.UserID,
3677
                                    //강인구 추가(Chain인지 Polygon인지 구분)
3678
                                    ControlType = s.Type,
3679
                                    Paint = s.PaintState,
3680
                                    EndPoint = s.EndPoint,
3681
                                    //PointC = s.PointC,
3682
                                };
3683
                                //Layer.Children.Add(instance);
3684
                                instance.MarkupInfoID = markupInfoID;
3685
                                baseLayer.Add(instance);
3686
                                instance.Memo = s.Memo;
3687
                                instance.ApplyTemplate();
3688
                                instance.SetPolyPath();
3689

    
3690
                                //instance.PointSet = s.PointSet;
3691
                                //instance.ClosePath();
3692
                                //instance.ChangePaint(s.PaintState);
3693
                            }
3694
                            break;
3695
                        #endregion
3696
                        #region Cloud
3697
                        case "CloudControl":
3698
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
3699
                            {
3700
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3701
                                CloudControl instance = new CloudControl
3702
                                {
3703
                                    LineSize = Convert.ToDouble(data2.First()),
3704
                                    Toler = s.Toler,
3705
                                    PointSet = new List<Point>(),
3706
                                    ArcLength = s.ArcLength,
3707
                                    Paint = s.PaintState,
3708
                                    Opacity = s.Opac,
3709
                                    StrokeColor = _SetColor,
3710
                                    isTransOn = s.IsTrans,
3711
                                    isChain = s.IsChain,
3712
                                    DashSize = s.DashSize,
3713
                                    UserID = s.UserID,
3714
                                    StartPoint = s.StartPoint,
3715
                                    EndPoint = s.EndPoint,
3716
                                    //Fill = s.CloudFill,
3717
                                };
3718
                                instance.Memo = s.Memo;
3719
                                //Layer.Children.Add(instance);
3720
                                instance.MarkupInfoID = markupInfoID;
3721
                                baseLayer.Add(instance);
3722
                                instance.PointSet = s.PointSet;
3723
                                instance.ApplyTemplate();
3724
                                instance.ClosePath();
3725
                                instance.ChangePaint(s.PaintState);
3726
                            }
3727
                            break;
3728
                        #endregion
3729
                        #region Line
3730
                        case "LineControl":
3731
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
3732
                            {
3733
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3734
                                LineControl instance = new LineControl()
3735
                                {
3736
                                    LineStyleSet = s.LineStyleSet,
3737
                                    StartPoint = s.StartPoint,
3738
                                    DimSize = s.DimSize,
3739
                                    EndPoint = s.EndPoint,
3740
                                    DashSize = s.DashSize,
3741
                                    Interval = s.Interval,
3742
                                    PointSet = s.PointSet,
3743
                                    Opacity = s.Opac,
3744
                                    StrokeColor = _SetColor,
3745
                                    UserID = s.UserID,
3746
                                    LineSize = Convert.ToDouble(data2.First()),
3747
                                };
3748
                                instance.Memo = s.Memo;
3749
                                //Layer.Children.Add(instance);
3750
                                instance.MarkupInfoID = markupInfoID;
3751
                                baseLayer.Add(instance);
3752
                                instance.ApplyTemplate();
3753
                                instance.SetLinePath();
3754
                            }
3755
                            break;
3756
                        #endregion
3757
                        #region Text
3758
                        case "TextControl":
3759
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
3760
                            {
3761
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3762
                                TextControl instance = new TextControl()
3763
                                {
3764
                                    Text = s.Text,
3765
                                    StartPoint = s.StartPoint,
3766
                                    EndPoint = s.EndPoint,
3767
                                    CanvasX = s.StartPoint.X,
3768
                                    CanvasY = s.StartPoint.Y,
3769
                                    BoxWidth = s.BoxW,
3770
                                    BoxHeight = s.BoxH,
3771
                                    ControlType_No = s.paintMethod,
3772
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
3773
                                    TextSize = Convert.ToDouble(data2[1]),
3774
                                    FontColor = _SetColor,
3775
                                    FontSize = 10,
3776
                                    UserID = s.UserID,
3777
                                    //isHighLight = s.isHighLight,
3778
                                    Angle = s.Angle,
3779
                                    PointSet = s.PointSet,
3780
                                    Opacity = s.Opac,
3781
                                    TextFamily = new FontFamily(s.fontConfig[0]),
3782
                                    //인구 추가(2018.04.17)
3783
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
3784
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
3785
                                };
3786

    
3787
                                if (instance.Text != null)
3788
                                {
3789
                                    //Layer.Children.Add(instance);
3790
                                    instance.MarkupInfoID = markupInfoID;
3791
                                    baseLayer.Add(instance);
3792
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
3793
                                    instance.ApplyTemplate();
3794
                                    instance.Memo = s.Memo;
3795
                                    if (s.fontConfig.Count() == 4)
3796
                                    {
3797
                                        instance.UnderLine = TextDecorations.Underline;
3798
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
3799
                                    }
3800
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
3801
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3802
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3803
                                    instance.DrawingCloud();
3804
                                    instance.SetText();
3805
                                }
3806
                            }
3807
                            break;
3808
                        #endregion
3809
                        #region Arc
3810
                        case "ArcControl":
3811
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
3812
                            {
3813
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3814
                                ArcControl instance = new ArcControl()
3815
                                {
3816
                                    StartPoint = s.StartPoint,
3817
                                    EndPoint = s.EndPoint,
3818
                                    DashSize = s.DashSize,
3819
                                    PointSet = s.PointSet,
3820
                                    isTransOn = s.IsTransOn,
3821
                                    MidPoint = s.MidPoint,
3822
                                    StrokeColor = _SetColor,
3823
                                    Clock = s.Clock,
3824
                                    Opacity = s.Opac,
3825
                                    LineSize = Convert.ToDouble(data2.First()),
3826
                                    UserID = s.UserID,
3827
                                };
3828
                                instance.Memo = s.Memo;
3829
                                //Layer.Children.Add(instance);
3830
                                instance.MarkupInfoID = markupInfoID;
3831
                                baseLayer.Add(instance);
3832
                                instance.ApplyTemplate();
3833
                                instance.SetArcPath();
3834
                            }
3835
                            break;
3836
                        #endregion
3837
                        #region ArrowArc
3838
                        case "ArrowArcControl":
3839
                            using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item))
3840
                            {
3841
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3842
                                ArrowArcControl instance = new ArrowArcControl()
3843
                                {
3844
                                    StartPoint = s.StartPoint,
3845
                                    EndPoint = s.EndPoint,
3846
                                    DashSize = s.DashSize,
3847
                                    PointSet = s.PointSet,
3848
                                    isTransOn = s.IsTransOn,
3849
                                    MidPoint = s.MidPoint,
3850
                                    StrokeColor = _SetColor,
3851
                                    Clock = s.Clock,
3852
                                    Opacity = s.Opac,
3853
                                    LineSize = Convert.ToDouble(data2.First()),
3854
                                    UserID = s.UserID,
3855
                                };
3856
                                instance.Memo = s.Memo;
3857
                                //Layer.Children.Add(instance);
3858
                                instance.MarkupInfoID = markupInfoID;
3859
                                baseLayer.Add(instance);
3860
                                instance.ApplyTemplate();
3861
                                instance.SetArcPath();
3862
                            }
3863
                            break;
3864
                        #endregion                        
3865
                        #region RectCloud
3866
                        case "RectCloudControl":
3867
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
3868
                            {
3869
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3870
                                RectCloudControl instance = new RectCloudControl()
3871
                                {
3872
                                    StartPoint = s.StartPoint,
3873
                                    EndPoint = s.EndPoint,
3874
                                    LeftBottomPoint = s.LB,
3875
                                    Paint = s.PaintState,
3876
                                    Opacity = s.Opac,
3877
                                    DashSize = s.DashSize,
3878
                                    TopRightPoint = s.TR,
3879
                                    PointSet = s.PointSet,
3880
                                    StrokeColor = _SetColor,
3881
                                    ArcLength = s.ArcLength,
3882
                                    LineSize = Convert.ToDouble(data2.First()),
3883
                                    UserID = s.UserID
3884
                                };
3885
                                instance.Memo = s.Memo;
3886
                                //Layer.Children.Add(instance);
3887
                                instance.MarkupInfoID = markupInfoID;
3888
                                baseLayer.Add(instance);
3889
                                instance.ApplyTemplate();
3890
                                instance.SetRectCloud();
3891
                            }
3892
                            break;
3893
                        #endregion
3894
                        #region Sign
3895
                        case "SignControl":
3896
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
3897
                            {
3898
                                SignControl instance = new SignControl
3899
                                {
3900
                                    Angle = s.Angle,
3901
                                    StartPoint = s.StartPoint,
3902
                                    TopRightPoint = s.TR,
3903
                                    EndPoint = s.EndPoint,
3904
                                    LeftBottomPoint = s.LB,
3905
                                    PointSet = s.PointSet,
3906
                                    Opacity = s.Opac,
3907
                                    SignImage = null,
3908
                                    UserID = s.UserID,
3909
                                };
3910
                                instance.ApplyTemplate();
3911
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3912

    
3913
                                if (s.UserNumber != null)
3914
                                {
3915
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
3916
                                    if (_sign != null)
3917
                                    {
3918
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
3919

    
3920
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
3921
                                        stream.Write(imageBytes, 0, imageBytes.Length);
3922
                                        stream.Position = 0;
3923
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
3924
                                        BitmapImage returnImage = new BitmapImage();
3925
                                        returnImage.BeginInit();
3926
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
3927
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
3928
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
3929
                                        returnImage.StreamSource = ms;
3930
                                        returnImage.EndInit();
3931
                                        stream.Close();
3932
                                        instance.SignImage = returnImage;
3933
                                    }
3934
                                }
3935

    
3936
                                instance.Memo = s.Memo;
3937
                                //Layer.Children.Add(instance);
3938
                                instance.MarkupInfoID = markupInfoID;
3939
                                baseLayer.Add(instance);
3940
                                instance.ApplyTemplate();
3941
                                instance.SetImage();
3942

    
3943
                                //baseLayer.Add(instance);
3944
                                //instance.ApplyTemplate();
3945
                                //instance.SetImage();
3946
                                //return_control = instance;
3947
                            }
3948
                            break;
3949
                        #endregion
3950
                        #region Ink
3951
                        case "InkPresenter":
3952
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
3953
                            {
3954
#if SILVERLIGHT
3955
                                this._InkBoard.Strokes = s.SCC; 
3956
#endif
3957
                            }
3958
                            break;
3959
                        #endregion
3960
                        #region Date
3961
                        case "DateControl":
3962
                            {
3963
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
3964
                                {
3965
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3966
                                    DateControl instance = new DateControl
3967
                                    {
3968
                                        Angle = s.Angle,
3969
                                        StartPoint = s.StartPoint,
3970
                                        EndPoint = s.EndPoint,
3971
                                        LeftBottomPoint = s.LB,
3972
                                        TopRightPoint = s.TR,
3973
                                        Opacity = s.Opac,
3974
                                        FontColor = _SetColor,
3975
                                        LineSize = Convert.ToDouble(data2.First()),
3976
                                        Text = s.Text,
3977
                                        PointSet = s.PointSet,
3978
                                        UserID = s.UserID
3979
                                    };
3980
                                    instance.Memo = s.Memo;
3981
                                    instance.MarkupInfoID = markupInfoID;
3982
                                    //Layer.Children.Add(instance);
3983
                                    baseLayer.Add(instance);
3984
                                    instance.ApplyTemplate();
3985
                                    instance.SetDate();
3986
                                }
3987
                            }
3988
                            break;
3989
                        #endregion
3990
                        #region Symbol
3991
                        case "SymControl":
3992
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
3993
                            {
3994
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3995
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
3996
                                SymControl instance = new SymControl()
3997
                                {
3998
                                    LineSize = Convert.ToDouble(data2.First()),
3999
                                    PointSet = s.PointSet,
4000
                                    Paint = s.PaintState,
4001
                                    StartPoint = s.StartPoint,
4002
                                    StrokeColor = _SetColor,
4003
                                    EndPoint = s.EndPoint,
4004
                                    Angle = s.Angle,
4005
                                    LeftBottomPoint = s.LB,
4006
                                    TopRightPoint = s.TR,
4007
                                    PathData = sm.Convert(s.PathInfo.ToString()),
4008
                                    Opacity = s.Opac,
4009
                                };
4010

    
4011
                                instance.Memo = s.Memo;
4012
                                instance.MarkupInfoID = markupInfoID;
4013
                                baseLayer.Add(instance);                                
4014
                                instance.ApplyTemplate();
4015
                                instance.SetSymPath();
4016
                            }
4017
                            break;
4018
                        #endregion
4019
                        #region Image
4020
                        case "ImgControl":
4021
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
4022
                            {
4023
                                Image img = new Image();
4024
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
4025

    
4026
                                ImgControl instance = new ImgControl
4027
                                {
4028
                                    Angle = s.Angle,
4029
                                    StartPoint = s.StartPoint,
4030
                                    TopRightPoint = s.TR,
4031
                                    EndPoint = s.EndPoint,
4032
                                    LeftBottomPoint = s.LB,
4033
                                    PointSet = s.PointSet,
4034
                                    Opacity = s.Opac,
4035
                                    FilePath = s.ImagePath,
4036
                                    UserID = s.UserID,
4037
                                    ImageData = img.Source
4038
                                };
4039
                                //Layer.Children.Add(instance);
4040
                                instance.Memo = s.Memo;
4041
                                
4042
                                instance.MarkupInfoID = markupInfoID;
4043
                                baseLayer.Add(instance);
4044
                                instance.ApplyTemplate();
4045
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4046
                                instance.SetImage();
4047

    
4048
                            }
4049
                            break;
4050
                        #endregion
4051
                        #region SymbolN
4052
                        case "SymControlN":
4053
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
4054
                            {
4055
                                SymControlN instance = new SymControlN()
4056
                                {
4057
                                    PointSet = s.PointSet,
4058
                                    StartPoint = s.StartPoint,
4059
                                    EndPoint = s.EndPoint,
4060
                                    Angle = s.Angle,
4061
                                    LeftBottomPoint = s.LB,
4062
                                    TopRightPoint = s.TR,
4063
                                    Opacity = s.Opac,
4064
                                    PathXathData = s.DBData,
4065
                                };
4066
                                instance.Memo = s.Memo;
4067
                                instance.MarkupInfoID = markupInfoID;
4068
                                baseLayer.Add(instance);                                
4069
                                instance.ApplyTemplate();
4070

    
4071
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData);
4072
                                xamlData = xamlData.Replace("daelim", "DAELIM");
4073
                                xamlData = xamlData.Replace("#FFFF0000", DisplayColor);
4074
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
4075
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
4076
                                writer.Write(xamlData);
4077
                                writer.Flush();
4078
                                stream.Position = 0;
4079

    
4080
                                object obj = XamlReader.Load(stream);
4081
                                instance.Base_ViewBox.Child = obj as UIElement;
4082
                                instance.SetViewBox();
4083
                            }
4084
                            break;
4085
                        #endregion
4086
                        default:
4087
                            break;
4088
                    };
4089
                }
4090
            }
4091
        }
4092

    
4093

    
4094
        /// <summary>
4095
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
4096
        /// </summary>
4097
        /// <param name="MarkupString"></param>
4098
        public void markupParseEx(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId)
4099
        {
4100
            if (MarkupString != "False")
4101
            {
4102
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
4103
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
4104
                string[] delimiterChars = { "|DZ|" };
4105
                string[] delimiterChars2 = { "|" };
4106
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
4107
                List<string> dataSet = new List<string>();
4108

    
4109
                foreach (var dataPease in data)
4110
                {
4111
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
4112
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
4113
                    switch (unkownControl.Name)
4114
                    {
4115
                        #region ArrowText
4116
                        case "ArrowTextControl":
4117
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
4118
                            {
4119
                                ////string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4120
                                //ArrowTextControl instance = new ArrowTextControl();
4121
                                //instance.MarkupInfoID = markupInfoID;
4122
                                ////Layer.Children.Add(instance);
4123
                                //baseLayer.Add(instance);
4124
                                ////instance.LineSize = Convert.ToDouble(data2.First());
4125
                                //instance.PointSet = s.PointSet;
4126
                                //instance.StartPoint = s.StartPoint;
4127
                                //instance.EndPoint = s.EndPoint;
4128
                                //instance.StrokeColor = new SolidColorBrush(Colors.Red);
4129
                                ////instance.DashSize = s.DashSize;
4130
                                //instance.ArrowTextStyle = s.ArrowStyle;
4131
                                //instance.isHighLight = s.isHighLight;
4132
                                //instance.ArrowText = s.ArrowText;
4133
                                //instance.Opacity = s.Opac;
4134
                                //instance.BorderSize = s.BorderSize;
4135
                                //instance.BoxWidth = s.BoxWidth;
4136
                                //instance.BoxHeight = s.BoxHeight;
4137
                                //instance.isFixed = s.isFixed;
4138
                                //instance.Angle = s.Angle;
4139
                                //instance.UserID = s.UserID;
4140
                                //instance.StrokeColor = _SetColor;
4141
                                //instance.isTrans = s.isTrans;
4142
                                //instance.MidPoint = s.MidPoint;
4143
                                //instance.Memo = s.Memo;
4144
                                //if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
4145
                                //{
4146
                                //    s.fontConfig = new List<string>();
4147

    
4148
                                //    s.fontConfig.Add("Arial");
4149
                                //    s.fontConfig.Add("Normal");
4150
                                //    s.fontConfig.Add("Normal");
4151
                                //    s.fontConfig.Add("30");
4152
                                //}
4153
                                //instance.TextFamily = new FontFamily(s.fontConfig[0]);
4154
                                ////instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
4155
                                ////instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
4156
                                //instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
4157
                                //instance.ApplyTemplate();
4158
                                //instance.SetArrowTextPath();
4159
                                //instance.CommentID = commentId;
4160
                                ////instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
4161

    
4162

    
4163
                                #region 신규
4164
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4165
                                ArrowTextControl instance = new ArrowTextControl();
4166
                                instance.MarkupInfoID = markupInfoID;
4167
                                //Layer.Children.Add(instance);
4168
                                baseLayer.Add(instance);
4169
                                instance.ApplyTemplate();
4170
                                instance.LineSize = Convert.ToDouble(data2.First());
4171
                                instance.PointSet = s.PointSet;
4172
                                instance.StartPoint = s.StartPoint;
4173
                                instance.EndPoint = s.EndPoint;
4174
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
4175
                                //instance.DashSize = s.DashSize;
4176
                                instance.ArrowTextStyle = s.ArrowStyle;
4177
                                instance.isHighLight = s.isHighLight;
4178
                                instance.ArrowText = s.ArrowText;
4179
                                instance.Opacity = s.Opac;
4180
                                instance.BorderSize = s.BorderSize;
4181
                                instance.BoxWidth = s.BoxWidth;
4182
                                instance.BoxHeight = s.BoxHeight;
4183
                                instance.isFixed = s.isFixed;
4184
                                instance.Angle = s.Angle;
4185
                                instance.UserID = s.UserID;
4186
                                instance.StrokeColor = _SetColor;
4187
                                instance.isTrans = s.isTrans;
4188
                                instance.MidPoint = s.MidPoint;
4189
                                instance.Memo = s.Memo;
4190
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
4191
                                {
4192
                                    s.fontConfig = new List<string>();
4193

    
4194
                                    s.fontConfig.Add("Arial");
4195
                                    s.fontConfig.Add("Normal");
4196
                                    s.fontConfig.Add("Normal");
4197
                                    s.fontConfig.Add("30");
4198
                                }
4199

    
4200
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
4201
                                //인구 추가(2018.04.17)
4202
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
4203
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
4204
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
4205

    
4206
                                if (s.fontConfig.Count() == 5)
4207
                                {
4208
                                    instance.UnderLine = TextDecorations.Underline;
4209
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
4210
                                }
4211

    
4212
                                instance.SetArrowTextPath();
4213
                                instance.Base_TextBox.IsHitTestVisible = false;
4214
                                instance.CommentID = commentId;
4215
                                #endregion
4216

    
4217

    
4218
                            };
4219
                            break;
4220
                        #endregion
4221
                        #region Arrow_Multi
4222
                        case "ArrowControl_Multi":
4223
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
4224
                            {
4225
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4226
                                ArrowControl_Multi instance = new ArrowControl_Multi
4227
                                {
4228
                                    LineSize = Convert.ToDouble(data2.First()),
4229
                                    StartPoint = s.StartPoint,
4230
                                    MiddlePoint = s.MidPoint,
4231
                                    DashSize = s.DashSize,
4232
                                    EndPoint = s.EndPoint,
4233
                                    PointSet = s.PointSet,
4234
                                    Opacity = s.Opac,
4235
                                    StrokeColor = _SetColor,
4236
                                    UserID = s.UserID
4237
                                };
4238

    
4239
                                //Layer.Children.Add(instance);
4240
                                instance.CommentID = commentId;
4241
                                instance.MarkupInfoID = markupInfoID;
4242
                                baseLayer.Add(instance);
4243
                                instance.ApplyTemplate();
4244
                                instance.SetArrowMultiPath();
4245
                                instance.Memo = s.Memo;                                
4246
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
4247

    
4248
                            }
4249
                            break;
4250
                        #endregion
4251
                        #region Rectangle
4252
                        case "RectangleControl":
4253
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
4254
                            {
4255
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4256
                                RectangleControl instance = new RectangleControl
4257
                                {
4258
                                    LineSize = Convert.ToDouble(data2.First()),
4259
                                    Paint = s.PaintState,
4260
                                    StartPoint = s.StartPoint,
4261
                                    EndPoint = s.EndPoint,
4262
                                    Angle = s.Angle,
4263
                                    StrokeColor = _SetColor,
4264
                                    DashSize = s.DashSize,
4265
                                    Opacity = s.Opac,
4266
                                    LeftBottomPoint = s.LB,
4267
                                    TopRightPoint = s.TR,
4268
                                    PointSet = s.PointSet,
4269
                                    UserID = s.UserID
4270
                                };
4271

    
4272
                                instance.Memo = s.Memo;
4273
                                //Layer.Children.Add(instance);
4274
                                instance.CommentID = commentId;
4275
                                instance.MarkupInfoID = markupInfoID;
4276
                                baseLayer.Add(instance);
4277
                                instance.ApplyTemplate();
4278
                                instance.SetRectPath();
4279
                            }
4280
                            break;
4281
                        #endregion
4282
                        #region Triangle
4283
                        case "TriControl":
4284
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
4285
                            {
4286
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4287
                                TriControl instance = new TriControl
4288
                                {
4289
                                    LineSize = Convert.ToDouble(data2.First()),
4290
                                    MidPoint = s.MidPoint,
4291
                                    StartPoint = s.StartPoint,
4292
                                    Paint = s.Paint,
4293
                                    EndPoint = s.EndPoint,
4294
                                    Opacity = s.Opac,
4295
                                    Angle = s.Angle,
4296
                                    DashSize = s.DashSize,
4297
                                    PointSet = s.PointSet,
4298
                                    StrokeColor = _SetColor,
4299
                                    UserID = s.UserID,
4300
                                };
4301
                                instance.Memo = s.Memo;
4302
                                //Layer.Children.Add(instance);
4303
                                instance.CommentID = commentId;
4304
                                instance.MarkupInfoID = markupInfoID;
4305
                                baseLayer.Add(instance);
4306
                                instance.ApplyTemplate();
4307
                                instance.SetTri();
4308
                            }
4309
                            break;
4310
                        #endregion
4311
                        #region Cicle
4312
                        case "CircleControl":
4313
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
4314
                            {
4315
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4316
                                CircleControl instance = new CircleControl
4317
                                {
4318
                                    LineSize = Convert.ToDouble(data2.First()),
4319
                                    Paint = s.PaintState,
4320
                                    StartPoint = s.StartPoint,
4321
                                    EndPoint = s.EndPoint,
4322
                                    LeftBottomPoint = s.LBP,
4323
                                    TopRightPoint = s.TRP,
4324
                                    Opacity = s.Opac,
4325
                                    Angle = s.Angle,
4326
                                    DashSize = s.DashSize,
4327
                                    PointSet = s.PointSet,
4328
                                    StrokeColor = _SetColor,
4329
                                    UserID = s.UserID,
4330
                                };
4331
                                instance.Memo = s.Memo;
4332
                                //Layer.Children.Add(instance);
4333
                                instance.CommentID = commentId;
4334
                                instance.MarkupInfoID = markupInfoID;
4335
                                baseLayer.Add(instance);
4336
                                instance.ApplyTemplate();
4337
                                instance.SetCircle();
4338
                            }
4339
                            break;
4340
                        #endregion
4341
                        #region Poly
4342
                        case "PolygonControl":
4343
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4344
                            {
4345
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4346
                                PolygonControl instance = new PolygonControl
4347
                                {
4348
                                    LineSize = Convert.ToDouble(data2.First()),
4349
                                    //Toler = s.Toler,
4350
                                    IsCompleted = s.IsCompleted,
4351
                                    //PointSet = new List<Point>(),
4352
                                    Opacity = s.Opac,
4353
                                    StrokeColor = _SetColor,
4354
                                    StartPoint = s.StartPoint,
4355
                                    PointSet = s.PointSet,
4356
                                    EndPoint = s.EndPoint,
4357
                                    UserID = s.UserID,
4358
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4359
                                    ControlType = s.Type,
4360
                                    DashSize = s.DashSize,
4361
                                    Paint = s.PaintState,
4362
                                    //PointC = s.PointC,
4363
                                };
4364
                                //Layer.Children.Add(instance);
4365
                                instance.CommentID = commentId;
4366
                                instance.MarkupInfoID = markupInfoID;
4367
                                baseLayer.Add(instance);
4368
                                
4369
                                instance.Memo = s.Memo;
4370
                                instance.ApplyTemplate();
4371
                                instance.SetPolyPath();
4372

    
4373
                                //instance.PointSet = s.PointSet;
4374
                                //instance.ClosePath();
4375
                                //instance.ChangePaint(s.PaintState);
4376
                            }
4377
                            break;
4378
                        #endregion
4379
                        #region InkControl
4380
                        case "InkControl":
4381
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4382
                            {
4383
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4384
                                InkControl instance = new InkControl
4385
                                {
4386
                                    LineSize = Convert.ToDouble(data2.First()),
4387
                                    //Toler = s.Toler,
4388
                                    IsCompleted = s.IsCompleted,
4389
                                    //PointSet = new List<Point>(),
4390
                                    Opacity = s.Opac,
4391
                                    StrokeColor = _SetColor,
4392
                                    StartPoint = s.StartPoint,
4393
                                    PointSet = s.PointSet,
4394
                                    UserID = s.UserID,
4395
                                    EndPoint = s.EndPoint,
4396
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4397
                                    ControlType = s.Type,
4398
                                    DashSize = s.DashSize,
4399
                                    Paint = s.PaintState,
4400
                                    //PointC = s.PointC,
4401
                                };
4402
                                //Layer.Children.Add(instance);
4403
                                instance.CommentID = commentId;
4404
                                instance.MarkupInfoID = markupInfoID;
4405
                                baseLayer.Add(instance);
4406
                                
4407
                                instance.Memo = s.Memo;
4408
                                instance.ApplyTemplate();
4409
                                instance.SetPolyPath();
4410

    
4411
                                //instance.PointSet = s.PointSet;
4412
                                //instance.ClosePath();
4413
                                //instance.ChangePaint(s.PaintState);
4414
                            }
4415
                            break;
4416
                        #endregion
4417
                        #region Cloud
4418
                        case "CloudControl":
4419
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
4420
                            {
4421
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4422
                                CloudControl instance = new CloudControl
4423
                                {
4424
                                    LineSize = Convert.ToDouble(data2.First()),
4425
                                    Toler = s.Toler,
4426
                                    PointSet = new List<Point>(),
4427
                                    ArcLength = s.ArcLength,
4428
                                    Paint = s.PaintState,
4429
                                    Opacity = s.Opac,
4430
                                    StrokeColor = _SetColor,
4431
                                    isTransOn = s.IsTrans,
4432
                                    isChain = s.IsChain,
4433
                                    DashSize = s.DashSize,
4434
                                    UserID = s.UserID,
4435
                                    StartPoint = s.StartPoint,
4436
                                    EndPoint = s.EndPoint,
4437
                                    //Fill = s.CloudFill,
4438
                                };
4439
                                instance.Memo = s.Memo;
4440
                                //Layer.Children.Add(instance);
4441
                                instance.CommentID = commentId;
4442
                                instance.MarkupInfoID = markupInfoID;
4443
                                baseLayer.Add(instance);
4444
                                
4445
                                instance.PointSet = s.PointSet;
4446
                                instance.ApplyTemplate();
4447
                                instance.ClosePath();
4448
                                instance.ChangePaint(s.PaintState);
4449
                            }
4450
                            break;
4451
                        #endregion
4452
                        #region Line
4453
                        case "LineControl":
4454
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
4455
                            {
4456
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4457
                                LineControl instance = new LineControl()
4458
                                {
4459
                                    LineStyleSet = s.LineStyleSet,
4460
                                    StartPoint = s.StartPoint,
4461
                                    DimSize = s.DimSize,
4462
                                    EndPoint = s.EndPoint,
4463
                                    DashSize = s.DashSize,
4464
                                    Interval = s.Interval,
4465
                                    PointSet = s.PointSet,
4466
                                    Opacity = s.Opac,
4467
                                    StrokeColor = _SetColor,
4468
                                    UserID = s.UserID,
4469
                                    LineSize = Convert.ToDouble(data2.First()),
4470
                                };
4471
                                instance.Memo = s.Memo;
4472
                                //Layer.Children.Add(instance);
4473
                                instance.CommentID = commentId;
4474
                                instance.MarkupInfoID = markupInfoID;
4475
                                baseLayer.Add(instance);
4476
                                instance.ApplyTemplate();
4477
                                instance.SetLinePath();
4478
                            }
4479
                            break;
4480
                        #endregion
4481
                        #region Text
4482
                        case "TextControl":
4483
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
4484
                            {
4485
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4486
                                TextControl instance = new TextControl()
4487
                                {
4488
                                    Text = s.Text,
4489
                                    StartPoint = s.StartPoint,
4490
                                    EndPoint = s.EndPoint,
4491
                                    CanvasX = s.StartPoint.X,
4492
                                    CanvasY = s.StartPoint.Y,
4493
                                    BoxWidth = s.BoxW,
4494
                                    BoxHeight = s.BoxH,
4495
                                    ControlType_No = s.paintMethod,
4496
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
4497
                                    TextSize = Convert.ToDouble(data2[1]),
4498
                                    FontColor = _SetColor,
4499
                                    //FontSize = 10,
4500
                                    UserID = s.UserID,
4501
                                    //isHighLight = s.isHighLight,
4502
                                    Angle = s.Angle,
4503
                                    PointSet = s.PointSet,
4504
                                    Opacity = s.Opac,
4505
                                    TextFamily = new FontFamily(s.fontConfig[0]),
4506
                                    //인구 추가(2018.04.17)
4507
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
4508
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
4509
                                };
4510

    
4511
                                if (instance.Text != null)
4512
                                {
4513
                                    //Layer.Children.Add(instance);
4514
                                    instance.CommentID = commentId;
4515
                                    instance.MarkupInfoID = markupInfoID;
4516
                                    baseLayer.Add(instance);
4517
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
4518
                                    instance.ApplyTemplate();
4519
                                    instance.Memo = s.Memo;
4520
                                    if (s.fontConfig.Count() == 4)
4521
                                    {
4522
                                        instance.UnderLine = TextDecorations.Underline;
4523
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
4524
                                    }
4525
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
4526

    
4527
                                    //instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
4528

    
4529
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
4530
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
4531

    
4532
                                    
4533
                                    instance.DrawingCloud();
4534
                                    instance.SetText();
4535
                                }
4536
                            }
4537
                            break;
4538
                        #endregion
4539
                        #region Arc
4540
                        case "ArcControl":
4541
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
4542
                            {
4543
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4544
                                ArcControl instance = new ArcControl()
4545
                                {
4546
                                    StartPoint = s.StartPoint,
4547
                                    EndPoint = s.EndPoint,
4548
                                    DashSize = s.DashSize,
4549
                                    PointSet = s.PointSet,
4550
                                    isTransOn = s.IsTransOn,
4551
                                    MidPoint = s.MidPoint,
4552
                                    StrokeColor = _SetColor,
4553
                                    Clock = s.Clock,
4554
                                    Opacity = s.Opac,
4555
                                    LineSize = Convert.ToDouble(data2.First()),
4556
                                    UserID = s.UserID,
4557
                                };
4558
                                instance.Memo = s.Memo;
4559
                                //Layer.Children.Add(instance);
4560
                                instance.CommentID = commentId;
4561
                                instance.MarkupInfoID = markupInfoID;
4562
                                baseLayer.Add(instance);
4563
                                
4564
                                instance.ApplyTemplate();
4565
                                instance.SetArcPath();
4566
                            }
4567
                            break;
4568
                        #endregion
4569
                        #region ArrowArc
4570
                        case "ArrowArcControl":
4571
                            using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item))
4572
                            {
4573
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4574
                                ArrowArcControl instance = new ArrowArcControl()
4575
                                {
4576
                                    StartPoint = s.StartPoint,
4577
                                    EndPoint = s.EndPoint,
4578
                                    DashSize = s.DashSize,
4579
                                    PointSet = s.PointSet,
4580
                                    isTransOn = s.IsTransOn,
4581
                                    MidPoint = s.MidPoint,
4582
                                    StrokeColor = _SetColor,
4583
                                    Clock = s.Clock,
4584
                                    Opacity = s.Opac,
4585
                                    LineSize = Convert.ToDouble(data2.First()),
4586
                                    UserID = s.UserID,
4587
                                };
4588
                                instance.Memo = s.Memo;
4589
                                //Layer.Children.Add(instance);
4590
                                instance.CommentID = commentId;
4591
                                instance.MarkupInfoID = markupInfoID;
4592
                                baseLayer.Add(instance);
4593
                                
4594
                                instance.ApplyTemplate();
4595
                                instance.SetArcPath();
4596
                            }
4597
                            break;
4598
                        #endregion
4599
                        
4600
                        #region RectCloud
4601
                        case "RectCloudControl":
4602
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
4603
                            {
4604
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4605
                                RectCloudControl instance = new RectCloudControl()
4606
                                {
4607
                                    StartPoint = s.StartPoint,
4608
                                    EndPoint = s.EndPoint,
4609
                                    LeftBottomPoint = s.LB,
4610
                                    Paint = s.PaintState,
4611
                                    Opacity = s.Opac,
4612
                                    DashSize = s.DashSize,
4613
                                    TopRightPoint = s.TR,
4614
                                    PointSet = s.PointSet,
4615
                                    StrokeColor = _SetColor,
4616
                                    LineSize = Convert.ToDouble(data2.First()),
4617
                                    UserID = s.UserID,
4618
                                    ArcLength = s.ArcLength
4619
                                };
4620
                                instance.Memo = s.Memo;
4621
                                //Layer.Children.Add(instance);
4622
                                instance.CommentID = commentId;
4623
                                instance.MarkupInfoID = markupInfoID;
4624
                                baseLayer.Add(instance);
4625
                                
4626
                                instance.ApplyTemplate();
4627
                                instance.SetRectCloud();
4628
                            }
4629
                            break;
4630
                        #endregion
4631
                        #region Sign
4632
                        case "SignControl":
4633
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
4634
                            {
4635
                                SignControl instance = new SignControl
4636
                                {
4637
                                    Angle = s.Angle,
4638
                                    StartPoint = s.StartPoint,
4639
                                    TopRightPoint = s.TR,
4640
                                    EndPoint = s.EndPoint,
4641
                                    LeftBottomPoint = s.LB,
4642
                                    PointSet = s.PointSet,
4643
                                    Opacity = s.Opac,
4644
                                    SignImage = null,
4645
                                    UserID = s.UserID,
4646
                                };
4647
                                instance.ApplyTemplate();
4648
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4649

    
4650
                                if (s.UserNumber != null)
4651
                                {
4652
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
4653
                                    if (_sign != null)
4654
                                    {
4655
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
4656

    
4657
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
4658
                                        stream.Write(imageBytes, 0, imageBytes.Length);
4659
                                        stream.Position = 0;
4660
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
4661
                                        BitmapImage returnImage = new BitmapImage();
4662
                                        returnImage.BeginInit();
4663
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
4664
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
4665
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
4666
                                        returnImage.StreamSource = ms;
4667
                                        returnImage.EndInit();
4668
                                        stream.Close();
4669
                                        instance.SignImage = returnImage;
4670
                                    }
4671
                                }
4672

    
4673
                                instance.MarkupInfoID = markupInfoID;
4674
                                instance.CommentID = commentId;
4675
                                baseLayer.Add(instance);
4676
                                instance.ApplyTemplate();
4677
                                instance.SetImage();
4678
                            }
4679
                            break;
4680
                        #endregion
4681
                        #region Ink
4682
                        case "InkPresenter":
4683
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
4684
                            {
4685
#if SILVERLIGHT
4686
                                this._InkBoard.Strokes = s.SCC; 
4687
#endif
4688
                            }
4689
                            break;
4690
                        #endregion
4691
                        #region Date
4692
                        case "DateControl":
4693
                            {
4694
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
4695
                                {
4696
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4697
                                    DateControl instance = new DateControl
4698
                                    {
4699
                                        Angle = s.Angle,
4700
                                        StartPoint = s.StartPoint,
4701
                                        EndPoint = s.EndPoint,
4702
                                        LeftBottomPoint = s.LB,
4703
                                        TopRightPoint = s.TR,
4704
                                        Opacity = s.Opac,
4705
                                        FontColor = _SetColor,
4706
                                        LineSize = Convert.ToDouble(data2.First()),
4707
                                        Text = s.Text,
4708
                                        PointSet = s.PointSet,
4709
                                        UserID = s.UserID
4710
                                    };
4711
                                    instance.Memo = s.Memo;
4712
                                    //Layer.Children.Add(instance);
4713
                                    instance.MarkupInfoID = markupInfoID;
4714
                                    instance.CommentID = commentId;
4715
                                    baseLayer.Add(instance);
4716
                                    
4717
                                    instance.ApplyTemplate();
4718
                                    instance.SetDate();
4719
                                }
4720
                            }
4721
                            break;
4722
                        #endregion
4723
                        #region Symbol
4724
                        case "SymControl":
4725
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
4726
                            {
4727
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4728
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
4729
                                SymControl instance = new SymControl()
4730
                                {
4731
                                    LineSize = Convert.ToDouble(data2.First()),
4732
                                    PointSet = s.PointSet,
4733
                                    Paint = s.PaintState,
4734
                                    StartPoint = s.StartPoint,
4735
                                    StrokeColor = _SetColor,
4736
                                    EndPoint = s.EndPoint,
4737
                                    Angle = s.Angle,
4738
                                    LeftBottomPoint = s.LB,
4739
                                    TopRightPoint = s.TR,
4740
                                    PathData = sm.Convert(s.PathInfo.ToString()),
4741
                                    Opacity = s.Opac,
4742
                                };
4743

    
4744
                                instance.Memo = s.Memo;
4745
                                instance.MarkupInfoID = markupInfoID;
4746
                                instance.CommentID = commentId;
4747
                                baseLayer.Add(instance);
4748
                                instance.ApplyTemplate();
4749
                                instance.SetSymPath();
4750
                            }
4751
                            break;
4752
                        #endregion
4753
                        #region Image
4754
                        case "ImgControl":
4755
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
4756
                            {
4757
                                Image img = new Image();
4758
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
4759

    
4760
                                ImgControl instance = new ImgControl
4761
                                {
4762
                                    Angle = s.Angle,
4763
                                    StartPoint = s.StartPoint,
4764
                                    TopRightPoint = s.TR,
4765
                                    EndPoint = s.EndPoint,
4766
                                    LeftBottomPoint = s.LB,
4767
                                    PointSet = s.PointSet,
4768
                                    Opacity = s.Opac,
4769
                                    FilePath = s.ImagePath,
4770
                                    UserID = s.UserID,
4771
                                  //  ImageData = img.Source
4772
                                    
4773
                                };
4774
                                //Layer.Children.Add(instance);
4775
                                instance.Memo = s.Memo;
4776
                                
4777
                                instance.MarkupInfoID = markupInfoID;
4778
                                instance.CommentID = commentId;
4779
                                baseLayer.Add(instance);
4780

    
4781
                                instance.ApplyTemplate();
4782
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4783
                                instance.SetImage();
4784

    
4785
                            }
4786
                            break;
4787
                        #endregion
4788
                        #region SymbolN
4789
                        case "SymControlN":
4790
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
4791
                            {
4792
                                SymControlN instance = new SymControlN()
4793
                                {
4794
                                    PointSet = s.PointSet,
4795
                                    StartPoint = s.StartPoint,
4796
                                    EndPoint = s.EndPoint,
4797
                                    Angle = s.Angle,
4798
                                    LeftBottomPoint = s.LB,
4799
                                    TopRightPoint = s.TR,
4800
                                    Opacity = s.Opac,
4801
                                    PathXathData = s.DBData,
4802
                                };
4803
                                instance.Memo = s.Memo;
4804
                                instance.CommentID = commentId;
4805
                                instance.MarkupInfoID = markupInfoID;
4806
                                baseLayer.Add(instance);
4807
                                
4808
                                instance.ApplyTemplate();
4809

    
4810
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData);
4811
                                xamlData = xamlData.Replace("daelim", "DAELIM");
4812
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
4813
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
4814
                                writer.Write(xamlData);
4815
                                writer.Flush();
4816
                                stream.Position = 0;
4817

    
4818
                                object obj = XamlReader.Load(stream);
4819
                                instance.Base_ViewBox.Child = obj as UIElement;                                
4820
                                instance.SetViewBox();
4821
                            }
4822
                            break;
4823
                        #endregion
4824
                        default:
4825

    
4826
                            break;
4827
                    };
4828
                }
4829
            }
4830
        }
4831

    
4832
        //강인구 추가(12/12)
4833
        public Control markupParse_Paste(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer)
4834
        {
4835
            //GetUserSign getUser = new GetUserSign();
4836
            Control return_control = new Control();
4837
            if (MarkupString != "False")
4838
            {
4839
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(""));
4840
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
4841
                string[] delimiterChars = { "|DZ|" };
4842
                string[] delimiterChars2 = { "|" };
4843
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
4844
                List<string> dataSet = new List<string>();
4845

    
4846
                foreach (var dataPease in data)
4847
                {
4848
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
4849
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
4850
                    switch (unkownControl.Name)
4851
                    {
4852
                        #region Shape
4853
                        #region Rectangle
4854
                        case "RectangleControl":
4855
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
4856
                            {
4857
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4858
                                RectangleControl instance = new RectangleControl
4859
                                {
4860
                                    LineSize = Convert.ToDouble(data2.First()),
4861
                                    Paint = s.PaintState,
4862
                                    StartPoint = s.StartPoint,
4863
                                    EndPoint = s.EndPoint,
4864
                                    Angle = s.Angle,
4865
                                    StrokeColor = _SetColor,
4866
                                    DashSize = s.DashSize,
4867
                                    Opacity = s.Opac,
4868
                                    LeftBottomPoint = s.LB,
4869
                                    TopRightPoint = s.TR,
4870
                                    PointSet = s.PointSet,
4871
                                    UserID = s.UserID
4872
                                };
4873
                                baseLayer.Add(instance);
4874
                                instance.ApplyTemplate();
4875

    
4876
                                return_control = instance;
4877
                            }
4878
                            break;
4879
                        #endregion
4880
                        #region Triangle
4881
                        case "TriControl":
4882
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
4883
                            {
4884
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4885
                                TriControl instance = new TriControl
4886
                                {
4887
                                    LineSize = Convert.ToDouble(data2.First()),
4888
                                    MidPoint = s.MidPoint,
4889
                                    StartPoint = s.StartPoint,
4890
                                    Paint = s.Paint,
4891
                                    EndPoint = s.EndPoint,
4892
                                    Opacity = s.Opac,
4893
                                    Angle = s.Angle,
4894
                                    DashSize = s.DashSize,
4895
                                    PointSet = s.PointSet,
4896
                                    StrokeColor = _SetColor,
4897

    
4898
                                    UserID = s.UserID,
4899
                                };
4900
                                baseLayer.Add(instance);
4901
                                instance.ApplyTemplate();
4902
                                return_control = instance;
4903
                            }
4904
                            break;
4905
                        #endregion
4906
                        #region Cicle
4907
                        case "CircleControl":
4908
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
4909
                            {
4910
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4911
                                CircleControl instance = new CircleControl
4912
                                {
4913
                                    LineSize = Convert.ToDouble(data2.First()),
4914
                                    Paint = s.PaintState,
4915
                                    StartPoint = s.StartPoint,
4916
                                    EndPoint = s.EndPoint,
4917
                                    LeftBottomPoint = s.LBP,
4918
                                    TopRightPoint = s.TRP,
4919
                                    Opacity = s.Opac,
4920
                                    Angle = s.Angle,
4921
                                    DashSize = s.DashSize,
4922
                                    PointSet = s.PointSet,
4923
                                    StrokeColor = _SetColor,
4924
                                    UserID = s.UserID,
4925
                                };
4926
                                baseLayer.Add(instance);
4927
                                instance.ApplyTemplate();
4928
                                return_control = instance;
4929
                            }
4930
                            break;
4931
                        #endregion
4932
                        #region RectCloud
4933
                        case "RectCloudControl":
4934
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
4935
                            {
4936
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4937
                                RectCloudControl instance = new RectCloudControl()
4938
                                {
4939
                                    StartPoint = s.StartPoint,
4940
                                    EndPoint = s.EndPoint,
4941
                                    LeftBottomPoint = s.LB,
4942
                                    Paint = s.PaintState,
4943
                                    Opacity = s.Opac,
4944
                                    DashSize = s.DashSize,
4945
                                    TopRightPoint = s.TR,
4946
                                    PointSet = s.PointSet,
4947
                                    StrokeColor = _SetColor,
4948
                                    ArcLength = s.ArcLength,
4949
                                    LineSize = Convert.ToDouble(data2.First()),
4950
                                    UserID = s.UserID
4951
                                };
4952
                                baseLayer.Add(instance);
4953
                                instance.ApplyTemplate();
4954
                                return_control = instance;
4955
                            }
4956
                            break;
4957
                        #endregion
4958
                        #endregion
4959

    
4960
                        #region Polygon
4961
                        #region Poly
4962
                        case "PolygonControl":
4963
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4964
                            {
4965
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4966
                                PolygonControl instance = new PolygonControl
4967
                                {
4968
                                    LineSize = Convert.ToDouble(data2.First()),
4969
                                    //Toler = s.Toler,
4970
                                    IsCompleted = s.IsCompleted,
4971
                                    //PointSet = new List<Point>(),
4972
                                    Opacity = s.Opac,
4973
                                    StrokeColor = _SetColor,
4974
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4975
                                    ControlType = s.Type,
4976
                                    DashSize = s.DashSize,
4977
                                    StartPoint = s.StartPoint,
4978
                                    EndPoint = s.EndPoint,
4979
                                    PointSet = s.PointSet,
4980
                                    UserID = s.UserID,
4981
                                    Paint = s.PaintState,
4982
                                    //PointC = s.PointC,
4983
                                };
4984
                                baseLayer.Add(instance);
4985
                                instance.ApplyTemplate();
4986
                                return_control = instance;
4987
                            }
4988
                            break;
4989
                        #endregion
4990
                        #region InkControl
4991
                        case "InkControl":
4992
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4993
                            {
4994
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4995
                                InkControl instance = new InkControl
4996
                                {
4997
                                    LineSize = Convert.ToDouble(data2.First()),
4998
                                    //Toler = s.Toler,
4999
                                    IsCompleted = s.IsCompleted,
5000
                                    //PointSet = new List<Point>(),
5001
                                    Opacity = s.Opac,
5002
                                    StrokeColor = _SetColor,
5003
                                    //강인구 추가(Chain인지 Polygon인지 구분)
5004
                                    ControlType = s.Type,
5005
                                    DashSize = s.DashSize,
5006
                                    StartPoint = s.StartPoint,
5007
                                    PointSet = s.PointSet,
5008
                                    UserID = s.UserID,
5009
                                    Paint = s.PaintState,
5010
                                    EndPoint = s.EndPoint,
5011
                                    //PointC = s.PointC,
5012
                                };
5013
                                baseLayer.Add(instance);
5014
                                instance.ApplyTemplate();
5015
                                return_control = instance;
5016
                            }
5017
                            break;
5018
                        #endregion
5019
                        #region Cloud
5020
                        case "CloudControl":
5021
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
5022
                            {
5023
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5024
                                CloudControl instance = new CloudControl
5025
                                {
5026
                                    LineSize = Convert.ToDouble(data2.First()),
5027
                                    Toler = s.Toler,
5028
                                    PointSet = s.PointSet,
5029
                                    ArcLength = s.ArcLength,
5030
                                    Paint = s.PaintState,
5031
                                    Opacity = s.Opac,
5032
                                    StrokeColor = _SetColor,
5033

    
5034
                                    isTransOn = s.IsTrans,
5035
                                    isChain = s.IsChain,
5036
                                    DashSize = s.DashSize,
5037
                                    UserID = s.UserID,
5038

    
5039
                                    StartPoint = s.StartPoint,
5040
                                    EndPoint = s.EndPoint,
5041

    
5042
                                    //Fill = s.CloudFill,
5043
                                };
5044
                                //instance.PointSet = s.PointSet;
5045
                                //instance.ClosePath();
5046
                                //instance.ChangePaint(s.PaintState);
5047
                                baseLayer.Add(instance);
5048
                                instance.ApplyTemplate();
5049
                                instance.SetCloud();
5050
                                //instance.ClosePath();
5051
                                //instance.ChangePaint(s.PaintState);
5052
                                return_control = instance;
5053
                            }
5054
                            break;
5055
                        #endregion
5056
                        #endregion
5057

    
5058
                        #region Line
5059
                        #region Line
5060
                        case "LineControl":
5061
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
5062
                            {
5063
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5064
                                LineControl instance = new LineControl()
5065
                                {
5066
                                    LineStyleSet = s.LineStyleSet,
5067
                                    StartPoint = s.StartPoint,
5068
                                    DimSize = s.DimSize,
5069
                                    EndPoint = s.EndPoint,
5070
                                    DashSize = s.DashSize,
5071
                                    Interval = s.Interval,
5072
                                    PointSet = s.PointSet,
5073
                                    Opacity = s.Opac,
5074
                                    StrokeColor = _SetColor,
5075
                                    UserID = s.UserID,
5076
                                    LineSize = Convert.ToDouble(data2.First()),
5077
                                };
5078

    
5079
                                baseLayer.Add(instance);
5080
                                instance.ApplyTemplate();
5081
                                instance.SetLinePath();
5082
                                return_control = instance;
5083
                            }
5084
                            break;
5085
                        #endregion
5086
                        #region Arrow_Multi
5087
                        case "ArrowControl_Multi":
5088
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
5089
                            {
5090
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5091
                                ArrowControl_Multi instance = new ArrowControl_Multi
5092
                                {
5093
                                    LineSize = Convert.ToDouble(data2.First()),
5094
                                    StartPoint = s.StartPoint,
5095
                                    MiddlePoint = s.MidPoint,
5096
                                    DashSize = s.DashSize,
5097
                                    EndPoint = s.EndPoint,
5098
                                    PointSet = s.PointSet,
5099
                                    Opacity = s.Opac,
5100
                                    StrokeColor = _SetColor,
5101

    
5102
                                    UserID = s.UserID
5103
                                };
5104
                                baseLayer.Add(instance);
5105
                                instance.ApplyTemplate();
5106
                                instance.SetArrowMultiPath();
5107
                                return_control = instance;
5108
                            }
5109
                            break;
5110
                        #endregion
5111
                        #region Arc
5112
                        case "ArcControl":
5113
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
5114
                            {
5115
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5116
                                ArcControl instance = new ArcControl()
5117
                                {
5118
                                    StartPoint = s.StartPoint,
5119
                                    EndPoint = s.EndPoint,
5120
                                    DashSize = s.DashSize,
5121
                                    PointSet = s.PointSet,
5122
                                    isTransOn = s.IsTransOn,
5123
                                    MidPoint = s.MidPoint,
5124
                                    StrokeColor = _SetColor,
5125
                                    Opacity = s.Opac,
5126

    
5127
                                    Clock = s.Clock,
5128
                                    LineSize = Convert.ToDouble(data2.First()),
5129
                                    UserID = s.UserID,
5130
                                };
5131
                                baseLayer.Add(instance);
5132
                                instance.ApplyTemplate();
5133
                                instance.OnApplyTemplate();
5134
                                instance.SetArcPath();
5135
                                return_control = instance;
5136
                            }
5137
                            break;
5138
                        #endregion
5139
                        #region ArrowArc
5140
                        case "ArrowArcControl":
5141
                            using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item))
5142
                            {
5143
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5144
                                ArrowArcControl instance = new ArrowArcControl()
5145
                                {
5146
                                    StartPoint = s.StartPoint,
5147
                                    EndPoint = s.EndPoint,
5148
                                    DashSize = s.DashSize,
5149
                                    PointSet = s.PointSet,
5150
                                    isTransOn = s.IsTransOn,
5151
                                    MidPoint = s.MidPoint,
5152
                                    StrokeColor = _SetColor,
5153
                                    Opacity = s.Opac,
5154

    
5155
                                    Clock = s.Clock,
5156
                                    LineSize = Convert.ToDouble(data2.First()),
5157
                                    UserID = s.UserID,
5158
                                };
5159
                                baseLayer.Add(instance);
5160
                                instance.ApplyTemplate();
5161
                                instance.OnApplyTemplate();
5162
                                instance.SetArcPath();
5163
                                return_control = instance;
5164
                            }
5165
                            break;
5166
                        #endregion
5167
                        #endregion
5168
                        #region Text
5169
                        case "TextControl":
5170
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
5171
                            {
5172
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5173
                                TextControl instance = new TextControl()
5174
                                {
5175
                                    Text = s.Text,
5176
                                    StartPoint = s.StartPoint,
5177
                                    EndPoint = s.EndPoint,
5178
                                    CanvasX = s.StartPoint.X,
5179
                                    CanvasY = s.StartPoint.Y,
5180
                                    BoxWidth = s.BoxW,
5181
                                    BoxHeight = s.BoxH,
5182
                                    ControlType_No = s.paintMethod,
5183
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
5184
                                    TextSize = Convert.ToDouble(data2[1]),
5185
                                    FontColor = _SetColor,
5186
                                    FontSize = 10,
5187
                                    UserID = s.UserID,
5188
                                    //isHighLight = s.isHighLight,
5189
                                    Angle = s.Angle,
5190
                                    PointSet = s.PointSet,
5191
                                    Opacity = s.Opac,
5192
                                    TextFamily = new FontFamily(s.fontConfig[0]),
5193
                                    //인구 추가(2018.04.17)
5194
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
5195
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
5196
                                };
5197

    
5198
                                if (instance.Text != null)
5199
                                {
5200
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
5201
                                    instance.ApplyTemplate();
5202
                                    if (s.fontConfig.Count() == 4)
5203
                                    {
5204
                                        instance.UnderLine = TextDecorations.Underline;
5205
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
5206
                                    }
5207
                                }
5208
                                baseLayer.Add(instance);
5209
                                instance.ApplyTemplate();
5210

    
5211
                                instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
5212

    
5213
                                instance.Base_TextBox.Visibility = Visibility.Collapsed;
5214
                                instance.Base_TextBlock.Visibility = Visibility.Visible;
5215

    
5216
                                return_control = instance;
5217
                            }
5218
                            break;
5219
                        #endregion
5220

    
5221
                        #region ArrowText
5222
                        case "ArrowTextControl":
5223
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
5224
                            {
5225
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5226
                                ArrowTextControl instance = new ArrowTextControl();
5227
                                instance.LineSize = Convert.ToDouble(data2.First());
5228
                                instance.PointSet = s.PointSet;
5229
                                instance.StartPoint = s.StartPoint;
5230
                                instance.EndPoint = s.EndPoint;
5231
                                instance.StrokeColor = _SetColor;
5232
                                //instance.DashSize = s.DashSize;
5233
                                instance.ArrowTextStyle = s.ArrowStyle;
5234
                                instance.isHighLight = s.isHighLight;
5235
                                instance.ArrowText = s.ArrowText;
5236
                                instance.Opacity = s.Opac;
5237
                                instance.BorderSize = s.BorderSize;
5238
                                instance.BoxWidth = s.BoxWidth;
5239
                                instance.BoxHeight = s.BoxHeight;
5240
                                instance.isFixed = s.isFixed;
5241
                                instance.Angle = s.Angle;
5242
                                instance.UserID = s.UserID;
5243
                                instance.isTrans = s.isTrans;
5244
                                instance.MidPoint = s.MidPoint;
5245
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
5246
                                {
5247
                                    s.fontConfig = new List<string>();
5248

    
5249
                                    s.fontConfig.Add("Arial");
5250
                                    s.fontConfig.Add("Normal");
5251
                                    s.fontConfig.Add("Normal");
5252
                                    s.fontConfig.Add("30");
5253
                                }
5254
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
5255
                                //인구 추가(2018.04.17)
5256
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
5257
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
5258
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
5259

    
5260
                                baseLayer.Add(instance);
5261
                                instance.ApplyTemplate();
5262

    
5263
                                if (s.fontConfig.Count() == 5)
5264
                                {
5265
                                    instance.UnderLine = TextDecorations.Underline;
5266
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
5267
                                }
5268
                                instance.SetArrowTextPath();
5269
                                return_control = instance;
5270
                            };
5271
                            break;
5272
                        #endregion
5273

    
5274
                        #region ETC
5275
                        #region Ink
5276
                        case "InkPresenter":
5277
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
5278
                            {
5279

    
5280
                            }
5281
                            break;
5282
                        #endregion
5283
                        #region Date
5284
                        case "DateControl":
5285
                            {
5286
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
5287
                                {
5288
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5289
                                    DateControl instance = new DateControl
5290
                                    {
5291
                                        Angle = s.Angle,
5292
                                        StartPoint = s.StartPoint,
5293
                                        EndPoint = s.EndPoint,
5294
                                        LeftBottomPoint = s.LB,
5295
                                        TopRightPoint = s.TR,
5296
                                        Opacity = s.Opac,
5297
                                        FontColor = _SetColor,
5298
                                        LineSize = Convert.ToDouble(data2.First()),
5299
                                        Text = s.Text,
5300
                                        PointSet = s.PointSet,
5301
                                        UserID = s.UserID
5302
                                    };
5303
                                    baseLayer.Add(instance);
5304
                                    instance.ApplyTemplate();
5305
                                    return_control = instance;
5306
                                }
5307
                            }
5308
                            break;
5309
                        #endregion
5310
                        #region Image
5311
                        case "ImgControl":
5312
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
5313
                            {
5314
                                Image img = new Image();
5315
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
5316

    
5317
                                ImgControl instance = new ImgControl
5318
                                {
5319
                                    Angle = s.Angle,
5320
                                    StartPoint = s.StartPoint,
5321
                                    TopRightPoint = s.TR,
5322
                                    EndPoint = s.EndPoint,
5323
                                    LeftBottomPoint = s.LB,
5324
                                    PointSet = s.PointSet,
5325
                                    Opacity = s.Opac,
5326
                                    FilePath = s.ImagePath,
5327
                                    UserID = s.UserID,
5328
                                    ImageData = img.Source
5329
                                };
5330

    
5331
                                instance.ApplyTemplate();
5332
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5333
                                baseLayer.Add(instance);
5334
                                instance.ApplyTemplate();
5335
                                instance.SetImage();
5336
                                return_control = instance;
5337
                            }
5338
                            break;
5339
                        #endregion
5340
                        #region Sign
5341
                        case "SignControl":
5342
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
5343
                            {
5344
                                SignControl instance = new SignControl
5345
                                {
5346
                                    Angle = s.Angle,
5347
                                    StartPoint = s.StartPoint,
5348
                                    TopRightPoint = s.TR,
5349
                                    EndPoint = s.EndPoint,
5350
                                    LeftBottomPoint = s.LB,
5351
                                    PointSet = s.PointSet,
5352
                                    Opacity = s.Opac,
5353
                                    SignImage = null,
5354
                                    UserID = s.UserID,
5355
                                };
5356
                                instance.ApplyTemplate();
5357
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5358

    
5359
                                if (s.UserNumber != null)
5360
                                {
5361
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
5362
                                    if (_sign != null)
5363
                                    {
5364
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
5365

    
5366
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
5367
                                        stream.Write(imageBytes, 0, imageBytes.Length);
5368
                                        stream.Position = 0;
5369
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
5370
                                        BitmapImage returnImage = new BitmapImage();
5371
                                        returnImage.BeginInit();
5372
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
5373
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
5374
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
5375
                                        returnImage.StreamSource = ms;
5376
                                        returnImage.EndInit();
5377
                                        stream.Close();
5378
                                        instance.SignImage = returnImage;
5379
                                    }
5380
                                }
5381

    
5382
                                baseLayer.Add(instance);
5383
                                instance.ApplyTemplate();
5384
                                instance.SetImage();
5385
                                return_control = instance;
5386
                            }
5387
                            break;
5388
                        #endregion
5389
                        #region Symbol
5390
                        case "SymControl":
5391
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
5392
                            {
5393
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5394
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
5395
                                SymControl instance = new SymControl
5396
                                {
5397
                                    //Angle = s.Angle,
5398
                                    //StartPoint = s.StartPoint,
5399
                                    //TopRightPoint = s.TR,
5400
                                    //EndPoint = s.EndPoint,
5401
                                    //LeftBottomPoint = s.LB,
5402
                                    //PointSet = s.PointSet,
5403
                                    //Opacity = s.Opac,
5404
                                    //FilePath = s.ImagePath,
5405
                                    //UserID = s.UserID,
5406
                                    //ImageData = s.ImageData
5407
                                    LineSize = Convert.ToDouble(data2.First()),
5408
                                    PointSet = s.PointSet,
5409
                                    Paint = s.PaintState,
5410
                                    StartPoint = s.StartPoint,
5411
                                    StrokeColor = _SetColor,
5412
                                    EndPoint = s.EndPoint,
5413
                                    Angle = s.Angle,
5414
                                    UserID = s.UserID,
5415
                                    LeftBottomPoint = s.LB,
5416
                                    TopRightPoint = s.TR,
5417
                                    PathData = sm.Convert(s.PathInfo.ToString()),
5418
                                    Opacity = s.Opac,
5419
                                };
5420

    
5421
                                baseLayer.Add(instance);
5422
                                //instance.OnApplyTemplate();
5423
                                instance.ApplyTemplate();
5424
                                instance.SetSymPath();
5425
                                return_control = instance;
5426
                            }
5427
                            break;
5428
                        #endregion
5429

    
5430
                        #region SymbolN
5431
                        case "SymControlN":
5432
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
5433
                            {
5434
                                SymControlN instance = new SymControlN()
5435
                                {
5436
                                    PointSet = s.PointSet,
5437
                                    StartPoint = s.StartPoint,
5438
                                    EndPoint = s.EndPoint,
5439
                                    Angle = s.Angle,
5440
                                    LeftBottomPoint = s.LB,
5441
                                    TopRightPoint = s.TR,
5442
                                    Opacity = s.Opac,
5443
                                    PathXathData = s.DBData,
5444
                                };
5445
                                instance.Memo = s.Memo;
5446
                                baseLayer.Add(instance);
5447
                                instance.ApplyTemplate();
5448

    
5449
                                return_control = instance;
5450

    
5451
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
5452
                                //instance.PathXathData = s.DBData;
5453

    
5454
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
5455
                                //xamlData = xamlData.Replace("daelim", "DAELIM");
5456
                                //System.IO.MemoryStream stream = new System.IO.MemoryStream();
5457
                                //System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
5458
                                //writer.Write(xamlData);
5459
                                //writer.Flush();
5460
                                //stream.Position = 0;
5461

    
5462
                                //object obj = XamlReader.Load(stream);
5463
                                //instance.Base_ViewBox.Child = obj as UIElement;
5464
                                //instance.PathXathData = appovalData;
5465
                                //instance.SetViewBox();
5466
                            }
5467
                            break;
5468
                        #endregion
5469
                        #endregion 
5470
                        default:
5471
                            break;
5472
                    };
5473
                }
5474
            }
5475
            return return_control;
5476
        }
5477

    
5478
        public S_BaseControl markupParse_GetBaseControl(string MarkupString)
5479
        {
5480
            var item = JsonSerializerHelper.UnCompressString(MarkupString); //언패킹작업
5481
            var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
5482
            return unknownData;
5483
        }
5484
        
5485
        //Temp
5486
        public Control TempMarkupParseEx(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId)
5487
        {
5488
            Control return_control = new Control();
5489
            if (MarkupString != "False")
5490
            {   
5491
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
5492
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
5493
                string[] delimiterChars = { "|DZ|" };
5494
                string[] delimiterChars2 = { "|" };
5495
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
5496
                List<string> dataSet = new List<string>();
5497

    
5498
                foreach (var dataPease in data)
5499
                {
5500
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
5501
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
5502
                    switch (unkownControl.Name)
5503
                    {
5504
                        #region ArrowText
5505
                        case "ArrowTextControl":
5506
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
5507
                            {
5508
                                #region 신규
5509
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5510
                                ArrowTextControl instance = new ArrowTextControl();
5511
                                instance.MarkupInfoID = markupInfoID;
5512
                                //Layer.Children.Add(instance);
5513
                                baseLayer.Add(instance);
5514
                                instance.ApplyTemplate();
5515
                                instance.LineSize = Convert.ToDouble(data2.First());
5516
                                instance.PointSet = s.PointSet;
5517
                                instance.StartPoint = s.StartPoint;
5518
                                instance.EndPoint = s.EndPoint;
5519
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
5520
                                //instance.DashSize = s.DashSize;
5521
                                instance.ArrowTextStyle = s.ArrowStyle;
5522
                                instance.isHighLight = s.isHighLight;
5523
                                instance.ArrowText = s.ArrowText;
5524
                                instance.Opacity = s.Opac;
5525
                                instance.BorderSize = s.BorderSize;
5526
                                instance.BoxWidth = s.BoxWidth;
5527
                                instance.BoxHeight = s.BoxHeight;
5528
                                instance.isFixed = s.isFixed;
5529
                                instance.Angle = s.Angle;
5530
                                instance.UserID = s.UserID;
5531
                                instance.StrokeColor = _SetColor;
5532
                                instance.isTrans = s.isTrans;
5533
                                instance.MidPoint = s.MidPoint;
5534
                                instance.Memo = s.Memo;
5535
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
5536
                                {
5537
                                    s.fontConfig = new List<string>();
5538

    
5539
                                    s.fontConfig.Add("Arial");
5540
                                    s.fontConfig.Add("Normal");
5541
                                    s.fontConfig.Add("Normal");
5542
                                    s.fontConfig.Add("30");
5543
                                }
5544

    
5545
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
5546
                                //인구 추가(2018.04.17)
5547
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
5548
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
5549
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
5550

    
5551
                                if (s.fontConfig.Count() == 5)
5552
                                {
5553
                                    instance.UnderLine = TextDecorations.Underline;
5554
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
5555
                                }
5556

    
5557
                                instance.SetArrowTextPath();
5558
                                instance.Base_TextBox.IsHitTestVisible = false;
5559
                                instance.CommentID = commentId;
5560
                                #endregion
5561

    
5562

    
5563
                                return_control = instance;
5564

    
5565
                            };
5566
                            break;
5567
                        #endregion
5568
                        #region Arrow_Multi
5569
                        case "ArrowControl_Multi":
5570
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
5571
                            {
5572
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5573
                                ArrowControl_Multi instance = new ArrowControl_Multi
5574
                                {
5575
                                    LineSize = Convert.ToDouble(data2.First()),
5576
                                    StartPoint = s.StartPoint,
5577
                                    MiddlePoint = s.MidPoint,
5578
                                    DashSize = s.DashSize,
5579
                                    EndPoint = s.EndPoint,
5580
                                    PointSet = s.PointSet,
5581
                                    Opacity = s.Opac,
5582
                                    StrokeColor = _SetColor,
5583
                                    UserID = s.UserID
5584
                                };
5585

    
5586
                                //Layer.Children.Add(instance);
5587
                                instance.Memo = s.Memo;
5588
                                instance.CommentID = commentId;
5589
                                instance.MarkupInfoID = markupInfoID;
5590
                                baseLayer.Add(instance);
5591
                                instance.ApplyTemplate();
5592
                                instance.SetArrowMultiPath();                                
5593
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
5594
                                
5595
                                return_control = instance;
5596
                            }
5597
                            break;
5598
                        #endregion
5599
                        #region Rectangle
5600
                        case "RectangleControl":
5601
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
5602
                            {
5603
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5604
                                RectangleControl instance = new RectangleControl
5605
                                {
5606
                                    LineSize = Convert.ToDouble(data2.First()),
5607
                                    Paint = s.PaintState,
5608
                                    StartPoint = s.StartPoint,
5609
                                    EndPoint = s.EndPoint,
5610
                                    Angle = s.Angle,
5611
                                    StrokeColor = _SetColor,
5612
                                    DashSize = s.DashSize,
5613
                                    Opacity = s.Opac,
5614
                                    LeftBottomPoint = s.LB,
5615
                                    TopRightPoint = s.TR,
5616
                                    PointSet = s.PointSet,
5617
                                    UserID = s.UserID
5618
                                };
5619

    
5620
                                instance.Memo = s.Memo;
5621
                                //Layer.Children.Add(instance);
5622
                                instance.CommentID = commentId;
5623
                                instance.MarkupInfoID = markupInfoID;
5624
                                baseLayer.Add(instance);
5625
                                instance.ApplyTemplate();
5626
                                instance.SetRectPath();
5627

    
5628
                                return_control = instance;
5629
                            }
5630
                            break;
5631
                        #endregion
5632
                        #region Triangle
5633
                        case "TriControl":
5634
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
5635
                            {
5636
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5637
                                TriControl instance = new TriControl
5638
                                {
5639
                                    LineSize = Convert.ToDouble(data2.First()),
5640
                                    MidPoint = s.MidPoint,
5641
                                    StartPoint = s.StartPoint,
5642
                                    Paint = s.Paint,
5643
                                    EndPoint = s.EndPoint,
5644
                                    Opacity = s.Opac,
5645
                                    Angle = s.Angle,
5646
                                    DashSize = s.DashSize,
5647
                                    PointSet = s.PointSet,
5648
                                    StrokeColor = _SetColor,
5649
                                    UserID = s.UserID,
5650
                                };
5651
                                instance.Memo = s.Memo;
5652
                                //Layer.Children.Add(instance);
5653
                                instance.CommentID = commentId;
5654
                                instance.MarkupInfoID = markupInfoID;
5655
                                baseLayer.Add(instance);
5656
                                instance.ApplyTemplate();
5657
                                instance.SetTri();
5658
                                return_control = instance;
5659
                            }
5660
                            break;
5661
                        #endregion
5662
                        #region Cicle
5663
                        case "CircleControl":
5664
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
5665
                            {
5666
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5667
                                CircleControl instance = new CircleControl
5668
                                {
5669
                                    LineSize = Convert.ToDouble(data2.First()),
5670
                                    Paint = s.PaintState,
5671
                                    StartPoint = s.StartPoint,
5672
                                    EndPoint = s.EndPoint,
5673
                                    LeftBottomPoint = s.LBP,
5674
                                    TopRightPoint = s.TRP,
5675
                                    Opacity = s.Opac,
5676
                                    Angle = s.Angle,
5677
                                    DashSize = s.DashSize,
5678
                                    PointSet = s.PointSet,
5679
                                    StrokeColor = _SetColor,
5680
                                    UserID = s.UserID,
5681
                                };
5682
                                instance.Memo = s.Memo;
5683
                                //Layer.Children.Add(instance);
5684
                                instance.CommentID = commentId;
5685
                                instance.MarkupInfoID = markupInfoID;
5686
                                baseLayer.Add(instance);
5687
                                instance.ApplyTemplate();
5688
                                instance.SetCircle();
5689
                                return_control = instance;
5690
                            }
5691
                            break;
5692
                        #endregion
5693
                        #region Poly
5694
                        case "PolygonControl":
5695
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
5696
                            {
5697
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5698
                                PolygonControl instance = new PolygonControl
5699
                                {
5700
                                    LineSize = Convert.ToDouble(data2.First()),
5701
                                    //Toler = s.Toler,
5702
                                    IsCompleted = s.IsCompleted,
5703
                                    //PointSet = new List<Point>(),
5704
                                    Opacity = s.Opac,
5705
                                    StrokeColor = _SetColor,
5706
                                    StartPoint = s.StartPoint,
5707
                                    PointSet = s.PointSet,
5708
                                    EndPoint = s.EndPoint,
5709
                                    UserID = s.UserID,
5710
                                    //강인구 추가(Chain인지 Polygon인지 구분)
5711
                                    ControlType = s.Type,
5712
                                    DashSize = s.DashSize,
5713
                                    Paint = s.PaintState,
5714
                                    //PointC = s.PointC,
5715
                                };
5716
                                //Layer.Children.Add(instance);
5717
                                instance.CommentID = commentId;
5718
                                instance.MarkupInfoID = markupInfoID;
5719
                                baseLayer.Add(instance);
5720
                                
5721
                                instance.Memo = s.Memo;
5722
                                instance.ApplyTemplate();
5723
                                instance.SetPolyPath();
5724
                                return_control = instance;
5725
                                //instance.PointSet = s.PointSet;
5726
                                //instance.ClosePath();
5727
                                //instance.ChangePaint(s.PaintState);
5728
                            }
5729
                            break;
5730
                        #endregion
5731
                        #region InkControl
5732
                        case "InkControl":
5733
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
5734
                            {
5735
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5736
                                InkControl instance = new InkControl
5737
                                {
5738
                                    LineSize = Convert.ToDouble(data2.First()),
5739
                                    //Toler = s.Toler,
5740
                                    IsCompleted = s.IsCompleted,
5741
                                    //PointSet = new List<Point>(),
5742
                                    Opacity = s.Opac,
5743
                                    StrokeColor = _SetColor,
5744
                                    StartPoint = s.StartPoint,
5745
                                    PointSet = s.PointSet,
5746
                                    UserID = s.UserID,
5747
                                    EndPoint = s.EndPoint,
5748
                                    //강인구 추가(Chain인지 Polygon인지 구분)
5749
                                    ControlType = s.Type,
5750
                                    DashSize = s.DashSize,
5751
                                    Paint = s.PaintState,
5752
                                    //PointC = s.PointC,
5753
                                };
5754
                                //Layer.Children.Add(instance);
5755
                                instance.CommentID = commentId;
5756
                                instance.MarkupInfoID = markupInfoID;
5757
                                baseLayer.Add(instance);
5758
                                
5759
                                instance.Memo = s.Memo;
5760
                                instance.ApplyTemplate();
5761
                                instance.SetPolyPath();
5762
                                return_control = instance;
5763
                                //instance.PointSet = s.PointSet;
5764
                                //instance.ClosePath();
5765
                                //instance.ChangePaint(s.PaintState);
5766
                            }
5767
                            break;
5768
                        #endregion
5769
                        #region Cloud
5770
                        case "CloudControl":
5771
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
5772
                            {
5773
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5774
                                CloudControl instance = new CloudControl
5775
                                {
5776
                                    LineSize = Convert.ToDouble(data2.First()),
5777
                                    Toler = s.Toler,
5778
                                    PointSet = new List<Point>(),
5779
                                    ArcLength = s.ArcLength,
5780
                                    Paint = s.PaintState,
5781
                                    Opacity = s.Opac,
5782
                                    StrokeColor = _SetColor,
5783
                                    isTransOn = s.IsTrans,
5784
                                    isChain = s.IsChain,
5785
                                    DashSize = s.DashSize,
5786
                                    UserID = s.UserID,
5787
                                    StartPoint = s.StartPoint,
5788
                                    EndPoint = s.EndPoint,
5789
                                    //Fill = s.CloudFill,
5790
                                };
5791
                                instance.Memo = s.Memo;
5792
                                //Layer.Children.Add(instance);
5793
                                instance.CommentID = commentId;
5794
                                instance.MarkupInfoID = markupInfoID;
5795
                                baseLayer.Add(instance);
5796
                                
5797
                                instance.PointSet = s.PointSet;
5798
                                instance.ApplyTemplate();
5799
                                instance.ClosePath();
5800
                                instance.ChangePaint(s.PaintState);
5801
                                return_control = instance;
5802
                            }
5803
                            break;
5804
                        #endregion
5805
                        #region Line
5806
                        case "LineControl":
5807
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
5808
                            {
5809
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5810
                                LineControl instance = new LineControl()
5811
                                {
5812
                                    LineStyleSet = s.LineStyleSet,
5813
                                    StartPoint = s.StartPoint,
5814
                                    DimSize = s.DimSize,
5815
                                    EndPoint = s.EndPoint,
5816
                                    DashSize = s.DashSize,
5817
                                    Interval = s.Interval,
5818
                                    PointSet = s.PointSet,
5819
                                    Opacity = s.Opac,
5820
                                    StrokeColor = _SetColor,
5821
                                    UserID = s.UserID,
5822
                                    LineSize = Convert.ToDouble(data2.First()),
5823
                                };
5824
                                instance.Memo = s.Memo;
5825
                                //Layer.Children.Add(instance);
5826
                                instance.CommentID = commentId;
5827
                                instance.MarkupInfoID = markupInfoID;
5828
                                baseLayer.Add(instance);
5829
                                instance.ApplyTemplate();
5830
                                instance.SetLinePath();
5831
                                return_control = instance;
5832
                            }
5833
                            break;
5834
                        #endregion
5835
                        #region Text
5836
                        case "TextControl":
5837
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
5838
                            {
5839
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5840
                                TextControl instance = new TextControl()
5841
                                {
5842
                                    Text = s.Text,
5843
                                    StartPoint = s.StartPoint,
5844
                                    EndPoint = s.EndPoint,
5845
                                    CanvasX = s.StartPoint.X,
5846
                                    CanvasY = s.StartPoint.Y,
5847
                                    BoxWidth = s.BoxW,
5848
                                    BoxHeight = s.BoxH,
5849
                                    ControlType_No = s.paintMethod,
5850
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
5851
                                    TextSize = Convert.ToDouble(data2[1]),
5852
                                    FontColor = _SetColor,
5853
                                    //FontSize = 10,
5854
                                    UserID = s.UserID,
5855
                                    //isHighLight = s.isHighLight,
5856
                                    Angle = s.Angle,
5857
                                    PointSet = s.PointSet,
5858
                                    Opacity = s.Opac,
5859
                                    TextFamily = new FontFamily(s.fontConfig[0]),
5860
                                    //인구 추가(2018.04.17)
5861
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
5862
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
5863
                                };
5864

    
5865
                                if (instance.Text != null)
5866
                                {
5867
                                    //Layer.Children.Add(instance);
5868
                                    instance.MarkupInfoID = markupInfoID;
5869
                                    baseLayer.Add(instance);
5870
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
5871
                                    instance.ApplyTemplate();
5872
                                    instance.Memo = s.Memo;
5873
                                    if (s.fontConfig.Count() == 4)
5874
                                    {
5875
                                        instance.UnderLine = TextDecorations.Underline;
5876
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
5877
                                    }
5878
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
5879

    
5880
                                    //instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
5881

    
5882
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
5883
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
5884

    
5885
                                    instance.CommentID = commentId;
5886
                                    instance.DrawingCloud();
5887
                                    instance.SetText();
5888
                                    return_control = instance;
5889
                                }
5890
                            }
5891
                            break;
5892
                        #endregion
5893
                        #region Arc
5894
                        case "ArcControl":
5895
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
5896
                            {
5897
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5898
                                ArcControl instance = new ArcControl()
5899
                                {
5900
                                    StartPoint = s.StartPoint,
5901
                                    EndPoint = s.EndPoint,
5902
                                    DashSize = s.DashSize,
5903
                                    PointSet = s.PointSet,
5904
                                    isTransOn = s.IsTransOn,
5905
                                    MidPoint = s.MidPoint,
5906
                                    StrokeColor = _SetColor,
5907
                                    Clock = s.Clock,
5908
                                    Opacity = s.Opac,
5909
                                    LineSize = Convert.ToDouble(data2.First()),
5910
                                    UserID = s.UserID,
5911
                                };
5912
                                instance.Memo = s.Memo;
5913
                                //Layer.Children.Add(instance);
5914
                                instance.MarkupInfoID = markupInfoID;
5915
                                instance.CommentID = commentId;
5916
                                baseLayer.Add(instance);
5917
                                
5918
                                instance.ApplyTemplate();
5919
                                instance.SetArcPath();
5920
                                return_control = instance;
5921
                            }
5922
                            break;
5923
                        #endregion
5924
                        #region Arc
5925
                        case "ArrowArcControl":
5926
                            using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item))
5927
                            {
5928
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5929
                                ArrowArcControl instance = new ArrowArcControl()
5930
                                {
5931
                                    StartPoint = s.StartPoint,
5932
                                    EndPoint = s.EndPoint,
5933
                                    DashSize = s.DashSize,
5934
                                    PointSet = s.PointSet,
5935
                                    isTransOn = s.IsTransOn,
5936
                                    MidPoint = s.MidPoint,
5937
                                    StrokeColor = _SetColor,
5938
                                    Clock = s.Clock,
5939
                                    Opacity = s.Opac,
5940
                                    LineSize = Convert.ToDouble(data2.First()),
5941
                                    UserID = s.UserID,
5942
                                };
5943
                                instance.Memo = s.Memo;
5944
                                //Layer.Children.Add(instance);
5945
                                instance.MarkupInfoID = markupInfoID;
5946
                                instance.CommentID = commentId;
5947
                                baseLayer.Add(instance);
5948
                                
5949
                                instance.ApplyTemplate();
5950
                                instance.SetArcPath();
5951
                                return_control = instance;
5952
                            }
5953
                            break;
5954
                        #endregion
5955
                        #region RectCloud
5956
                        case "RectCloudControl":
5957
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
5958
                            {
5959
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5960
                                RectCloudControl instance = new RectCloudControl()
5961
                                {
5962
                                    StartPoint = s.StartPoint,
5963
                                    EndPoint = s.EndPoint,
5964
                                    LeftBottomPoint = s.LB,
5965
                                    Paint = s.PaintState,
5966
                                    Opacity = s.Opac,
5967
                                    DashSize = s.DashSize,
5968
                                    TopRightPoint = s.TR,
5969
                                    PointSet = s.PointSet,
5970
                                    StrokeColor = _SetColor,
5971
                                    LineSize = Convert.ToDouble(data2.First()),
5972
                                    UserID = s.UserID,
5973
                                    ArcLength = s.ArcLength
5974
                                };
5975
                                instance.Memo = s.Memo;
5976
                                //Layer.Children.Add(instance);
5977
                                instance.MarkupInfoID = markupInfoID;
5978
                                instance.CommentID = commentId;
5979
                                baseLayer.Add(instance);
5980
                                
5981
                                instance.ApplyTemplate();
5982
                                instance.SetRectCloud();
5983
                                return_control = instance;
5984
                            }
5985
                            break;
5986
                        #endregion
5987
                        #region Sign
5988
                        case "SignControl":
5989
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
5990
                            {
5991
                                SignControl instance = new SignControl
5992
                                {
5993
                                    Angle = s.Angle,
5994
                                    StartPoint = s.StartPoint,
5995
                                    TopRightPoint = s.TR,
5996
                                    EndPoint = s.EndPoint,
5997
                                    LeftBottomPoint = s.LB,
5998
                                    PointSet = s.PointSet,
5999
                                    Opacity = s.Opac,
6000
                                    SignImage = null,
6001
                                    UserID = s.UserID,
6002
                                };
6003
                                instance.ApplyTemplate();
6004
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
6005

    
6006
                                if (s.UserNumber != null)
6007
                                {
6008
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
6009
                                    if (_sign != null)
6010
                                    {
6011
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
6012

    
6013
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
6014
                                        stream.Write(imageBytes, 0, imageBytes.Length);
6015
                                        stream.Position = 0;
6016
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
6017
                                        BitmapImage returnImage = new BitmapImage();
6018
                                        returnImage.BeginInit();
6019
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
6020
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
6021
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
6022
                                        returnImage.StreamSource = ms;
6023
                                        returnImage.EndInit();
6024
                                        stream.Close();
6025
                                        instance.SignImage = returnImage;
6026
                                    }
6027
                                }
6028

    
6029
                                instance.MarkupInfoID = markupInfoID;
6030
                                instance.CommentID = commentId;
6031
                                baseLayer.Add(instance);
6032
                                instance.ApplyTemplate();
6033
                                instance.SetImage();
6034
                                return_control = instance;
6035
                            }
6036
                            break;
6037
                        #endregion
6038
                        #region Ink
6039
                        case "InkPresenter":
6040
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
6041
                            {
6042
#if SILVERLIGHT
6043
                                this._InkBoard.Strokes = s.SCC; 
6044
#endif
6045
                            }
6046
                            break;
6047
                        #endregion
6048
                        #region Date
6049
                        case "DateControl":
6050
                            {
6051
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
6052
                                {
6053
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
6054
                                    DateControl instance = new DateControl
6055
                                    {
6056
                                        Angle = s.Angle,
6057
                                        StartPoint = s.StartPoint,
6058
                                        EndPoint = s.EndPoint,
6059
                                        LeftBottomPoint = s.LB,
6060
                                        TopRightPoint = s.TR,
6061
                                        Opacity = s.Opac,
6062
                                        FontColor = _SetColor,
6063
                                        LineSize = Convert.ToDouble(data2.First()),
6064
                                        Text = s.Text,
6065
                                        PointSet = s.PointSet,
6066
                                        UserID = s.UserID
6067
                                    };
6068
                                    instance.Memo = s.Memo;
6069
                                    //Layer.Children.Add(instance);
6070
                                    instance.CommentID = commentId;
6071
                                    instance.MarkupInfoID = markupInfoID;
6072
                                    baseLayer.Add(instance);
6073
                                    
6074
                                    instance.ApplyTemplate();
6075
                                    instance.SetDate();
6076
                                    return_control = instance;
6077
                                }
6078
                            }
6079
                            break;
6080
                        #endregion
6081
                        #region Symbol
6082
                        case "SymControl":
6083
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
6084
                            {
6085
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
6086
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
6087
                                SymControl instance = new SymControl()
6088
                                {
6089
                                    LineSize = Convert.ToDouble(data2.First()),
6090
                                    PointSet = s.PointSet,
6091
                                    Paint = s.PaintState,
6092
                                    StartPoint = s.StartPoint,
6093
                                    StrokeColor = _SetColor,
6094
                                    EndPoint = s.EndPoint,
6095
                                    Angle = s.Angle,
6096
                                    LeftBottomPoint = s.LB,
6097
                                    TopRightPoint = s.TR,
6098
                                    PathData = sm.Convert(s.PathInfo.ToString()),
6099
                                    Opacity = s.Opac,
6100
                                };
6101

    
6102
                                instance.Memo = s.Memo;
6103
                                
6104
                                instance.CommentID = commentId;
6105
                                instance.MarkupInfoID = markupInfoID;
6106
                                baseLayer.Add(instance);
6107
                                instance.ApplyTemplate();
6108
                                instance.SetSymPath();
6109
                                return_control = instance;
6110
                            }
6111
                            break;
6112
                        #endregion
6113
                        #region Image
6114
                        case "ImgControl":
6115
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
6116
                            {
6117
                                Image img = new Image();
6118
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
6119

    
6120
                                ImgControl instance = new ImgControl
6121
                                {
6122
                                    Angle = s.Angle,
6123
                                    StartPoint = s.StartPoint,
6124
                                    TopRightPoint = s.TR,
6125
                                    EndPoint = s.EndPoint,
6126
                                    LeftBottomPoint = s.LB,
6127
                                    PointSet = s.PointSet,
6128
                                    Opacity = s.Opac,
6129
                                    FilePath = s.ImagePath,
6130
                                    UserID = s.UserID,
6131
                                    ImageData = img.Source
6132
                                };
6133
                                //Layer.Children.Add(instance);
6134
                                instance.Memo = s.Memo;
6135
                                
6136
                                instance.CommentID = commentId;
6137
                                instance.MarkupInfoID = markupInfoID;
6138
                                baseLayer.Add(instance);
6139
                                instance.ApplyTemplate();
6140
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
6141
                                instance.SetImage();
6142
                                return_control = instance;
6143
                            }
6144
                            break;
6145
                        #endregion
6146
                        #region SymbolN
6147
                        case "SymControlN":
6148
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
6149
                            {
6150
                                SymControlN instance = new SymControlN()
6151
                                {
6152
                                    PointSet = s.PointSet,
6153
                                    StartPoint = s.StartPoint,
6154
                                    EndPoint = s.EndPoint,
6155
                                    Angle = s.Angle,
6156
                                    LeftBottomPoint = s.LB,
6157
                                    TopRightPoint = s.TR,
6158
                                    Opacity = s.Opac,
6159
                                    PathXathData = s.DBData,
6160
                                };
6161
                                instance.Memo = s.Memo;
6162
                                instance.CommentID = commentId;
6163
                                instance.MarkupInfoID = markupInfoID;
6164
                                baseLayer.Add(instance);
6165
                                
6166
                                instance.ApplyTemplate();
6167

    
6168
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData);
6169
                                xamlData = xamlData.Replace("daelim", "DAELIM");
6170
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
6171
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
6172
                                writer.Write(xamlData);
6173
                                writer.Flush();
6174
                                stream.Position = 0;
6175

    
6176
                                object obj = XamlReader.Load(stream);
6177
                                instance.Base_ViewBox.Child = obj as UIElement;
6178
                                instance.SetViewBox();
6179
                                return_control = instance;
6180
                            }
6181
                            break;
6182
                        #endregion
6183
                        default:
6184

    
6185
                            break;
6186
                    };
6187
                }
6188
            }
6189
            return return_control;
6190
        }
6191

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