프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Controls / Parsing / MarkupParse.cs.bak @ 40d88a02

이력 | 보기 | 이력해설 | 다운로드 (312 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
                                    UserID = s.UserID
2924
                                };
2925

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

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

    
2958
                                instance.ApplyTemplate();
2959
                                instance.SetPolyPath();
2960

    
2961
                                //instance.PointSet = s.PointSet;
2962
                                //instance.ClosePath();
2963
                                //instance.ChangePaint(s.PaintState);
2964
                            }
2965
                            break;
2966
                        #endregion
2967
                        #region Cloud
2968
                        case "CloudControl":
2969
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
2970
                            {
2971
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2972
                                CloudControl instance = new CloudControl
2973
                                {
2974
                                    LineSize = Convert.ToDouble(data2.First()),
2975
                                    Toler = s.Toler,
2976
                                    PointSet = new List<Point>(),
2977
                                    ArcLength = s.ArcLength,
2978
                                    Paint = s.PaintState,
2979
                                    Opacity = s.Opac,
2980
                                    StrokeColor = _SetColor,
2981
                                    isTransOn = s.IsTrans,
2982
                                    isChain = s.IsChain,
2983
                                    DashSize = s.DashSize,
2984
                                    UserID = s.UserID,
2985
                                    //Fill = s.CloudFill,
2986
                                };
2987
                                Layer.Children.Add(instance);
2988
                                instance.pointSet = s.PointSet;
2989
                                instance.ApplyTemplate();
2990
                                instance.ClosePath();
2991
                                instance.ChangePaint(s.PaintState);
2992
                            }
2993
                            break;
2994
                        #endregion
2995
                        #endregion
2996

    
2997
                        #region Line
2998
                        #region Line
2999
                        case "LineControl":
3000
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
3001
                            {
3002
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3003
                                LineControl instance = new LineControl()
3004
                                {
3005
                                    LineStyleSet = s.LineStyleSet,
3006
                                    StartPoint = s.StartPoint,
3007
                                    DimSize = s.DimSize,
3008
                                    EndPoint = s.EndPoint,
3009
                                    DashSize = s.DashSize,
3010
                                    Interval = s.Interval,
3011
                                    PointSet = s.PointSet,
3012
                                    Opacity = s.Opac,
3013
                                    StrokeColor = _SetColor,
3014
                                    UserID = s.UserID,
3015
                                    LineSize = Convert.ToDouble(data2.First()),
3016
                                };
3017
                                Layer.Children.Add(instance);
3018
                                instance.ApplyTemplate();
3019
                                instance.SetLinePath();
3020
                            }
3021
                            break;
3022
                        #endregion
3023
                        #region Arrow_Multi
3024
                        case "ArrowControl_Multi":
3025
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
3026
                            {
3027
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3028
                                ArrowControl_Multi instance = new ArrowControl_Multi
3029
                                {
3030
                                    LineSize = Convert.ToDouble(data2.First()),
3031
                                    StartPoint = s.StartPoint,
3032
                                    MiddlePoint = s.MidPoint,
3033
                                    DashSize = s.DashSize,
3034
                                    EndPoint = s.EndPoint,
3035
                                    PointSet = s.PointSet,
3036
                                    Opacity = s.Opac,
3037
                                    StrokeColor = _SetColor,
3038
                                    UserID = s.UserID
3039
                                };
3040

    
3041
                                Layer.Children.Add(instance);
3042
                                instance.ApplyTemplate();
3043
                                instance.SetArrowMultiPath();
3044
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3045

    
3046
                            }
3047
                            break;
3048
                        #endregion
3049
                        #region Arc
3050
                        case "ArcControl":
3051
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
3052
                            {
3053
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3054
                                ArcControl instance = new ArcControl()
3055
                                {
3056
                                    StartPoint = s.StartPoint,
3057
                                    EndPoint = s.EndPoint,
3058
                                    DashSize = s.DashSize,
3059
                                    PointSet = s.PointSet,
3060
                                    isTransOn = s.IsTransOn,
3061
                                    MidPoint = s.MidPoint,
3062
                                    StrokeColor = _SetColor,
3063
                                    Opacity = s.Opac,
3064
                                    Clock = s.Clock,
3065
                                    LineSize = Convert.ToDouble(data2.First()),
3066
                                    UserID = s.UserID,
3067
                                };
3068

    
3069
                                Layer.Children.Add(instance);
3070
                                instance.ApplyTemplate();
3071
                                instance.SetArcPath();
3072
                            }
3073
                            break;
3074
                        #endregion
3075
                        #endregion
3076

    
3077
                        #region Text
3078
                        case "TextControl":
3079
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
3080
                            {
3081
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3082
                                TextControl instance = new TextControl()
3083
                                {
3084
                                    Text = s.Text,
3085
                                    StartPoint = s.StartPoint,
3086
                                    EndPoint = s.EndPoint,
3087
                                    CanvasX = s.StartPoint.X,
3088
                                    CanvasY = s.StartPoint.Y,
3089
                                    BoxWidth = s.BoxW,
3090
                                    BoxHeight = s.BoxH,
3091
                                    ControlType_No = s.paintMethod,
3092
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
3093
                                    TextSize = Convert.ToDouble(data2[1]),
3094
                                    FontColor = _SetColor,
3095
                                    FontSize = 10,
3096
                                    UserID = s.UserID,
3097
                                    //isHighLight = s.isHighLight,
3098
                                    Angle = s.Angle,
3099
                                    PointSet = s.PointSet,
3100
                                    Opacity = s.Opac,
3101
                                    TextFamily = new FontFamily(s.fontConfig[0]),
3102
                                    //TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
3103
                                    //TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
3104
                                };
3105

    
3106
                                if (instance.Text != null)
3107
                                {
3108
                                    Layer.Children.Add(instance);
3109
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
3110
                                    instance.ApplyTemplate();
3111
                                    if (s.fontConfig.Count() == 4)
3112
                                    {
3113
                                        instance.UnderLine = TextDecorations.Underline;
3114
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
3115
                                    }
3116
                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
3117

    
3118
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3119
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3120
                                    instance.DrawingCloud();
3121
                                    instance.SetText();
3122
                                }
3123
                            }
3124
                            break;
3125
                        #endregion
3126

    
3127
                        #region ArrowText
3128
                        case "ArrowTextControl":
3129
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
3130
                            {
3131
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3132
                                ArrowTextControl instance = new ArrowTextControl();
3133
                                Layer.Children.Add(instance);
3134
                                //instance.LineSize = Convert.ToDouble(data2.First());
3135
                                instance.PointSet = s.PointSet;
3136
                                instance.StartPoint = s.StartPoint;
3137
                                instance.EndPoint = s.EndPoint;
3138
                                instance.StrokeColor = _SetColor;
3139
                                //instance.DashSize = s.DashSize;
3140
                                instance.ArrowTextStyle = s.ArrowStyle;
3141
                                instance.isHighLight = s.isHighLight;
3142
                                instance.ArrowText = s.ArrowText;
3143
                                instance.Opacity = s.Opac;
3144
                                instance.BorderSize = s.BorderSize;
3145
                                instance.BoxWidth = s.BoxWidth;
3146
                                instance.BoxHeight = s.BoxHeight;
3147
                                instance.isFixed = s.isFixed;
3148
                                instance.Angle = s.Angle;
3149
                                instance.UserID = s.UserID;
3150
                                instance.isTrans = s.isTrans;
3151
                                instance.MidPoint = s.MidPoint;
3152
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
3153
                                {
3154
                                    s.fontConfig = new List<string>();
3155

    
3156
                                    s.fontConfig.Add("Arial");
3157
                                    s.fontConfig.Add("Normal");
3158
                                    s.fontConfig.Add("Normal");
3159
                                    s.fontConfig.Add("30");
3160
                                }
3161
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
3162
                                //instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
3163
                                //instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
3164
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
3165
                                instance.ApplyTemplate();
3166
                                instance.SetArrowTextPath();
3167
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3168
                            };
3169
                            break;
3170
                        #endregion
3171

    
3172
                        #region Date
3173
                        case "DateControl":
3174
                            {
3175
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
3176
                                {
3177
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3178
                                    DateControl instance = new DateControl
3179
                                    {
3180
                                        Angle = s.Angle,
3181
                                        StartPoint = s.StartPoint,
3182
                                        EndPoint = s.EndPoint,
3183
                                        LeftBottomPoint = s.LB,
3184
                                        TopRightPoint = s.TR,
3185
                                        Opacity = s.Opac,
3186
                                        FontColor = _SetColor,
3187
                                        LineSize = Convert.ToDouble(data2.First()),
3188
                                        Text = s.Text,
3189
                                        PointSet = s.PointSet,
3190
                                        UserID = s.UserID
3191
                                    };
3192

    
3193
                                    Layer.Children.Add(instance);
3194
                                    instance.ApplyTemplate();
3195
                                    instance.SetDate();
3196
                                }
3197
                            }
3198
                            break;
3199
                        #endregion
3200

    
3201
                        #region Image
3202
                        case "ImgControl":
3203
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
3204
                            {
3205
                                Image img = new Image();
3206
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
3207

    
3208
                                ImgControl instance = new ImgControl
3209
                                {
3210
                                    Angle = s.Angle,
3211
                                    StartPoint = s.StartPoint,
3212
                                    TopRightPoint = s.TR,
3213
                                    EndPoint = s.EndPoint,
3214
                                    LeftBottomPoint = s.LB,
3215
                                    PointSet = s.PointSet,
3216
                                    Opacity = s.Opac,
3217
                                    FilePath = s.ImagePath,
3218
                                    UserID = s.UserID,
3219
                                    ImageData = img.Source
3220
                                };
3221
                                Layer.Children.Add(instance);
3222
                                instance.ApplyTemplate();
3223
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3224
                                instance.SetImage();
3225

    
3226
                            }
3227
                            break;
3228
                        #endregion
3229

    
3230
                        #region Symbol
3231
                        case "SymControl":
3232
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
3233
                            {
3234
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3235
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
3236
                                SymControl instance = new SymControl()
3237
                                {
3238
                                    LineSize = Convert.ToDouble(data2.First()),
3239
                                    PointSet = s.PointSet,
3240
                                    Paint = s.PaintState,
3241
                                    StartPoint = s.StartPoint,
3242
                                    StrokeColor = _SetColor,
3243
                                    EndPoint = s.EndPoint,
3244
                                    Angle = s.Angle,
3245
                                    LeftBottomPoint = s.LB,
3246
                                    TopRightPoint = s.TR,
3247
                                    PathData = sm.Convert(s.PathInfo.ToString()),
3248
                                    Opacity = s.Opac,
3249
                                };
3250
                                instance.Memo = s.Memo;
3251
                                Layer.Children.Add(instance);
3252
                                instance.ApplyTemplate();
3253
                                instance.SetSymPath();
3254
                            }
3255
                            break;
3256
                        #endregion
3257

    
3258
                        #region SymbolN
3259
                        case "SymControlN":
3260
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
3261
                            {
3262
                                SymControlN instance = new SymControlN()
3263
                                {
3264
                                    PointSet = s.PointSet,
3265
                                    StartPoint = s.StartPoint,
3266
                                    EndPoint = s.EndPoint,
3267
                                    Angle = s.Angle,
3268
                                    LeftBottomPoint = s.LB,
3269
                                    TopRightPoint = s.TR,
3270
                                    Opacity = s.Opac,
3271
                                    PathXathData = s.DBData,
3272
                                };
3273

    
3274
                                instance.Memo = s.Memo;
3275
                                Layer.Children.Add(instance);
3276
                                instance.ApplyTemplate();
3277

    
3278
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3279
                                //instance.PathXathData = s.DBData;
3280

    
3281
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3282
                                xamlData = xamlData.Replace("daelim", "DAELIM");
3283
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
3284
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
3285
                                writer.Write(xamlData);
3286
                                writer.Flush();
3287
                                stream.Position = 0;
3288

    
3289
                                object obj = XamlReader.Load(stream);
3290
                                instance.Base_ViewBox.Child = obj as UIElement;
3291
                                instance.PathXathData = appovalData;
3292
                                instance.SetViewBox();
3293
                            }
3294
                            break;
3295
                        #endregion
3296

    
3297
                        #region Sign
3298
                        case "SignControl":
3299
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
3300
                            {
3301
                                SignControl instance = new SignControl
3302
                                {
3303
                                    Angle = s.Angle,
3304
                                    StartPoint = s.StartPoint,
3305
                                    TopRightPoint = s.TR,
3306
                                    EndPoint = s.EndPoint,
3307
                                    LeftBottomPoint = s.LB,
3308
                                    PointSet = s.PointSet,
3309
                                    Opacity = s.Opac,
3310
                                    SignImage = null,
3311
                                    UserID = s.UserID,
3312
                                };
3313
                                instance.ApplyTemplate();
3314
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3315

    
3316
                                if (s.UserNumber != null)
3317
                                {
3318
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
3319
                                    if (_sign != null)
3320
                                    {
3321
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
3322

    
3323
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
3324
                                        stream.Write(imageBytes, 0, imageBytes.Length);
3325
                                        stream.Position = 0;
3326
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
3327
                                        BitmapImage returnImage = new BitmapImage();
3328
                                        returnImage.BeginInit();
3329
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
3330
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
3331
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
3332
                                        returnImage.StreamSource = ms;
3333
                                        returnImage.EndInit();
3334
                                        stream.Close();
3335
                                        instance.SignImage = returnImage;
3336
                                    }
3337
                                }
3338

    
3339

    
3340
                                instance.Memo = s.Memo;
3341
                                Layer.Children.Add(instance);
3342
                                instance.ApplyTemplate();
3343
                                instance.SetImage();
3344
                            }
3345
                            break;
3346
                        #endregion
3347

    
3348

    
3349

    
3350
                        default:
3351
                            break;
3352
                    };
3353
                }
3354
            }
3355
        }
3356

    
3357
        /// <summary>
3358
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
3359
        /// </summary>
3360
        /// <param name="MarkupString"></param>
3361
        public void markupParse(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID)
3362
        {
3363
            if (MarkupString != "False")
3364
            {
3365
                //GetUserSign getUser = new GetUserSign();
3366
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
3367
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
3368
                string[] delimiterChars = { "|DZ|" };
3369
                string[] delimiterChars2 = { "|" };
3370
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
3371
                List<string> dataSet = new List<string>();
3372

    
3373
                foreach (var dataPease in data)
3374
                {
3375
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
3376
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
3377
                    switch (unkownControl.Name)
3378
                    {
3379
                        #region ArrowText
3380
                        case "ArrowTextControl":
3381
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
3382
                            {
3383
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3384
                                ArrowTextControl instance = new ArrowTextControl();
3385
                                instance.MarkupInfoID = markupInfoID;
3386
                                //Layer.Children.Add(instance);
3387
                                baseLayer.Add(instance);
3388
                                //instance.LineSize = Convert.ToDouble(data2.First());
3389
                                instance.PointSet = s.PointSet;
3390
                                instance.StartPoint = s.StartPoint;
3391
                                instance.EndPoint = s.EndPoint;
3392
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
3393
                                //instance.DashSize = s.DashSize;
3394
                                instance.ArrowTextStyle = s.ArrowStyle;
3395
                                instance.isHighLight = s.isHighLight;
3396
                                instance.ArrowText = s.ArrowText;
3397
                                instance.Opacity = s.Opac;
3398
                                instance.BorderSize = s.BorderSize;
3399
                                instance.BoxWidth = s.BoxWidth;
3400
                                instance.BoxHeight = s.BoxHeight;
3401
                                instance.isFixed = s.isFixed;
3402
                                instance.Angle = s.Angle;
3403
                                instance.UserID = s.UserID;
3404
                                instance.StrokeColor = _SetColor;
3405
                                instance.isTrans = s.isTrans;
3406
                                instance.MidPoint = s.MidPoint;
3407
                                instance.Memo = s.Memo;
3408
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
3409
                                {
3410
                                    s.fontConfig = new List<string>();
3411

    
3412
                                    s.fontConfig.Add("Arial");
3413
                                    s.fontConfig.Add("Normal");
3414
                                    s.fontConfig.Add("Normal");
3415
                                    s.fontConfig.Add("30");
3416
                                }
3417
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
3418
                                //instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
3419
                                //instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
3420
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
3421
                                instance.ApplyTemplate();
3422
                                instance.SetArrowTextPath();
3423
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3424
                            };
3425
                            break;
3426
                        #endregion
3427
                        #region Arrow_Multi
3428
                        case "ArrowControl_Multi":
3429
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
3430
                            {
3431
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3432
                                ArrowControl_Multi instance = new ArrowControl_Multi
3433
                                {
3434
                                    LineSize = Convert.ToDouble(data2.First()),
3435
                                    StartPoint = s.StartPoint,
3436
                                    MiddlePoint = s.MidPoint,
3437
                                    DashSize = s.DashSize,
3438
                                    EndPoint = s.EndPoint,
3439
                                    PointSet = s.PointSet,
3440
                                    Opacity = s.Opac,
3441
                                    StrokeColor = _SetColor,
3442
                                    UserID = s.UserID
3443
                                };
3444

    
3445
                                //Layer.Children.Add(instance);
3446
                                instance.MarkupInfoID = markupInfoID;
3447
                                baseLayer.Add(instance);
3448
                                instance.ApplyTemplate();
3449
                                instance.SetArrowMultiPath();
3450
                                instance.Memo = s.Memo;
3451
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3452

    
3453
                            }
3454
                            break;
3455
                        #endregion
3456
                        #region Rectangle
3457
                        case "RectangleControl":
3458
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
3459
                            {
3460
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3461
                                RectangleControl instance = new RectangleControl
3462
                                {
3463
                                    LineSize = Convert.ToDouble(data2.First()),
3464
                                    Paint = s.PaintState,
3465
                                    StartPoint = s.StartPoint,
3466
                                    EndPoint = s.EndPoint,
3467
                                    Angle = s.Angle,
3468
                                    StrokeColor = _SetColor,
3469
                                    DashSize = s.DashSize,
3470
                                    Opacity = s.Opac,
3471
                                    LeftBottomPoint = s.LB,
3472
                                    TopRightPoint = s.TR,
3473
                                    PointSet = s.PointSet,
3474
                                    UserID = s.UserID
3475
                                };
3476

    
3477
                                instance.Memo = s.Memo;
3478
                                //Layer.Children.Add(instance);
3479
                                instance.MarkupInfoID = markupInfoID;
3480
                                baseLayer.Add(instance);
3481
                                instance.ApplyTemplate();
3482
                                instance.SetRectPath();
3483
                            }
3484
                            break;
3485
                        #endregion
3486
                        #region Triangle
3487
                        case "TriControl":
3488
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
3489
                            {
3490
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3491
                                TriControl instance = new TriControl
3492
                                {
3493
                                    LineSize = Convert.ToDouble(data2.First()),
3494
                                    MidPoint = s.MidPoint,
3495
                                    StartPoint = s.StartPoint,
3496
                                    Paint = s.Paint,
3497
                                    EndPoint = s.EndPoint,
3498
                                    Opacity = s.Opac,
3499
                                    Angle = s.Angle,
3500
                                    DashSize = s.DashSize,
3501
                                    PointSet = s.PointSet,
3502
                                    StrokeColor = _SetColor,
3503
                                    UserID = s.UserID,
3504
                                };
3505
                                instance.Memo = s.Memo;
3506
                                //Layer.Children.Add(instance);
3507
                                instance.MarkupInfoID = markupInfoID;
3508
                                baseLayer.Add(instance);
3509
                                instance.ApplyTemplate();
3510
                                instance.SetTri();
3511
                            }
3512
                            break;
3513
                        #endregion
3514
                        #region Cicle
3515
                        case "CircleControl":
3516
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
3517
                            {
3518
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3519
                                CircleControl instance = new CircleControl
3520
                                {
3521
                                    LineSize = Convert.ToDouble(data2.First()),
3522
                                    Paint = s.PaintState,
3523
                                    StartPoint = s.StartPoint,
3524
                                    EndPoint = s.EndPoint,
3525
                                    LeftBottomPoint = s.LBP,
3526
                                    TopRightPoint = s.TRP,
3527
                                    Opacity = s.Opac,
3528
                                    Angle = s.Angle,
3529
                                    DashSize = s.DashSize,
3530
                                    PointSet = s.PointSet,
3531
                                    StrokeColor = _SetColor,
3532
                                    UserID = s.UserID,
3533
                                };
3534
                                instance.Memo = s.Memo;
3535
                                //Layer.Children.Add(instance);
3536
                                instance.MarkupInfoID = markupInfoID;
3537
                                baseLayer.Add(instance);
3538
                                instance.ApplyTemplate();
3539
                                instance.SetCircle();
3540
                            }
3541
                            break;
3542
                        #endregion
3543
                        #region Poly
3544
                        case "PolygonControl":
3545
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
3546
                            {
3547
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3548
                                PolygonControl instance = new PolygonControl
3549
                                {
3550
                                    LineSize = Convert.ToDouble(data2.First()),
3551
                                    //Toler = s.Toler,
3552
                                    IsCompleted = s.IsCompleted,
3553
                                    //PointSet = new List<Point>(),
3554
                                    Opacity = s.Opac,
3555
                                    StrokeColor = _SetColor,
3556
                                    DashSize = s.DashSize,
3557
                                    StartPoint = s.StartPoint,
3558
                                    PointSet = s.PointSet,
3559
                                    UserID = s.UserID,
3560
                                    //강인구 추가(Chain인지 Polygon인지 구분)
3561
                                    ControlType = s.Type,
3562
                                    Paint = s.PaintState,
3563
                                    //PointC = s.PointC,
3564
                                };
3565
                                //Layer.Children.Add(instance);
3566
                                instance.MarkupInfoID = markupInfoID;
3567
                                baseLayer.Add(instance);
3568
                                instance.Memo = s.Memo;
3569
                                instance.ApplyTemplate();
3570
                                instance.SetPolyPath();
3571

    
3572
                                //instance.PointSet = s.PointSet;
3573
                                //instance.ClosePath();
3574
                                //instance.ChangePaint(s.PaintState);
3575
                            }
3576
                            break;
3577
                        #endregion
3578
                        #region Cloud
3579
                        case "CloudControl":
3580
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
3581
                            {
3582
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3583
                                CloudControl instance = new CloudControl
3584
                                {
3585
                                    LineSize = Convert.ToDouble(data2.First()),
3586
                                    Toler = s.Toler,
3587
                                    PointSet = new List<Point>(),
3588
                                    ArcLength = s.ArcLength,
3589
                                    Paint = s.PaintState,
3590
                                    Opacity = s.Opac,
3591
                                    StrokeColor = _SetColor,
3592
                                    isTransOn = s.IsTrans,
3593
                                    isChain = s.IsChain,
3594
                                    DashSize = s.DashSize,
3595
                                    UserID = s.UserID,
3596
                                    //Fill = s.CloudFill,
3597
                                };
3598
                                instance.Memo = s.Memo;
3599
                                //Layer.Children.Add(instance);
3600
                                instance.MarkupInfoID = markupInfoID;
3601
                                baseLayer.Add(instance);
3602
                                instance.PointSet = s.PointSet;
3603
                                instance.ApplyTemplate();
3604
                                instance.ClosePath();
3605
                                instance.ChangePaint(s.PaintState);
3606
                            }
3607
                            break;
3608
                        #endregion
3609
                        #region Line
3610
                        case "LineControl":
3611
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
3612
                            {
3613
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3614
                                LineControl instance = new LineControl()
3615
                                {
3616
                                    LineStyleSet = s.LineStyleSet,
3617
                                    StartPoint = s.StartPoint,
3618
                                    DimSize = s.DimSize,
3619
                                    EndPoint = s.EndPoint,
3620
                                    DashSize = s.DashSize,
3621
                                    Interval = s.Interval,
3622
                                    PointSet = s.PointSet,
3623
                                    Opacity = s.Opac,
3624
                                    StrokeColor = _SetColor,
3625
                                    UserID = s.UserID,
3626
                                    LineSize = Convert.ToDouble(data2.First()),
3627
                                };
3628
                                instance.Memo = s.Memo;
3629
                                //Layer.Children.Add(instance);
3630
                                instance.MarkupInfoID = markupInfoID;
3631
                                baseLayer.Add(instance);
3632
                                instance.ApplyTemplate();
3633
                                instance.SetLinePath();
3634
                            }
3635
                            break;
3636
                        #endregion
3637
                        #region Text
3638
                        case "TextControl":
3639
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
3640
                            {
3641
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3642
                                TextControl instance = new TextControl()
3643
                                {
3644
                                    Text = s.Text,
3645
                                    StartPoint = s.StartPoint,
3646
                                    EndPoint = s.EndPoint,
3647
                                    CanvasX = s.StartPoint.X,
3648
                                    CanvasY = s.StartPoint.Y,
3649
                                    BoxWidth = s.BoxW,
3650
                                    BoxHeight = s.BoxH,
3651
                                    ControlType_No = s.paintMethod,
3652
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
3653
                                    TextSize = Convert.ToDouble(data2[1]),
3654
                                    FontColor = _SetColor,
3655
                                    FontSize = 10,
3656
                                    UserID = s.UserID,
3657
                                    //isHighLight = s.isHighLight,
3658
                                    Angle = s.Angle,
3659
                                    PointSet = s.PointSet,
3660
                                    Opacity = s.Opac,
3661
                                    TextFamily = new FontFamily(s.fontConfig[0]),
3662
                                    //TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
3663
                                    //TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
3664
                                };
3665

    
3666
                                if (instance.Text != null)
3667
                                {
3668
                                    //Layer.Children.Add(instance);
3669
                                    instance.MarkupInfoID = markupInfoID;
3670
                                    baseLayer.Add(instance);
3671
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
3672
                                    instance.ApplyTemplate();
3673
                                    instance.Memo = s.Memo;
3674
                                    if (s.fontConfig.Count() == 4)
3675
                                    {
3676
                                        instance.UnderLine = TextDecorations.Underline;
3677
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
3678
                                    }
3679
                                    instance.Base_TextBlock.Margin = new Thickness(0,0,10,0);
3680
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3681
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3682
                                    instance.DrawingCloud();
3683
                                    instance.SetText();
3684
                                }
3685
                            }
3686
                            break;
3687
                        #endregion
3688
                        #region Arc
3689
                        case "ArcControl":
3690
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
3691
                            {
3692
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3693
                                ArcControl instance = new ArcControl()
3694
                                {
3695
                                    StartPoint = s.StartPoint,
3696
                                    EndPoint = s.EndPoint,
3697
                                    DashSize = s.DashSize,
3698
                                    PointSet = s.PointSet,
3699
                                    isTransOn = s.IsTransOn,
3700
                                    MidPoint = s.MidPoint,
3701
                                    StrokeColor = _SetColor,
3702
                                    Clock = s.Clock,
3703
                                    Opacity = s.Opac,
3704
                                    LineSize = Convert.ToDouble(data2.First()),
3705
                                    UserID = s.UserID,
3706
                                };
3707
                                instance.Memo = s.Memo;
3708
                                //Layer.Children.Add(instance);
3709
                                instance.MarkupInfoID = markupInfoID;
3710
                                baseLayer.Add(instance);
3711
                                instance.ApplyTemplate();
3712
                                instance.SetArcPath();
3713
                            }
3714
                            break;
3715
                        #endregion
3716
                        #region RectCloud
3717
                        case "RectCloudControl":
3718
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
3719
                            {
3720
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3721
                                RectCloudControl instance = new RectCloudControl()
3722
                                {
3723
                                    StartPoint = s.StartPoint,
3724
                                    EndPoint = s.EndPoint,
3725
                                    LeftBottomPoint = s.LB,
3726
                                    Paint = s.PaintState,
3727
                                    Opacity = s.Opac,
3728
                                    DashSize = s.DashSize,
3729
                                    TopRightPoint = s.TR,
3730
                                    PointSet = s.PointSet,
3731
                                    StrokeColor = _SetColor,
3732
                                    LineSize = Convert.ToDouble(data2.First()),
3733
                                    UserID = s.UserID
3734
                                };
3735
                                instance.Memo = s.Memo;
3736
                                //Layer.Children.Add(instance);
3737
                                instance.MarkupInfoID = markupInfoID;
3738
                                baseLayer.Add(instance);
3739
                                instance.ApplyTemplate();
3740
                                instance.SetRectCloud();
3741
                            }
3742
                            break;
3743
                        #endregion
3744
                        #region Sign
3745
                        case "SignControl":
3746
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
3747
                            {
3748
                                SignControl instance = new SignControl
3749
                                {
3750
                                    Angle = s.Angle,
3751
                                    StartPoint = s.StartPoint,
3752
                                    TopRightPoint = s.TR,
3753
                                    EndPoint = s.EndPoint,
3754
                                    LeftBottomPoint = s.LB,
3755
                                    PointSet = s.PointSet,
3756
                                    Opacity = s.Opac,
3757
                                    SignImage = null,
3758
                                    UserID = s.UserID,
3759
                                };
3760
                                instance.ApplyTemplate();
3761
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3762

    
3763
                                if (s.UserNumber != null)
3764
                                {
3765
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
3766
                                    if (_sign != null)
3767
                                    {
3768
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
3769

    
3770
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
3771
                                        stream.Write(imageBytes, 0, imageBytes.Length);
3772
                                        stream.Position = 0;
3773
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
3774
                                        BitmapImage returnImage = new BitmapImage();
3775
                                        returnImage.BeginInit();
3776
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
3777
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
3778
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
3779
                                        returnImage.StreamSource = ms;
3780
                                        returnImage.EndInit();
3781
                                        stream.Close();
3782
                                        instance.SignImage = returnImage;
3783
                                    }
3784
                                }
3785

    
3786
                                instance.Memo = s.Memo;
3787
                                //Layer.Children.Add(instance);
3788
                                instance.MarkupInfoID = markupInfoID;
3789
                                baseLayer.Add(instance);
3790
                                instance.ApplyTemplate();
3791
                                instance.SetImage();
3792

    
3793
                                //baseLayer.Add(instance);
3794
                                //instance.ApplyTemplate();
3795
                                //instance.SetImage();
3796
                                //return_control = instance;
3797
                            }
3798
                            break;
3799
                        #endregion
3800
                        #region Ink
3801
                        case "InkPresenter":
3802
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
3803
                            {
3804
#if SILVERLIGHT
3805
                                this._InkBoard.Strokes = s.SCC; 
3806
#endif
3807
                            }
3808
                            break;
3809
                        #endregion
3810
                        #region Date
3811
                        case "DateControl":
3812
                            {
3813
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
3814
                                {
3815
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3816
                                    DateControl instance = new DateControl
3817
                                    {
3818
                                        Angle = s.Angle,
3819
                                        StartPoint = s.StartPoint,
3820
                                        EndPoint = s.EndPoint,
3821
                                        LeftBottomPoint = s.LB,
3822
                                        TopRightPoint = s.TR,
3823
                                        Opacity = s.Opac,
3824
                                        FontColor = _SetColor,
3825
                                        LineSize = Convert.ToDouble(data2.First()),
3826
                                        Text = s.Text,
3827
                                        PointSet = s.PointSet,
3828
                                        UserID = s.UserID
3829
                                    };
3830
                                    instance.Memo = s.Memo;
3831
                                    instance.MarkupInfoID = markupInfoID;
3832
                                    //Layer.Children.Add(instance);
3833
                                    baseLayer.Add(instance);
3834
                                    instance.ApplyTemplate();
3835
                                    instance.SetDate();
3836
                                }
3837
                            }
3838
                            break;
3839
                        #endregion
3840
                        #region Symbol
3841
//                        case "SymControl":
3842
//                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
3843
//                            {
3844
//                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3845
//                                StringToPathConverter sm = new StringToPathConverter();
3846
//                                SymControl instance = new SymControl()
3847
//                                {
3848
//                                    LineSize = Convert.ToDouble(data2.First()),
3849
//                                    PointSet = s.PointSet,
3850
//                                    Paint = s.PaintState,
3851
//                                    StartPoint = s.StartPoint,
3852
//                                    StrokeColor = _SetColor,
3853
//                                    EndPoint = s.EndPoint,
3854
//                                    Angle = s.Angle,
3855
//                                    LeftBottomPoint = s.LB,
3856
//                                    TopRightPoint = s.TR,
3857
//                                    PathData = sm.Convert(s.PathInfo.ToString()),
3858
//                                    Opacity = s.Opac,
3859
//                                };
3860
//                                //if (ToolTipService.GetToolTip(instance).ToString() == "")
3861
//                                //{
3862
//#if SILVERLIGHT
3863
//                                ToolTipService.SetToolTip(instance, UserNumber);
3864
//#endif
3865
//                                //} //조장원
3866
//                                Layer.Children.Add(instance);
3867
//                                instance.ApplyTemplate();
3868
//                                instance.SetSymPath();
3869
//                            }
3870
//                            break;
3871
                        #endregion
3872
                        #region Image
3873
                        case "ImgControl":
3874
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
3875
                            {
3876
                                Image img = new Image();
3877
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
3878

    
3879
                                ImgControl instance = new ImgControl
3880
                                {
3881
                                    Angle = s.Angle,
3882
                                    StartPoint = s.StartPoint,
3883
                                    TopRightPoint = s.TR,
3884
                                    EndPoint = s.EndPoint,
3885
                                    LeftBottomPoint = s.LB,
3886
                                    PointSet = s.PointSet,
3887
                                    Opacity = s.Opac,
3888
                                    FilePath = s.ImagePath,
3889
                                    UserID = s.UserID,
3890
                                    ImageData = img.Source
3891
                                };
3892
                                //Layer.Children.Add(instance);
3893
                                instance.Memo = s.Memo;
3894
                                baseLayer.Add(instance);
3895
                                instance.MarkupInfoID = markupInfoID;
3896
                                instance.ApplyTemplate();
3897
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3898
                                instance.SetImage();
3899

    
3900
                            }
3901
                            break;
3902
                        #endregion
3903
                        #region SymbolN
3904
                        case "SymControlN":
3905
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
3906
                            {
3907
                                SymControlN instance = new SymControlN()
3908
                                {
3909
                                    PointSet = s.PointSet,
3910
                                    StartPoint = s.StartPoint,
3911
                                    EndPoint = s.EndPoint,
3912
                                    Angle = s.Angle,
3913
                                    LeftBottomPoint = s.LB,
3914
                                    TopRightPoint = s.TR,
3915
                                    Opacity = s.Opac,
3916
                                    PathXathData = s.DBData,
3917
                                };
3918
                                instance.Memo = s.Memo;
3919
                                baseLayer.Add(instance);
3920
                                instance.MarkupInfoID = markupInfoID;
3921
                                instance.ApplyTemplate();
3922

    
3923
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3924
                                //instance.PathXathData = s.DBData;
3925

    
3926
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3927
                                xamlData = xamlData.Replace("daelim", "DAELIM");
3928
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
3929
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
3930
                                writer.Write(xamlData);
3931
                                writer.Flush();
3932
                                stream.Position = 0;
3933

    
3934
                                object obj = XamlReader.Load(stream);
3935
                                instance.Base_ViewBox.Child = obj as UIElement;
3936
                                instance.PathXathData = appovalData;
3937
                                instance.SetViewBox();
3938
                            }
3939
                            break;
3940
                        #endregion
3941
                        default:
3942
                            break;
3943
                    };
3944
                }
3945
            }
3946
        }
3947

    
3948

    
3949
        /// <summary>
3950
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
3951
        /// </summary>
3952
        /// <param name="MarkupString"></param>
3953
        public void markupParseEx(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId)
3954
        {
3955
            if (MarkupString != "False")
3956
            {
3957
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
3958
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
3959
                string[] delimiterChars = { "|DZ|" };
3960
                string[] delimiterChars2 = { "|" };
3961
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
3962
                List<string> dataSet = new List<string>();
3963

    
3964
                foreach (var dataPease in data)
3965
                {
3966
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
3967
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
3968
                    switch (unkownControl.Name)
3969
                    {
3970
                        #region ArrowText
3971
                        case "ArrowTextControl":
3972
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
3973
                            {
3974
                                ////string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3975
                                //ArrowTextControl instance = new ArrowTextControl();
3976
                                //instance.MarkupInfoID = markupInfoID;
3977
                                ////Layer.Children.Add(instance);
3978
                                //baseLayer.Add(instance);
3979
                                ////instance.LineSize = Convert.ToDouble(data2.First());
3980
                                //instance.PointSet = s.PointSet;
3981
                                //instance.StartPoint = s.StartPoint;
3982
                                //instance.EndPoint = s.EndPoint;
3983
                                //instance.StrokeColor = new SolidColorBrush(Colors.Red);
3984
                                ////instance.DashSize = s.DashSize;
3985
                                //instance.ArrowTextStyle = s.ArrowStyle;
3986
                                //instance.isHighLight = s.isHighLight;
3987
                                //instance.ArrowText = s.ArrowText;
3988
                                //instance.Opacity = s.Opac;
3989
                                //instance.BorderSize = s.BorderSize;
3990
                                //instance.BoxWidth = s.BoxWidth;
3991
                                //instance.BoxHeight = s.BoxHeight;
3992
                                //instance.isFixed = s.isFixed;
3993
                                //instance.Angle = s.Angle;
3994
                                //instance.UserID = s.UserID;
3995
                                //instance.StrokeColor = _SetColor;
3996
                                //instance.isTrans = s.isTrans;
3997
                                //instance.MidPoint = s.MidPoint;
3998
                                //instance.Memo = s.Memo;
3999
                                //if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
4000
                                //{
4001
                                //    s.fontConfig = new List<string>();
4002

    
4003
                                //    s.fontConfig.Add("Arial");
4004
                                //    s.fontConfig.Add("Normal");
4005
                                //    s.fontConfig.Add("Normal");
4006
                                //    s.fontConfig.Add("30");
4007
                                //}
4008
                                //instance.TextFamily = new FontFamily(s.fontConfig[0]);
4009
                                ////instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
4010
                                ////instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
4011
                                //instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
4012
                                //instance.ApplyTemplate();
4013
                                //instance.SetArrowTextPath();
4014
                                //instance.CommentID = commentId;
4015
                                ////instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
4016

    
4017

    
4018
                                #region 신규
4019
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4020
                                ArrowTextControl instance = new ArrowTextControl();
4021
                                instance.MarkupInfoID = markupInfoID;
4022
                                //Layer.Children.Add(instance);
4023
                                baseLayer.Add(instance);
4024
                                instance.ApplyTemplate();
4025
                                //instance.LineSize = Convert.ToDouble(data2.First());
4026
                                instance.PointSet = s.PointSet;
4027
                                instance.StartPoint = s.StartPoint;
4028
                                instance.EndPoint = s.EndPoint;
4029
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
4030
                                //instance.DashSize = s.DashSize;
4031
                                instance.ArrowTextStyle = s.ArrowStyle;
4032
                                instance.isHighLight = s.isHighLight;
4033
                                instance.ArrowText = s.ArrowText;
4034
                                instance.Opacity = s.Opac;
4035
                                instance.BorderSize = s.BorderSize;
4036
                                instance.BoxWidth = s.BoxWidth;
4037
                                instance.BoxHeight = s.BoxHeight;
4038
                                instance.isFixed = s.isFixed;
4039
                                instance.Angle = s.Angle;
4040
                                instance.UserID = s.UserID;
4041
                                instance.StrokeColor = _SetColor;
4042
                                instance.isTrans = s.isTrans;
4043
                                instance.MidPoint = s.MidPoint;
4044
                                instance.Memo = s.Memo;
4045
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
4046
                                {
4047
                                    s.fontConfig = new List<string>();
4048

    
4049
                                    s.fontConfig.Add("Arial");
4050
                                    s.fontConfig.Add("Normal");
4051
                                    s.fontConfig.Add("Normal");
4052
                                    s.fontConfig.Add("30");
4053
                                }
4054

    
4055
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
4056
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
4057
                                instance.SetArrowTextPath();
4058
                                instance.Base_TextBox.IsHitTestVisible = false;
4059
                                instance.CommentID = commentId;
4060
                                #endregion
4061

    
4062

    
4063
                            };
4064
                            break;
4065
                        #endregion
4066
                        #region Arrow_Multi
4067
                        case "ArrowControl_Multi":
4068
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
4069
                            {
4070
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4071
                                ArrowControl_Multi instance = new ArrowControl_Multi
4072
                                {
4073
                                    LineSize = Convert.ToDouble(data2.First()),
4074
                                    StartPoint = s.StartPoint,
4075
                                    MiddlePoint = s.MidPoint,
4076
                                    DashSize = s.DashSize,
4077
                                    EndPoint = s.EndPoint,
4078
                                    PointSet = s.PointSet,
4079
                                    Opacity = s.Opac,
4080
                                    StrokeColor = _SetColor,
4081
                                    UserID = s.UserID
4082
                                };
4083

    
4084
                                //Layer.Children.Add(instance);
4085
                                instance.MarkupInfoID = markupInfoID;
4086
                                baseLayer.Add(instance);
4087
                                instance.ApplyTemplate();
4088
                                instance.SetArrowMultiPath();
4089
                                instance.Memo = s.Memo;
4090
                                instance.CommentID = commentId;
4091
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
4092

    
4093
                            }
4094
                            break;
4095
                        #endregion
4096
                        #region Rectangle
4097
                        case "RectangleControl":
4098
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
4099
                            {
4100
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4101
                                RectangleControl instance = new RectangleControl
4102
                                {
4103
                                    LineSize = Convert.ToDouble(data2.First()),
4104
                                    Paint = s.PaintState,
4105
                                    StartPoint = s.StartPoint,
4106
                                    EndPoint = s.EndPoint,
4107
                                    Angle = s.Angle,
4108
                                    StrokeColor = _SetColor,
4109
                                    DashSize = s.DashSize,
4110
                                    Opacity = s.Opac,
4111
                                    LeftBottomPoint = s.LB,
4112
                                    TopRightPoint = s.TR,
4113
                                    PointSet = s.PointSet,
4114
                                    UserID = s.UserID
4115
                                };
4116

    
4117
                                instance.Memo = s.Memo;
4118
                                //Layer.Children.Add(instance);
4119
                                instance.CommentID = commentId;
4120
                                instance.MarkupInfoID = markupInfoID;
4121
                                baseLayer.Add(instance);
4122
                                instance.ApplyTemplate();
4123
                                instance.SetRectPath();
4124
                            }
4125
                            break;
4126
                        #endregion
4127
                        #region Triangle
4128
                        case "TriControl":
4129
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
4130
                            {
4131
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4132
                                TriControl instance = new TriControl
4133
                                {
4134
                                    LineSize = Convert.ToDouble(data2.First()),
4135
                                    MidPoint = s.MidPoint,
4136
                                    StartPoint = s.StartPoint,
4137
                                    Paint = s.Paint,
4138
                                    EndPoint = s.EndPoint,
4139
                                    Opacity = s.Opac,
4140
                                    Angle = s.Angle,
4141
                                    DashSize = s.DashSize,
4142
                                    PointSet = s.PointSet,
4143
                                    StrokeColor = _SetColor,
4144
                                    UserID = s.UserID,
4145
                                };
4146
                                instance.Memo = s.Memo;
4147
                                //Layer.Children.Add(instance);
4148
                                instance.CommentID = commentId;
4149
                                instance.MarkupInfoID = markupInfoID;
4150
                                baseLayer.Add(instance);
4151
                                instance.ApplyTemplate();
4152
                                instance.SetTri();
4153
                            }
4154
                            break;
4155
                        #endregion
4156
                        #region Cicle
4157
                        case "CircleControl":
4158
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
4159
                            {
4160
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4161
                                CircleControl instance = new CircleControl
4162
                                {
4163
                                    LineSize = Convert.ToDouble(data2.First()),
4164
                                    Paint = s.PaintState,
4165
                                    StartPoint = s.StartPoint,
4166
                                    EndPoint = s.EndPoint,
4167
                                    LeftBottomPoint = s.LBP,
4168
                                    TopRightPoint = s.TRP,
4169
                                    Opacity = s.Opac,
4170
                                    Angle = s.Angle,
4171
                                    DashSize = s.DashSize,
4172
                                    PointSet = s.PointSet,
4173
                                    StrokeColor = _SetColor,
4174
                                    UserID = s.UserID,
4175
                                };
4176
                                instance.Memo = s.Memo;
4177
                                //Layer.Children.Add(instance);
4178
                                instance.CommentID = commentId;
4179
                                instance.MarkupInfoID = markupInfoID;
4180
                                baseLayer.Add(instance);
4181
                                instance.ApplyTemplate();
4182
                                instance.SetCircle();
4183
                            }
4184
                            break;
4185
                        #endregion
4186
                        #region Poly
4187
                        case "PolygonControl":
4188
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4189
                            {
4190
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4191
                                PolygonControl instance = new PolygonControl
4192
                                {
4193
                                    LineSize = Convert.ToDouble(data2.First()),
4194
                                    //Toler = s.Toler,
4195
                                    IsCompleted = s.IsCompleted,
4196
                                    //PointSet = new List<Point>(),
4197
                                    Opacity = s.Opac,
4198
                                    StrokeColor = _SetColor,
4199
                                    StartPoint = s.StartPoint,
4200
                                    PointSet = s.PointSet,
4201
                                    UserID = s.UserID,
4202
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4203
                                    ControlType = s.Type,
4204
                                    DashSize = s.DashSize,
4205
                                    Paint = s.PaintState,
4206
                                    //PointC = s.PointC,
4207
                                };
4208
                                //Layer.Children.Add(instance);
4209
                                instance.MarkupInfoID = markupInfoID;
4210
                                baseLayer.Add(instance);
4211
                                instance.CommentID = commentId;
4212
                                instance.Memo = s.Memo;
4213
                                instance.ApplyTemplate();
4214
                                instance.SetPolyPath();
4215

    
4216
                                //instance.PointSet = s.PointSet;
4217
                                //instance.ClosePath();
4218
                                //instance.ChangePaint(s.PaintState);
4219
                            }
4220
                            break;
4221
                        #endregion
4222
                        #region Cloud
4223
                        case "CloudControl":
4224
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
4225
                            {
4226
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4227
                                CloudControl instance = new CloudControl
4228
                                {
4229
                                    LineSize = Convert.ToDouble(data2.First()),
4230
                                    Toler = s.Toler,
4231
                                    PointSet = new List<Point>(),
4232
                                    ArcLength = s.ArcLength,
4233
                                    Paint = s.PaintState,
4234
                                    Opacity = s.Opac,
4235
                                    StrokeColor = _SetColor,
4236
                                    isTransOn = s.IsTrans,
4237
                                    isChain = s.IsChain,
4238
                                    DashSize = s.DashSize,
4239
                                    UserID = s.UserID,
4240
                                    //Fill = s.CloudFill,
4241
                                };
4242
                                instance.Memo = s.Memo;
4243
                                //Layer.Children.Add(instance);
4244
                                instance.MarkupInfoID = markupInfoID;
4245
                                baseLayer.Add(instance);                                
4246
                                instance.CommentID = commentId;                                
4247
                                instance.PointSet = s.PointSet;
4248
                                instance.ApplyTemplate();
4249
                                instance.ClosePath();
4250
                                instance.ChangePaint(s.PaintState);
4251
                            }
4252
                            break;
4253
                        #endregion
4254
                        #region Line
4255
                        case "LineControl":
4256
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
4257
                            {
4258
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4259
                                LineControl instance = new LineControl()
4260
                                {
4261
                                    LineStyleSet = s.LineStyleSet,
4262
                                    StartPoint = s.StartPoint,
4263
                                    DimSize = s.DimSize,
4264
                                    EndPoint = s.EndPoint,
4265
                                    DashSize = s.DashSize,
4266
                                    Interval = s.Interval,
4267
                                    PointSet = s.PointSet,
4268
                                    Opacity = s.Opac,
4269
                                    StrokeColor = _SetColor,
4270
                                    UserID = s.UserID,
4271
                                    LineSize = Convert.ToDouble(data2.First()),
4272
                                };
4273
                                instance.Memo = s.Memo;
4274
                                //Layer.Children.Add(instance);
4275
                                instance.CommentID = commentId;
4276
                                instance.MarkupInfoID = markupInfoID;
4277
                                baseLayer.Add(instance);
4278
                                instance.ApplyTemplate();
4279
                                instance.SetLinePath();
4280
                            }
4281
                            break;
4282
                        #endregion
4283
                        #region Text
4284
                        case "TextControl":
4285
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
4286
                            {
4287
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4288
                                TextControl instance = new TextControl()
4289
                                {
4290
                                    Text = s.Text,
4291
                                    StartPoint = s.StartPoint,
4292
                                    EndPoint = s.EndPoint,
4293
                                    CanvasX = s.StartPoint.X,
4294
                                    CanvasY = s.StartPoint.Y,
4295
                                    BoxWidth = s.BoxW,
4296
                                    BoxHeight = s.BoxH,
4297
                                    ControlType_No = s.paintMethod,
4298
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
4299
                                    TextSize = Convert.ToDouble(data2[1]),
4300
                                    FontColor = _SetColor,
4301
                                    FontSize = 10,
4302
                                    UserID = s.UserID,
4303
                                    //isHighLight = s.isHighLight,
4304
                                    Angle = s.Angle,
4305
                                    PointSet = s.PointSet,
4306
                                    Opacity = s.Opac,
4307
                                    TextFamily = new FontFamily(s.fontConfig[0]),
4308
                                    //TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
4309
                                    //TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
4310
                                };
4311

    
4312
                                if (instance.Text != null)
4313
                                {
4314
                                    //Layer.Children.Add(instance);
4315
                                    instance.MarkupInfoID = markupInfoID;
4316
                                    baseLayer.Add(instance);
4317
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
4318
                                    instance.ApplyTemplate();
4319
                                    instance.Memo = s.Memo;
4320
                                    if (s.fontConfig.Count() == 4)
4321
                                    {
4322
                                        instance.UnderLine = TextDecorations.Underline;
4323
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
4324
                                    }
4325
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
4326

    
4327
                                    //instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
4328

    
4329
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
4330
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
4331

    
4332
                                    instance.CommentID = commentId;
4333
                                    instance.DrawingCloud();
4334
                                    instance.SetText();
4335
                                }
4336
                            }
4337
                            break;
4338
                        #endregion
4339
                        #region Arc
4340
                        case "ArcControl":
4341
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
4342
                            {
4343
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4344
                                ArcControl instance = new ArcControl()
4345
                                {
4346
                                    StartPoint = s.StartPoint,
4347
                                    EndPoint = s.EndPoint,
4348
                                    DashSize = s.DashSize,
4349
                                    PointSet = s.PointSet,
4350
                                    isTransOn = s.IsTransOn,
4351
                                    MidPoint = s.MidPoint,
4352
                                    StrokeColor = _SetColor,
4353
                                    Clock = s.Clock,
4354
                                    Opacity = s.Opac,
4355
                                    LineSize = Convert.ToDouble(data2.First()),
4356
                                    UserID = s.UserID,
4357
                                };
4358
                                instance.Memo = s.Memo;
4359
                                //Layer.Children.Add(instance);
4360
                                instance.MarkupInfoID = markupInfoID;
4361
                                baseLayer.Add(instance);
4362
                                instance.CommentID = commentId;
4363
                                instance.ApplyTemplate();
4364
                                instance.SetArcPath();
4365
                            }
4366
                            break;
4367
                        #endregion
4368
                        #region RectCloud
4369
                        case "RectCloudControl":
4370
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
4371
                            {
4372
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4373
                                RectCloudControl instance = new RectCloudControl()
4374
                                {
4375
                                    StartPoint = s.StartPoint,
4376
                                    EndPoint = s.EndPoint,
4377
                                    LeftBottomPoint = s.LB,
4378
                                    Paint = s.PaintState,
4379
                                    Opacity = s.Opac,
4380
                                    DashSize = s.DashSize,
4381
                                    TopRightPoint = s.TR,
4382
                                    PointSet = s.PointSet,
4383
                                    StrokeColor = _SetColor,
4384
                                    LineSize = Convert.ToDouble(data2.First()),
4385
                                    UserID = s.UserID
4386
                                };
4387
                                instance.Memo = s.Memo;
4388
                                //Layer.Children.Add(instance);
4389
                                instance.MarkupInfoID = markupInfoID;
4390
                                baseLayer.Add(instance);
4391
                                instance.CommentID = commentId;
4392
                                instance.ApplyTemplate();
4393
                                instance.SetRectCloud();
4394
                            }
4395
                            break;
4396
                        #endregion
4397
                        #region Sign
4398
                        case "SignControl":
4399
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
4400
                            {
4401
                                SignControl instance = new SignControl
4402
                                {
4403
                                    Angle = s.Angle,
4404
                                    StartPoint = s.StartPoint,
4405
                                    TopRightPoint = s.TR,
4406
                                    EndPoint = s.EndPoint,
4407
                                    LeftBottomPoint = s.LB,
4408
                                    PointSet = s.PointSet,
4409
                                    Opacity = s.Opac,
4410
                                    SignImage = null,
4411
                                    UserID = s.UserID,
4412
                                };
4413
                                instance.ApplyTemplate();
4414
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4415

    
4416
                                if (s.UserNumber != null)
4417
                                {
4418
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
4419
                                    if (_sign != null)
4420
                                    {
4421
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
4422

    
4423
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
4424
                                        stream.Write(imageBytes, 0, imageBytes.Length);
4425
                                        stream.Position = 0;
4426
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
4427
                                        BitmapImage returnImage = new BitmapImage();
4428
                                        returnImage.BeginInit();
4429
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
4430
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
4431
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
4432
                                        returnImage.StreamSource = ms;
4433
                                        returnImage.EndInit();
4434
                                        stream.Close();
4435
                                        instance.SignImage = returnImage;
4436
                                    }
4437
                                }
4438

    
4439
                                instance.MarkupInfoID = markupInfoID;
4440
                                instance.CommentID = commentId;
4441
                                baseLayer.Add(instance);
4442
                                instance.ApplyTemplate();
4443
                                instance.SetImage();
4444
                            }
4445
                            break;
4446
                        #endregion
4447
                        #region Ink
4448
                        case "InkPresenter":
4449
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
4450
                            {
4451
#if SILVERLIGHT
4452
                                this._InkBoard.Strokes = s.SCC; 
4453
#endif
4454
                            }
4455
                            break;
4456
                        #endregion
4457
                        #region Date
4458
                        case "DateControl":
4459
                            {
4460
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
4461
                                {
4462
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4463
                                    DateControl instance = new DateControl
4464
                                    {
4465
                                        Angle = s.Angle,
4466
                                        StartPoint = s.StartPoint,
4467
                                        EndPoint = s.EndPoint,
4468
                                        LeftBottomPoint = s.LB,
4469
                                        TopRightPoint = s.TR,
4470
                                        Opacity = s.Opac,
4471
                                        FontColor = _SetColor,
4472
                                        LineSize = Convert.ToDouble(data2.First()),
4473
                                        Text = s.Text,
4474
                                        PointSet = s.PointSet,
4475
                                        UserID = s.UserID
4476
                                    };
4477
                                    instance.Memo = s.Memo;
4478
                                    //Layer.Children.Add(instance);
4479
                                    baseLayer.Add(instance);
4480
                                    instance.CommentID = commentId;
4481
                                    instance.ApplyTemplate();
4482
                                    instance.SetDate();
4483
                                }
4484
                            }
4485
                            break;
4486
                        #endregion
4487
                        #region Symbol
4488
                        case "SymControl":
4489
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
4490
                            {
4491
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4492
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
4493
                                SymControl instance = new SymControl()
4494
                                {
4495
                                    LineSize = Convert.ToDouble(data2.First()),
4496
                                    PointSet = s.PointSet,
4497
                                    Paint = s.PaintState,
4498
                                    StartPoint = s.StartPoint,
4499
                                    StrokeColor = _SetColor,
4500
                                    EndPoint = s.EndPoint,
4501
                                    Angle = s.Angle,
4502
                                    LeftBottomPoint = s.LB,
4503
                                    TopRightPoint = s.TR,
4504
                                    PathData = sm.Convert(s.PathInfo.ToString()),
4505
                                    Opacity = s.Opac,
4506
                                };
4507

    
4508
                                instance.Memo = s.Memo;
4509
                                baseLayer.Add(instance);
4510
                                instance.CommentID = commentId;
4511
                                instance.ApplyTemplate();
4512
                                instance.SetSymPath();
4513
                            }
4514
                            break;
4515
                        #endregion
4516
                        #region Image
4517
                        case "ImgControl":
4518
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
4519
                            {
4520
                                Image img = new Image();
4521
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
4522

    
4523
                                ImgControl instance = new ImgControl
4524
                                {
4525
                                    Angle = s.Angle,
4526
                                    StartPoint = s.StartPoint,
4527
                                    TopRightPoint = s.TR,
4528
                                    EndPoint = s.EndPoint,
4529
                                    LeftBottomPoint = s.LB,
4530
                                    PointSet = s.PointSet,
4531
                                    Opacity = s.Opac,
4532
                                    FilePath = s.ImagePath,
4533
                                    UserID = s.UserID,
4534
                                    ImageData = img.Source
4535
                                };
4536
                                //Layer.Children.Add(instance);
4537
                                instance.Memo = s.Memo;
4538
                                baseLayer.Add(instance);
4539
                                instance.CommentID = commentId;
4540
                                instance.ApplyTemplate();
4541
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4542
                                instance.SetImage();
4543

    
4544
                            }
4545
                            break;
4546
                        #endregion
4547
                        #region SymbolN
4548
                        case "SymControlN":
4549
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
4550
                            {
4551
                                SymControlN instance = new SymControlN()
4552
                                {
4553
                                    PointSet = s.PointSet,
4554
                                    StartPoint = s.StartPoint,
4555
                                    EndPoint = s.EndPoint,
4556
                                    Angle = s.Angle,
4557
                                    LeftBottomPoint = s.LB,
4558
                                    TopRightPoint = s.TR,
4559
                                    Opacity = s.Opac,
4560
                                    PathXathData = s.DBData,
4561
                                };
4562
                                instance.Memo = s.Memo;
4563
                                baseLayer.Add(instance);
4564
                                instance.CommentID = commentId;
4565
                                instance.ApplyTemplate();
4566

    
4567
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
4568
                                //instance.PathXathData = s.DBData;
4569

    
4570
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
4571
                                xamlData = xamlData.Replace("daelim", "DAELIM");
4572
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
4573
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
4574
                                writer.Write(xamlData);
4575
                                writer.Flush();
4576
                                stream.Position = 0;
4577

    
4578
                                object obj = XamlReader.Load(stream);
4579
                                instance.Base_ViewBox.Child = obj as UIElement;
4580
                                instance.PathXathData = appovalData;
4581
                                instance.SetViewBox();
4582
                            }
4583
                            break;
4584
                        #endregion
4585
                        default:
4586

    
4587
                            break;
4588
                    };
4589
                }
4590
            }
4591
        }
4592

    
4593
		//강인구 추가(12/12)
4594
        public Control markupParse_Paste(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer)
4595
        {
4596
            //GetUserSign getUser = new GetUserSign();
4597
            Control return_control = new Control();
4598
            if (MarkupString != "False")
4599
            {
4600
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(""));
4601
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
4602
                string[] delimiterChars = { "|DZ|" };
4603
                string[] delimiterChars2 = { "|" };
4604
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
4605
                List<string> dataSet = new List<string>();
4606

    
4607
                foreach (var dataPease in data)
4608
                {
4609
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
4610
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
4611
                    switch (unkownControl.Name)
4612
                    {
4613
                        #region Shape
4614
                        #region Rectangle
4615
                        case "RectangleControl":
4616
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
4617
                            {
4618
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4619
                                RectangleControl instance = new RectangleControl
4620
                                {
4621
                                    LineSize = Convert.ToDouble(data2.First()),
4622
                                    Paint = s.PaintState,
4623
                                    StartPoint = s.StartPoint,
4624
                                    EndPoint = s.EndPoint,
4625
                                    Angle = s.Angle,
4626
                                    StrokeColor = _SetColor,
4627
                                    DashSize = s.DashSize,
4628
                                    Opacity = s.Opac,
4629
                                    LeftBottomPoint = s.LB,
4630
                                    TopRightPoint = s.TR,
4631
                                    PointSet = s.PointSet,
4632
                                    UserID = s.UserID
4633
                                };
4634
                                baseLayer.Add(instance);
4635
                                instance.ApplyTemplate();
4636

    
4637
                                return_control = instance;
4638
                            }
4639
                            break;
4640
                        #endregion
4641
                        #region Triangle
4642
                        case "TriControl":
4643
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
4644
                            {
4645
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4646
                                TriControl instance = new TriControl
4647
                                {
4648
                                    LineSize = Convert.ToDouble(data2.First()),
4649
                                    MidPoint = s.MidPoint,
4650
                                    StartPoint = s.StartPoint,
4651
                                    Paint = s.Paint,
4652
                                    EndPoint = s.EndPoint,
4653
                                    Opacity = s.Opac,
4654
                                    Angle = s.Angle,
4655
                                    DashSize = s.DashSize,
4656
                                    PointSet = s.PointSet,
4657
                                    StrokeColor = _SetColor,
4658

    
4659
                                    UserID = s.UserID,
4660
                                };
4661
                                baseLayer.Add(instance);
4662
                                instance.ApplyTemplate();
4663
                                return_control = instance;
4664
                            }
4665
                            break;
4666
                        #endregion
4667
                        #region Cicle
4668
                        case "CircleControl":
4669
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
4670
                            {
4671
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4672
                                CircleControl instance = new CircleControl
4673
                                {
4674
                                    LineSize = Convert.ToDouble(data2.First()),
4675
                                    Paint = s.PaintState,
4676
                                    StartPoint = s.StartPoint,
4677
                                    EndPoint = s.EndPoint,
4678
                                    LeftBottomPoint = s.LBP,
4679
                                    TopRightPoint = s.TRP,
4680
                                    Opacity = s.Opac,
4681
                                    Angle = s.Angle,
4682
                                    DashSize = s.DashSize,
4683
                                    PointSet = s.PointSet,
4684
                                    StrokeColor = _SetColor,
4685
                                    UserID = s.UserID,
4686
                                };
4687
                                baseLayer.Add(instance);
4688
                                instance.ApplyTemplate();
4689
                                return_control = instance;
4690
                            }
4691
                            break;
4692
                        #endregion
4693
                        #region RectCloud
4694
                        case "RectCloudControl":
4695
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
4696
                            {
4697
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4698
                                RectCloudControl instance = new RectCloudControl()
4699
                                {
4700
                                    StartPoint = s.StartPoint,
4701
                                    EndPoint = s.EndPoint,
4702
                                    LeftBottomPoint = s.LB,
4703
                                    Paint = s.PaintState,
4704
                                    Opacity = s.Opac,
4705
                                    DashSize = s.DashSize,
4706
                                    TopRightPoint = s.TR,
4707
                                    PointSet = s.PointSet,
4708
                                    StrokeColor = _SetColor,
4709

    
4710
                                    LineSize = Convert.ToDouble(data2.First()),
4711
                                    UserID = s.UserID
4712
                                };
4713
                                baseLayer.Add(instance);
4714
                                instance.ApplyTemplate();
4715
                                return_control = instance;
4716
                            }
4717
                            break;
4718
                        #endregion
4719
                        #endregion
4720

    
4721
                        #region Polygon
4722
                        #region Poly
4723
                        case "PolygonControl":
4724
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4725
                            {
4726
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4727
                                PolygonControl instance = new PolygonControl
4728
                                {
4729
                                    LineSize = Convert.ToDouble(data2.First()),
4730
                                    //Toler = s.Toler,
4731
                                    IsCompleted = s.IsCompleted,
4732
                                    //PointSet = new List<Point>(),
4733
                                    Opacity = s.Opac,
4734
                                    StrokeColor = _SetColor,
4735
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4736
                                    ControlType = s.Type,
4737
                                    DashSize = s.DashSize,
4738
                                    StartPoint = s.StartPoint,
4739
                                    PointSet = s.PointSet,
4740
                                    UserID = s.UserID,
4741
                                    //PointC = s.PointC,
4742
                                };
4743
                                baseLayer.Add(instance);
4744
                                instance.ApplyTemplate();
4745
                                return_control = instance;
4746
                            }
4747
                            break;
4748
                        #endregion
4749
                        #region Cloud
4750
                        case "CloudControl":
4751
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
4752
                            {
4753
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4754
                                CloudControl instance = new CloudControl
4755
                                {
4756
                                    LineSize = Convert.ToDouble(data2.First()),
4757
                                    Toler = s.Toler,
4758
                                    PointSet = s.PointSet,
4759
                                    ArcLength = s.ArcLength,
4760
                                    Paint = s.PaintState,
4761
                                    Opacity = s.Opac,
4762
                                    StrokeColor = _SetColor,
4763

    
4764
                                    isTransOn = s.IsTrans,
4765
                                    isChain = s.IsChain,
4766
                                    DashSize = s.DashSize,
4767
                                    UserID = s.UserID,
4768

    
4769

    
4770
                                    //Fill = s.CloudFill,
4771
                                };
4772
                                //instance.PointSet = s.PointSet;
4773
                                //instance.ClosePath();
4774
                                //instance.ChangePaint(s.PaintState);
4775
                                baseLayer.Add(instance);
4776
                                instance.ApplyTemplate();
4777
                                instance.SetCloud();
4778
                                //instance.ClosePath();
4779
                                //instance.ChangePaint(s.PaintState);
4780
                                return_control = instance;
4781
                            }
4782
                            break;
4783
                        #endregion
4784
                        #endregion
4785

    
4786
                        #region Line
4787
                        #region Line
4788
                        case "LineControl":
4789
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
4790
                            {
4791
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4792
                                LineControl instance = new LineControl()
4793
                                {
4794
                                    LineStyleSet = s.LineStyleSet,
4795
                                    StartPoint = s.StartPoint,
4796
                                    DimSize = s.DimSize,
4797
                                    EndPoint = s.EndPoint,
4798
                                    DashSize = s.DashSize,
4799
                                    Interval = s.Interval,
4800
                                    PointSet = s.PointSet,
4801
                                    Opacity = s.Opac,
4802
                                    StrokeColor = _SetColor,
4803
                                    UserID = s.UserID,
4804
                                    LineSize = Convert.ToDouble(data2.First()),
4805
                                };
4806

    
4807
                                baseLayer.Add(instance);
4808
                                instance.ApplyTemplate();
4809
                                instance.SetLinePath();
4810
                                return_control = instance;
4811
                            }
4812
                            break;
4813
                        #endregion
4814
                        #region Arrow_Multi
4815
                        case "ArrowControl_Multi":
4816
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
4817
                            {
4818
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4819
                                ArrowControl_Multi instance = new ArrowControl_Multi
4820
                                {
4821
                                    LineSize = Convert.ToDouble(data2.First()),
4822
                                    StartPoint = s.StartPoint,
4823
                                    MiddlePoint = s.MidPoint,
4824
                                    DashSize = s.DashSize,
4825
                                    EndPoint = s.EndPoint,
4826
                                    PointSet = s.PointSet,
4827
                                    Opacity = s.Opac,
4828
                                    StrokeColor = _SetColor,
4829

    
4830
                                    UserID = s.UserID
4831
                                };
4832
                                baseLayer.Add(instance);
4833
                                instance.ApplyTemplate();
4834
                                instance.SetArrowMultiPath();
4835
                                return_control = instance;
4836
                            }
4837
                            break;
4838
                        #endregion
4839
                        #region Arc
4840
                        case "ArcControl":
4841
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
4842
                            {
4843
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4844
                                ArcControl instance = new ArcControl()
4845
                                {
4846
                                    StartPoint = s.StartPoint,
4847
                                    EndPoint = s.EndPoint,
4848
                                    DashSize = s.DashSize,
4849
                                    PointSet = s.PointSet,
4850
                                    isTransOn = s.IsTransOn,
4851
                                    MidPoint = s.MidPoint,
4852
                                    StrokeColor = _SetColor,
4853
                                    Opacity = s.Opac,
4854

    
4855
                                    Clock = s.Clock,
4856
                                    LineSize = Convert.ToDouble(data2.First()),
4857
                                    UserID = s.UserID,
4858
                                };
4859
                                baseLayer.Add(instance);
4860
                                instance.ApplyTemplate();
4861
                                instance.OnApplyTemplate();
4862
                                instance.SetArcPath();
4863
                                return_control = instance;
4864
                            }
4865
                            break;
4866
                        #endregion
4867
                        #endregion
4868

    
4869
                        #region Text
4870
                        case "TextControl":
4871
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
4872
                            {
4873
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4874
                                TextControl instance = new TextControl()
4875
                                {
4876
                                    Text = s.Text,
4877
                                    StartPoint = s.StartPoint,
4878
                                    EndPoint = s.EndPoint,
4879
                                    CanvasX = s.StartPoint.X,
4880
                                    CanvasY = s.StartPoint.Y,
4881
                                    BoxWidth = s.BoxW,
4882
                                    BoxHeight = s.BoxH,
4883
                                    ControlType_No = s.paintMethod,
4884
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
4885
                                    TextSize = Convert.ToDouble(data2[1]),
4886
                                    FontColor = _SetColor,
4887
                                    FontSize = 10,
4888
                                    UserID = s.UserID,
4889
                                    //isHighLight = s.isHighLight,
4890
                                    Angle = s.Angle,
4891
                                    PointSet = s.PointSet,
4892
                                    Opacity = s.Opac,
4893
                                    TextFamily = new FontFamily(s.fontConfig[0]),
4894
                                    //TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
4895
                                    //TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
4896
                                };
4897

    
4898
                                if (instance.Text != null)
4899
                                {
4900
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
4901
                                    instance.ApplyTemplate();
4902
                                    if (s.fontConfig.Count() == 4)
4903
                                    {
4904
                                        instance.UnderLine = TextDecorations.Underline;
4905
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
4906
                                    }
4907
                                }
4908
                                baseLayer.Add(instance);
4909
                                instance.ApplyTemplate();
4910

    
4911
                                instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
4912

    
4913
                                instance.Base_TextBox.Visibility = Visibility.Collapsed;
4914
                                instance.Base_TextBlock.Visibility = Visibility.Visible;
4915
                        
4916
                                return_control = instance;
4917
                            }
4918
                            break;
4919
                        #endregion
4920

    
4921
                        #region ArrowText
4922
                        case "ArrowTextControl":
4923
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
4924
                            {
4925
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4926
                                ArrowTextControl instance = new ArrowTextControl();
4927
                                //instance.LineSize = Convert.ToDouble(data2.First());
4928
                                instance.PointSet = s.PointSet;
4929
                                instance.StartPoint = s.StartPoint;
4930
                                instance.EndPoint = s.EndPoint;
4931
                                instance.StrokeColor = _SetColor;
4932
                                //instance.DashSize = s.DashSize;
4933
                                instance.ArrowTextStyle = s.ArrowStyle;
4934
                                instance.isHighLight = s.isHighLight;
4935
                                instance.ArrowText = s.ArrowText;
4936
                                instance.Opacity = s.Opac;
4937
                                instance.BorderSize = s.BorderSize;
4938
                                instance.BoxWidth = s.BoxWidth;
4939
                                instance.BoxHeight = s.BoxHeight;
4940
                                instance.isFixed = s.isFixed;
4941
                                instance.Angle = s.Angle;
4942
                                instance.UserID = s.UserID;
4943
                                instance.isTrans = s.isTrans;
4944
                                instance.MidPoint = s.MidPoint;
4945
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
4946
                                {
4947
                                    s.fontConfig = new List<string>();
4948

    
4949
                                    s.fontConfig.Add("Arial");
4950
                                    s.fontConfig.Add("Normal");
4951
                                    s.fontConfig.Add("Normal");
4952
                                    s.fontConfig.Add("30");
4953
                                }
4954
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
4955
                                //instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
4956
                                //instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
4957
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
4958
                                baseLayer.Add(instance);
4959
                                instance.ApplyTemplate();
4960
                                instance.SetArrowTextPath();
4961
                                return_control = instance;
4962
                            };
4963
                            break;
4964
                        #endregion
4965

    
4966
                        #region ETC
4967
                        #region Ink
4968
                        case "InkPresenter":
4969
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
4970
                            {
4971

    
4972
                            }
4973
                            break;
4974
                        #endregion
4975
                        #region Date
4976
                        case "DateControl":
4977
                            {
4978
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
4979
                                {
4980
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4981
                                    DateControl instance = new DateControl
4982
                                    {
4983
                                        Angle = s.Angle,
4984
                                        StartPoint = s.StartPoint,
4985
                                        EndPoint = s.EndPoint,
4986
                                        LeftBottomPoint = s.LB,
4987
                                        TopRightPoint = s.TR,
4988
                                        Opacity = s.Opac,
4989
                                        FontColor = _SetColor,
4990
                                        LineSize = Convert.ToDouble(data2.First()),
4991
                                        Text = s.Text,
4992
                                        PointSet = s.PointSet,
4993
                                        UserID = s.UserID
4994
                                    };
4995
                                    baseLayer.Add(instance);
4996
                                    instance.ApplyTemplate();
4997
                                    return_control = instance;
4998
                                }
4999
                            }
5000
                            break;
5001
                        #endregion
5002
                        #region Image
5003
                        case "ImgControl":
5004
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
5005
                            {
5006
                                Image img = new Image();
5007
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
5008

    
5009
                                ImgControl instance = new ImgControl
5010
                                {
5011
                                    Angle = s.Angle,
5012
                                    StartPoint = s.StartPoint,
5013
                                    TopRightPoint = s.TR,
5014
                                    EndPoint = s.EndPoint,
5015
                                    LeftBottomPoint = s.LB,
5016
                                    PointSet = s.PointSet,
5017
                                    Opacity = s.Opac,
5018
                                    FilePath = s.ImagePath,
5019
                                    UserID = s.UserID,
5020
                                    ImageData = img.Source
5021
                                };
5022

    
5023
                                instance.ApplyTemplate();
5024
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5025
                                baseLayer.Add(instance);
5026
                                instance.ApplyTemplate();
5027
                                instance.SetImage();
5028
                                return_control = instance;
5029
                            }
5030
                            break;
5031
                        #endregion
5032
                        #region Sign
5033
                        case "SignControl":
5034
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
5035
                            {
5036
                                SignControl instance = new SignControl
5037
                                {
5038
                                    Angle = s.Angle,
5039
                                    StartPoint = s.StartPoint,
5040
                                    TopRightPoint = s.TR,
5041
                                    EndPoint = s.EndPoint,
5042
                                    LeftBottomPoint = s.LB,
5043
                                    PointSet = s.PointSet,
5044
                                    Opacity = s.Opac,
5045
                                    SignImage = null,
5046
                                    UserID = s.UserID,
5047
                                };
5048
                                instance.ApplyTemplate();
5049
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5050

    
5051
                                if (s.UserNumber != null)
5052
                                {
5053
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
5054
                                    if (_sign != null)
5055
                                    {
5056
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
5057

    
5058
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
5059
                                        stream.Write(imageBytes, 0, imageBytes.Length);
5060
                                        stream.Position = 0;
5061
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
5062
                                        BitmapImage returnImage = new BitmapImage();
5063
                                        returnImage.BeginInit();
5064
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
5065
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
5066
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
5067
                                        returnImage.StreamSource = ms;
5068
                                        returnImage.EndInit();
5069
                                        stream.Close();
5070
                                        instance.SignImage = returnImage;
5071
                                    }
5072
                                }
5073

    
5074
                                baseLayer.Add(instance);
5075
                                instance.ApplyTemplate();
5076
                                instance.SetImage();
5077
                                return_control = instance;
5078
                            }
5079
                            break;
5080
                        #endregion
5081
                        #region Symbol
5082
                        case "SymControl":
5083
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
5084
                            {
5085
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5086
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
5087
                                SymControl instance = new SymControl
5088
                                {
5089
                                    //Angle = s.Angle,
5090
                                    //StartPoint = s.StartPoint,
5091
                                    //TopRightPoint = s.TR,
5092
                                    //EndPoint = s.EndPoint,
5093
                                    //LeftBottomPoint = s.LB,
5094
                                    //PointSet = s.PointSet,
5095
                                    //Opacity = s.Opac,
5096
                                    //FilePath = s.ImagePath,
5097
                                    //UserID = s.UserID,
5098
                                    //ImageData = s.ImageData
5099
                                    LineSize = Convert.ToDouble(data2.First()),
5100
                                    PointSet = s.PointSet,
5101
                                    Paint = s.PaintState,
5102
                                    StartPoint = s.StartPoint,
5103
                                    StrokeColor = _SetColor,
5104
                                    EndPoint = s.EndPoint,
5105
                                    Angle = s.Angle,
5106
                                    UserID = s.UserID,
5107
                                    LeftBottomPoint = s.LB,
5108
                                    TopRightPoint = s.TR,
5109
                                    PathData = sm.Convert(s.PathInfo.ToString()),
5110
                                    Opacity = s.Opac,
5111
                                };
5112

    
5113
                                baseLayer.Add(instance);
5114
                                //instance.OnApplyTemplate();
5115
                                instance.ApplyTemplate();
5116
                                instance.SetSymPath();
5117
                                return_control = instance;
5118
                            }
5119
                            break;
5120
                        #endregion
5121
                        
5122
                        #region SymbolN
5123
                        case "SymControlN":
5124
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
5125
                            {
5126
                                SymControlN instance = new SymControlN()
5127
                                {
5128
                                    PointSet = s.PointSet,
5129
                                    StartPoint = s.StartPoint,
5130
                                    EndPoint = s.EndPoint,
5131
                                    Angle = s.Angle,
5132
                                    LeftBottomPoint = s.LB,
5133
                                    TopRightPoint = s.TR,
5134
                                    Opacity = s.Opac,
5135
                                    PathXathData = s.DBData,
5136
                                };
5137
                                instance.Memo = s.Memo;
5138
                                baseLayer.Add(instance);
5139
                                instance.ApplyTemplate();
5140

    
5141
                                return_control = instance;
5142

    
5143
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
5144
                                //instance.PathXathData = s.DBData;
5145

    
5146
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
5147
                                //xamlData = xamlData.Replace("daelim", "DAELIM");
5148
                                //System.IO.MemoryStream stream = new System.IO.MemoryStream();
5149
                                //System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
5150
                                //writer.Write(xamlData);
5151
                                //writer.Flush();
5152
                                //stream.Position = 0;
5153

    
5154
                                //object obj = XamlReader.Load(stream);
5155
                                //instance.Base_ViewBox.Child = obj as UIElement;
5156
                                //instance.PathXathData = appovalData;
5157
                                //instance.SetViewBox();
5158
                            }
5159
                            break;
5160
                        #endregion
5161
                        #endregion 
5162
                        default:
5163
                            break;
5164
                    };
5165
                }
5166
            }
5167
            return return_control;
5168
        }
5169

    
5170
        public S_BaseControl markupParse_GetBaseControl(string MarkupString)
5171
        {
5172
            var item = JsonSerializerHelper.UnCompressString(MarkupString); //언패킹작업
5173
            var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
5174
            return unknownData;
5175
        }
5176
    }
5177
}
클립보드 이미지 추가 (최대 크기: 500 MB)