프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Controls / Parsing / MarkupParse.cs @ 5ce56a3a

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

1 787a4489 KangIngu
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
                                    EndPoint = s.EndPoint,
2950
                                    PointSet = s.PointSet,
2951
                                    UserID = s.UserID,
2952
                                    DashSize = s.DashSize,
2953
                                    Paint = s.PaintState,
2954
                                    //강인구 추가(Chain인지 Polygon인지 구분)
2955
                                    ControlType = s.Type,
2956
                                    //PointC = s.PointC,
2957
                                };
2958
                                Layer.Children.Add(instance);
2959
2960
                                instance.ApplyTemplate();
2961
                                instance.SetPolyPath();
2962
2963
                                //instance.PointSet = s.PointSet;
2964
                                //instance.ClosePath();
2965
                                //instance.ChangePaint(s.PaintState);
2966
                            }
2967
                            break;
2968
                        #endregion
2969
                        #region InkControl
2970
                        case "InkControl":
2971
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
2972
                            {
2973
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2974
                                InkControl instance = new InkControl
2975
                                {
2976
                                    LineSize = Convert.ToDouble(data2.First()),
2977
                                    //Toler = s.Toler,
2978
                                    IsCompleted = s.IsCompleted,
2979
                                    //PointSet = new List<Point>(),
2980
                                    Opacity = s.Opac,
2981
                                    StrokeColor = _SetColor,
2982
                                    StartPoint = s.StartPoint,
2983
                                    EndPoint = s.EndPoint,
2984
                                    PointSet = s.PointSet,
2985
                                    UserID = s.UserID,
2986
                                    DashSize = s.DashSize,
2987
                                    Paint = s.PaintState,
2988
                                    //강인구 추가(Chain인지 Polygon인지 구분)
2989
                                    ControlType = s.Type,
2990
                                    //PointC = s.PointC,
2991
                                };
2992
                                Layer.Children.Add(instance);
2993
2994
                                instance.ApplyTemplate();
2995
                                instance.SetPolyPath();
2996
2997
                                //instance.PointSet = s.PointSet;
2998
                                //instance.ClosePath();
2999
                                //instance.ChangePaint(s.PaintState);
3000
                            }
3001
                            break;
3002
                        #endregion
3003
                        #region Cloud
3004
                        case "CloudControl":
3005
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
3006
                            {
3007
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3008
                                CloudControl instance = new CloudControl
3009
                                {
3010
                                    LineSize = Convert.ToDouble(data2.First()),
3011
                                    Toler = s.Toler,
3012
                                    PointSet = new List<Point>(),
3013
                                    ArcLength = s.ArcLength,
3014
                                    Paint = s.PaintState,
3015
                                    Opacity = s.Opac,
3016
                                    StrokeColor = _SetColor,
3017
                                    isTransOn = s.IsTrans,
3018
                                    isChain = s.IsChain,
3019
                                    DashSize = s.DashSize,
3020
                                    UserID = s.UserID,
3021
                                    StartPoint = s.StartPoint,
3022
                                    EndPoint = s.EndPoint,
3023
                                    //Fill = s.CloudFill,
3024
                                };
3025
                                Layer.Children.Add(instance);
3026
                                instance.pointSet = s.PointSet;
3027
                                instance.ApplyTemplate();
3028
                                instance.ClosePath();
3029
                                instance.ChangePaint(s.PaintState);
3030
                            }
3031
                            break;
3032
                        #endregion
3033
                        #endregion
3034
3035
                        #region Line
3036
                        #region Line
3037
                        case "LineControl":
3038
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
3039
                            {
3040
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3041
                                LineControl instance = new LineControl()
3042
                                {
3043
                                    LineStyleSet = s.LineStyleSet,
3044
                                    StartPoint = s.StartPoint,
3045
                                    DimSize = s.DimSize,
3046
                                    EndPoint = s.EndPoint,
3047
                                    DashSize = s.DashSize,
3048
                                    Interval = s.Interval,
3049
                                    PointSet = s.PointSet,
3050
                                    Opacity = s.Opac,
3051
                                    StrokeColor = _SetColor,
3052
                                    UserID = s.UserID,
3053
                                    LineSize = Convert.ToDouble(data2.First()),
3054
                                };
3055
                                Layer.Children.Add(instance);
3056
                                instance.ApplyTemplate();
3057
                                instance.SetLinePath();
3058
                            }
3059
                            break;
3060
                        #endregion
3061
                        #region Arrow_Multi
3062
                        case "ArrowControl_Multi":
3063
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
3064
                            {
3065
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3066
                                ArrowControl_Multi instance = new ArrowControl_Multi
3067
                                {
3068
                                    LineSize = Convert.ToDouble(data2.First()),
3069
                                    StartPoint = s.StartPoint,
3070
                                    MiddlePoint = s.MidPoint,
3071
                                    DashSize = s.DashSize,
3072
                                    EndPoint = s.EndPoint,
3073
                                    PointSet = s.PointSet,
3074
                                    Opacity = s.Opac,
3075
                                    StrokeColor = _SetColor,
3076
                                    UserID = s.UserID
3077
                                };
3078
3079
                                Layer.Children.Add(instance);
3080
                                instance.ApplyTemplate();
3081
                                instance.SetArrowMultiPath();
3082
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3083
3084
                            }
3085
                            break;
3086
                        #endregion
3087
                        #region Arc
3088
                        case "ArcControl":
3089
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
3090
                            {
3091
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3092
                                ArcControl instance = new ArcControl()
3093
                                {
3094
                                    StartPoint = s.StartPoint,
3095
                                    EndPoint = s.EndPoint,
3096
                                    DashSize = s.DashSize,
3097
                                    PointSet = s.PointSet,
3098
                                    isTransOn = s.IsTransOn,
3099
                                    MidPoint = s.MidPoint,
3100
                                    StrokeColor = _SetColor,
3101
                                    Opacity = s.Opac,
3102
                                    Clock = s.Clock,
3103
                                    LineSize = Convert.ToDouble(data2.First()),
3104
                                    UserID = s.UserID,
3105
                                };
3106
3107
                                Layer.Children.Add(instance);
3108
                                instance.ApplyTemplate();
3109
                                instance.SetArcPath();
3110
                            }
3111
                            break;
3112
                        #endregion
3113
                        #endregion
3114
3115
                        #region Text
3116
                        case "TextControl":
3117
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
3118
                            {
3119
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3120
                                TextControl instance = new TextControl()
3121
                                {
3122
                                    Text = s.Text,
3123
                                    StartPoint = s.StartPoint,
3124
                                    EndPoint = s.EndPoint,
3125
                                    CanvasX = s.StartPoint.X,
3126
                                    CanvasY = s.StartPoint.Y,
3127
                                    BoxWidth = s.BoxW,
3128
                                    BoxHeight = s.BoxH,
3129
                                    ControlType_No = s.paintMethod,
3130
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
3131
                                    TextSize = Convert.ToDouble(data2[1]),
3132
                                    FontColor = _SetColor,
3133
                                    FontSize = 10,
3134
                                    UserID = s.UserID,
3135
                                    //isHighLight = s.isHighLight,
3136
                                    Angle = s.Angle,
3137
                                    PointSet = s.PointSet,
3138
                                    Opacity = s.Opac,
3139
                                    TextFamily = new FontFamily(s.fontConfig[0]),
3140
                                    //TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
3141
                                    //TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
3142
                                };
3143
3144
                                if (instance.Text != null)
3145
                                {
3146
                                    Layer.Children.Add(instance);
3147
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
3148
                                    instance.ApplyTemplate();
3149
                                    if (s.fontConfig.Count() == 4)
3150
                                    {
3151
                                        instance.UnderLine = TextDecorations.Underline;
3152
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
3153
                                    }
3154
                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
3155
3156
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3157
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3158
                                    instance.DrawingCloud();
3159
                                    instance.SetText();
3160
                                }
3161
                            }
3162
                            break;
3163
                        #endregion
3164
3165
                        #region ArrowText
3166
                        case "ArrowTextControl":
3167
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
3168
                            {
3169
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3170
                                ArrowTextControl instance = new ArrowTextControl();
3171
                                Layer.Children.Add(instance);
3172
                                //instance.LineSize = Convert.ToDouble(data2.First());
3173
                                instance.PointSet = s.PointSet;
3174
                                instance.StartPoint = s.StartPoint;
3175
                                instance.EndPoint = s.EndPoint;
3176
                                instance.StrokeColor = _SetColor;
3177
                                //instance.DashSize = s.DashSize;
3178
                                instance.ArrowTextStyle = s.ArrowStyle;
3179
                                instance.isHighLight = s.isHighLight;
3180
                                instance.ArrowText = s.ArrowText;
3181
                                instance.Opacity = s.Opac;
3182
                                instance.BorderSize = s.BorderSize;
3183
                                instance.BoxWidth = s.BoxWidth;
3184
                                instance.BoxHeight = s.BoxHeight;
3185
                                instance.isFixed = s.isFixed;
3186
                                instance.Angle = s.Angle;
3187
                                instance.UserID = s.UserID;
3188
                                instance.isTrans = s.isTrans;
3189
                                instance.MidPoint = s.MidPoint;
3190
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
3191
                                {
3192
                                    s.fontConfig = new List<string>();
3193
3194
                                    s.fontConfig.Add("Arial");
3195
                                    s.fontConfig.Add("Normal");
3196
                                    s.fontConfig.Add("Normal");
3197
                                    s.fontConfig.Add("30");
3198
                                }
3199
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
3200
                                //instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
3201
                                //instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
3202
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
3203
                                instance.ApplyTemplate();
3204
                                instance.SetArrowTextPath();
3205
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3206
                            };
3207
                            break;
3208
                        #endregion
3209
3210
                        #region Date
3211
                        case "DateControl":
3212
                            {
3213
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
3214
                                {
3215
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3216
                                    DateControl instance = new DateControl
3217
                                    {
3218
                                        Angle = s.Angle,
3219
                                        StartPoint = s.StartPoint,
3220
                                        EndPoint = s.EndPoint,
3221
                                        LeftBottomPoint = s.LB,
3222
                                        TopRightPoint = s.TR,
3223
                                        Opacity = s.Opac,
3224
                                        FontColor = _SetColor,
3225
                                        LineSize = Convert.ToDouble(data2.First()),
3226
                                        Text = s.Text,
3227
                                        PointSet = s.PointSet,
3228
                                        UserID = s.UserID
3229
                                    };
3230
3231
                                    Layer.Children.Add(instance);
3232
                                    instance.ApplyTemplate();
3233
                                    instance.SetDate();
3234
                                }
3235
                            }
3236
                            break;
3237
                        #endregion
3238
3239
                        #region Image
3240
                        case "ImgControl":
3241
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
3242
                            {
3243
                                Image img = new Image();
3244
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
3245
3246
                                ImgControl instance = new ImgControl
3247
                                {
3248
                                    Angle = s.Angle,
3249
                                    StartPoint = s.StartPoint,
3250
                                    TopRightPoint = s.TR,
3251
                                    EndPoint = s.EndPoint,
3252
                                    LeftBottomPoint = s.LB,
3253
                                    PointSet = s.PointSet,
3254
                                    Opacity = s.Opac,
3255
                                    FilePath = s.ImagePath,
3256
                                    UserID = s.UserID,
3257
                                    ImageData = img.Source
3258
                                };
3259
                                Layer.Children.Add(instance);
3260
                                instance.ApplyTemplate();
3261
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3262
                                instance.SetImage();
3263
3264
                            }
3265
                            break;
3266
                        #endregion
3267
3268
                        #region Symbol
3269
                        case "SymControl":
3270
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
3271
                            {
3272
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3273
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
3274
                                SymControl instance = new SymControl()
3275
                                {
3276
                                    LineSize = Convert.ToDouble(data2.First()),
3277
                                    PointSet = s.PointSet,
3278
                                    Paint = s.PaintState,
3279
                                    StartPoint = s.StartPoint,
3280
                                    StrokeColor = _SetColor,
3281
                                    EndPoint = s.EndPoint,
3282
                                    Angle = s.Angle,
3283
                                    LeftBottomPoint = s.LB,
3284
                                    TopRightPoint = s.TR,
3285
                                    PathData = sm.Convert(s.PathInfo.ToString()),
3286
                                    Opacity = s.Opac,
3287
                                };
3288
                                instance.Memo = s.Memo;
3289
                                Layer.Children.Add(instance);
3290
                                instance.ApplyTemplate();
3291
                                instance.SetSymPath();
3292
                            }
3293
                            break;
3294
                        #endregion
3295
3296
                        #region SymbolN
3297
                        case "SymControlN":
3298
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
3299
                            {
3300
                                SymControlN instance = new SymControlN()
3301
                                {
3302
                                    PointSet = s.PointSet,
3303
                                    StartPoint = s.StartPoint,
3304
                                    EndPoint = s.EndPoint,
3305
                                    Angle = s.Angle,
3306
                                    LeftBottomPoint = s.LB,
3307
                                    TopRightPoint = s.TR,
3308
                                    Opacity = s.Opac,
3309
                                    PathXathData = s.DBData,
3310
                                };
3311
3312
                                instance.Memo = s.Memo;
3313
                                Layer.Children.Add(instance);
3314
                                instance.ApplyTemplate();
3315
3316
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3317
                                //instance.PathXathData = s.DBData;
3318
3319
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3320
                                xamlData = xamlData.Replace("daelim", "DAELIM");
3321
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
3322
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
3323
                                writer.Write(xamlData);
3324
                                writer.Flush();
3325
                                stream.Position = 0;
3326
3327
                                object obj = XamlReader.Load(stream);
3328
                                instance.Base_ViewBox.Child = obj as UIElement;
3329
                                instance.PathXathData = appovalData;
3330
                                instance.SetViewBox();
3331
                            }
3332
                            break;
3333
                        #endregion
3334
3335
                        #region Sign
3336
                        case "SignControl":
3337
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
3338
                            {
3339
                                SignControl instance = new SignControl
3340
                                {
3341
                                    Angle = s.Angle,
3342
                                    StartPoint = s.StartPoint,
3343
                                    TopRightPoint = s.TR,
3344
                                    EndPoint = s.EndPoint,
3345
                                    LeftBottomPoint = s.LB,
3346
                                    PointSet = s.PointSet,
3347
                                    Opacity = s.Opac,
3348
                                    SignImage = null,
3349
                                    UserID = s.UserID,
3350
                                };
3351
                                instance.ApplyTemplate();
3352
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3353
3354
                                if (s.UserNumber != null)
3355
                                {
3356
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
3357
                                    if (_sign != null)
3358
                                    {
3359
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
3360
3361
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
3362
                                        stream.Write(imageBytes, 0, imageBytes.Length);
3363
                                        stream.Position = 0;
3364
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
3365
                                        BitmapImage returnImage = new BitmapImage();
3366
                                        returnImage.BeginInit();
3367
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
3368
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
3369
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
3370
                                        returnImage.StreamSource = ms;
3371
                                        returnImage.EndInit();
3372
                                        stream.Close();
3373
                                        instance.SignImage = returnImage;
3374
                                    }
3375
                                }
3376
3377
3378
                                instance.Memo = s.Memo;
3379
                                Layer.Children.Add(instance);
3380
                                instance.ApplyTemplate();
3381
                                instance.SetImage();
3382
                            }
3383
                            break;
3384
                        #endregion
3385
3386
3387
3388
                        default:
3389
                            break;
3390
                    };
3391
                }
3392
            }
3393
        }
3394
3395
        /// <summary>
3396
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
3397
        /// </summary>
3398
        /// <param name="MarkupString"></param>
3399
        public void markupParse(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID)
3400
        {
3401
            if (MarkupString != "False")
3402
            {
3403
                //GetUserSign getUser = new GetUserSign();
3404
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
3405
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
3406
                string[] delimiterChars = { "|DZ|" };
3407
                string[] delimiterChars2 = { "|" };
3408
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
3409
                List<string> dataSet = new List<string>();
3410
3411
                foreach (var dataPease in data)
3412
                {
3413
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
3414
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
3415
                    switch (unkownControl.Name)
3416
                    {
3417
                        #region ArrowText
3418
                        case "ArrowTextControl":
3419
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
3420
                            {
3421
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3422
                                ArrowTextControl instance = new ArrowTextControl();
3423
                                instance.MarkupInfoID = markupInfoID;
3424
                                //Layer.Children.Add(instance);
3425
                                baseLayer.Add(instance);
3426
                                //instance.LineSize = Convert.ToDouble(data2.First());
3427
                                instance.PointSet = s.PointSet;
3428
                                instance.StartPoint = s.StartPoint;
3429
                                instance.EndPoint = s.EndPoint;
3430
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
3431
                                //instance.DashSize = s.DashSize;
3432
                                instance.ArrowTextStyle = s.ArrowStyle;
3433
                                instance.isHighLight = s.isHighLight;
3434
                                instance.ArrowText = s.ArrowText;
3435
                                instance.Opacity = s.Opac;
3436
                                instance.BorderSize = s.BorderSize;
3437
                                instance.BoxWidth = s.BoxWidth;
3438
                                instance.BoxHeight = s.BoxHeight;
3439
                                instance.isFixed = s.isFixed;
3440
                                instance.Angle = s.Angle;
3441
                                instance.UserID = s.UserID;
3442
                                instance.StrokeColor = _SetColor;
3443
                                instance.isTrans = s.isTrans;
3444
                                instance.MidPoint = s.MidPoint;
3445
                                instance.Memo = s.Memo;
3446
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
3447
                                {
3448
                                    s.fontConfig = new List<string>();
3449
3450
                                    s.fontConfig.Add("Arial");
3451
                                    s.fontConfig.Add("Normal");
3452
                                    s.fontConfig.Add("Normal");
3453
                                    s.fontConfig.Add("30");
3454
                                }
3455
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
3456
                                //instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
3457
                                //instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
3458
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
3459
                                instance.ApplyTemplate();
3460
                                instance.SetArrowTextPath();
3461
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3462
                            };
3463
                            break;
3464
                        #endregion
3465
                        #region Arrow_Multi
3466
                        case "ArrowControl_Multi":
3467
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
3468
                            {
3469
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3470
                                ArrowControl_Multi instance = new ArrowControl_Multi
3471
                                {
3472
                                    LineSize = Convert.ToDouble(data2.First()),
3473
                                    StartPoint = s.StartPoint,
3474
                                    MiddlePoint = s.MidPoint,
3475
                                    DashSize = s.DashSize,
3476
                                    EndPoint = s.EndPoint,
3477
                                    PointSet = s.PointSet,
3478
                                    Opacity = s.Opac,
3479
                                    StrokeColor = _SetColor,
3480
                                    UserID = s.UserID
3481
                                };
3482
3483
                                //Layer.Children.Add(instance);
3484
                                instance.MarkupInfoID = markupInfoID;
3485
                                baseLayer.Add(instance);
3486
                                instance.ApplyTemplate();
3487
                                instance.SetArrowMultiPath();
3488
                                instance.Memo = s.Memo;
3489
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3490
3491
                            }
3492
                            break;
3493
                        #endregion
3494
                        #region Rectangle
3495
                        case "RectangleControl":
3496
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
3497
                            {
3498
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3499
                                RectangleControl instance = new RectangleControl
3500
                                {
3501
                                    LineSize = Convert.ToDouble(data2.First()),
3502
                                    Paint = s.PaintState,
3503
                                    StartPoint = s.StartPoint,
3504
                                    EndPoint = s.EndPoint,
3505
                                    Angle = s.Angle,
3506
                                    StrokeColor = _SetColor,
3507
                                    DashSize = s.DashSize,
3508
                                    Opacity = s.Opac,
3509
                                    LeftBottomPoint = s.LB,
3510
                                    TopRightPoint = s.TR,
3511
                                    PointSet = s.PointSet,
3512
                                    UserID = s.UserID
3513
                                };
3514
3515
                                instance.Memo = s.Memo;
3516
                                //Layer.Children.Add(instance);
3517
                                instance.MarkupInfoID = markupInfoID;
3518
                                baseLayer.Add(instance);
3519
                                instance.ApplyTemplate();
3520
                                instance.SetRectPath();
3521
                            }
3522
                            break;
3523
                        #endregion
3524
                        #region Triangle
3525
                        case "TriControl":
3526
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
3527
                            {
3528
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3529
                                TriControl instance = new TriControl
3530
                                {
3531
                                    LineSize = Convert.ToDouble(data2.First()),
3532
                                    MidPoint = s.MidPoint,
3533
                                    StartPoint = s.StartPoint,
3534
                                    Paint = s.Paint,
3535
                                    EndPoint = s.EndPoint,
3536
                                    Opacity = s.Opac,
3537
                                    Angle = s.Angle,
3538
                                    DashSize = s.DashSize,
3539
                                    PointSet = s.PointSet,
3540
                                    StrokeColor = _SetColor,
3541
                                    UserID = s.UserID,
3542
                                };
3543
                                instance.Memo = s.Memo;
3544
                                //Layer.Children.Add(instance);
3545
                                instance.MarkupInfoID = markupInfoID;
3546
                                baseLayer.Add(instance);
3547
                                instance.ApplyTemplate();
3548
                                instance.SetTri();
3549
                            }
3550
                            break;
3551
                        #endregion
3552
                        #region Cicle
3553
                        case "CircleControl":
3554
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
3555
                            {
3556
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3557
                                CircleControl instance = new CircleControl
3558
                                {
3559
                                    LineSize = Convert.ToDouble(data2.First()),
3560
                                    Paint = s.PaintState,
3561
                                    StartPoint = s.StartPoint,
3562
                                    EndPoint = s.EndPoint,
3563
                                    LeftBottomPoint = s.LBP,
3564
                                    TopRightPoint = s.TRP,
3565
                                    Opacity = s.Opac,
3566
                                    Angle = s.Angle,
3567
                                    DashSize = s.DashSize,
3568
                                    PointSet = s.PointSet,
3569
                                    StrokeColor = _SetColor,
3570
                                    UserID = s.UserID,
3571
                                };
3572
                                instance.Memo = s.Memo;
3573
                                //Layer.Children.Add(instance);
3574
                                instance.MarkupInfoID = markupInfoID;
3575
                                baseLayer.Add(instance);
3576
                                instance.ApplyTemplate();
3577
                                instance.SetCircle();
3578
                            }
3579
                            break;
3580
                        #endregion
3581
                        #region Poly
3582
                        case "PolygonControl":
3583
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
3584
                            {
3585
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3586
                                PolygonControl instance = new PolygonControl
3587
                                {
3588
                                    LineSize = Convert.ToDouble(data2.First()),
3589
                                    //Toler = s.Toler,
3590
                                    IsCompleted = s.IsCompleted,
3591
                                    //PointSet = new List<Point>(),
3592
                                    Opacity = s.Opac,
3593
                                    StrokeColor = _SetColor,
3594
                                    DashSize = s.DashSize,
3595
                                    StartPoint = s.StartPoint,
3596
                                    EndPoint = s.EndPoint,
3597
                                    PointSet = s.PointSet,
3598
                                    UserID = s.UserID,
3599
                                    //강인구 추가(Chain인지 Polygon인지 구분)
3600
                                    ControlType = s.Type,
3601
                                    Paint = s.PaintState,
3602
                                    //PointC = s.PointC,
3603
                                };
3604
                                //Layer.Children.Add(instance);
3605
                                instance.MarkupInfoID = markupInfoID;
3606
                                baseLayer.Add(instance);
3607
                                instance.Memo = s.Memo;
3608
                                instance.ApplyTemplate();
3609
                                instance.SetPolyPath();
3610
3611
                                //instance.PointSet = s.PointSet;
3612
                                //instance.ClosePath();
3613
                                //instance.ChangePaint(s.PaintState);
3614
                            }
3615
                            break;
3616
                        #endregion
3617
                        #region InkControl
3618
                        case "InkControl":
3619
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
3620
                            {
3621
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3622
                                InkControl instance = new InkControl
3623
                                {
3624
                                    LineSize = Convert.ToDouble(data2.First()),
3625
                                    //Toler = s.Toler,
3626
                                    IsCompleted = s.IsCompleted,
3627
                                    //PointSet = new List<Point>(),
3628
                                    Opacity = s.Opac,
3629
                                    StrokeColor = _SetColor,
3630
                                    DashSize = s.DashSize,
3631
                                    StartPoint = s.StartPoint,
3632
                                    PointSet = s.PointSet,
3633
                                    UserID = s.UserID,
3634
                                    //강인구 추가(Chain인지 Polygon인지 구분)
3635
                                    ControlType = s.Type,
3636
                                    Paint = s.PaintState,
3637
                                    EndPoint = s.EndPoint,
3638
                                    //PointC = s.PointC,
3639
                                };
3640
                                //Layer.Children.Add(instance);
3641
                                instance.MarkupInfoID = markupInfoID;
3642
                                baseLayer.Add(instance);
3643
                                instance.Memo = s.Memo;
3644
                                instance.ApplyTemplate();
3645
                                instance.SetPolyPath();
3646
3647
                                //instance.PointSet = s.PointSet;
3648
                                //instance.ClosePath();
3649
                                //instance.ChangePaint(s.PaintState);
3650
                            }
3651
                            break;
3652
                        #endregion
3653
                        #region Cloud
3654
                        case "CloudControl":
3655
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
3656
                            {
3657
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3658
                                CloudControl instance = new CloudControl
3659
                                {
3660
                                    LineSize = Convert.ToDouble(data2.First()),
3661
                                    Toler = s.Toler,
3662
                                    PointSet = new List<Point>(),
3663
                                    ArcLength = s.ArcLength,
3664
                                    Paint = s.PaintState,
3665
                                    Opacity = s.Opac,
3666
                                    StrokeColor = _SetColor,
3667
                                    isTransOn = s.IsTrans,
3668
                                    isChain = s.IsChain,
3669
                                    DashSize = s.DashSize,
3670
                                    UserID = s.UserID,
3671
                                    StartPoint = s.StartPoint,
3672
                                    EndPoint = s.EndPoint,
3673
                                    //Fill = s.CloudFill,
3674
                                };
3675
                                instance.Memo = s.Memo;
3676
                                //Layer.Children.Add(instance);
3677
                                instance.MarkupInfoID = markupInfoID;
3678
                                baseLayer.Add(instance);
3679
                                instance.PointSet = s.PointSet;
3680
                                instance.ApplyTemplate();
3681
                                instance.ClosePath();
3682
                                instance.ChangePaint(s.PaintState);
3683
                            }
3684
                            break;
3685
                        #endregion
3686
                        #region Line
3687
                        case "LineControl":
3688
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
3689
                            {
3690
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3691
                                LineControl instance = new LineControl()
3692
                                {
3693
                                    LineStyleSet = s.LineStyleSet,
3694
                                    StartPoint = s.StartPoint,
3695
                                    DimSize = s.DimSize,
3696
                                    EndPoint = s.EndPoint,
3697
                                    DashSize = s.DashSize,
3698
                                    Interval = s.Interval,
3699
                                    PointSet = s.PointSet,
3700
                                    Opacity = s.Opac,
3701
                                    StrokeColor = _SetColor,
3702
                                    UserID = s.UserID,
3703
                                    LineSize = Convert.ToDouble(data2.First()),
3704
                                };
3705
                                instance.Memo = s.Memo;
3706
                                //Layer.Children.Add(instance);
3707
                                instance.MarkupInfoID = markupInfoID;
3708
                                baseLayer.Add(instance);
3709
                                instance.ApplyTemplate();
3710
                                instance.SetLinePath();
3711
                            }
3712
                            break;
3713
                        #endregion
3714
                        #region Text
3715
                        case "TextControl":
3716
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
3717
                            {
3718
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3719
                                TextControl instance = new TextControl()
3720
                                {
3721
                                    Text = s.Text,
3722
                                    StartPoint = s.StartPoint,
3723
                                    EndPoint = s.EndPoint,
3724
                                    CanvasX = s.StartPoint.X,
3725
                                    CanvasY = s.StartPoint.Y,
3726
                                    BoxWidth = s.BoxW,
3727
                                    BoxHeight = s.BoxH,
3728
                                    ControlType_No = s.paintMethod,
3729
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
3730
                                    TextSize = Convert.ToDouble(data2[1]),
3731
                                    FontColor = _SetColor,
3732
                                    FontSize = 10,
3733
                                    UserID = s.UserID,
3734
                                    //isHighLight = s.isHighLight,
3735
                                    Angle = s.Angle,
3736
                                    PointSet = s.PointSet,
3737
                                    Opacity = s.Opac,
3738
                                    TextFamily = new FontFamily(s.fontConfig[0]),
3739
                                    //TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
3740
                                    //TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
3741
                                };
3742
3743
                                if (instance.Text != null)
3744
                                {
3745
                                    //Layer.Children.Add(instance);
3746
                                    instance.MarkupInfoID = markupInfoID;
3747
                                    baseLayer.Add(instance);
3748
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
3749
                                    instance.ApplyTemplate();
3750
                                    instance.Memo = s.Memo;
3751
                                    if (s.fontConfig.Count() == 4)
3752
                                    {
3753
                                        instance.UnderLine = TextDecorations.Underline;
3754
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
3755
                                    }
3756
                                    instance.Base_TextBlock.Margin = new Thickness(0,0,10,0);
3757
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3758
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3759
                                    instance.DrawingCloud();
3760
                                    instance.SetText();
3761
                                }
3762
                            }
3763
                            break;
3764
                        #endregion
3765
                        #region Arc
3766
                        case "ArcControl":
3767
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
3768
                            {
3769
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3770
                                ArcControl instance = new ArcControl()
3771
                                {
3772
                                    StartPoint = s.StartPoint,
3773
                                    EndPoint = s.EndPoint,
3774
                                    DashSize = s.DashSize,
3775
                                    PointSet = s.PointSet,
3776
                                    isTransOn = s.IsTransOn,
3777
                                    MidPoint = s.MidPoint,
3778
                                    StrokeColor = _SetColor,
3779
                                    Clock = s.Clock,
3780
                                    Opacity = s.Opac,
3781
                                    LineSize = Convert.ToDouble(data2.First()),
3782
                                    UserID = s.UserID,
3783
                                };
3784
                                instance.Memo = s.Memo;
3785
                                //Layer.Children.Add(instance);
3786
                                instance.MarkupInfoID = markupInfoID;
3787
                                baseLayer.Add(instance);
3788
                                instance.ApplyTemplate();
3789
                                instance.SetArcPath();
3790
                            }
3791
                            break;
3792
                        #endregion
3793
                        #region RectCloud
3794
                        case "RectCloudControl":
3795
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
3796
                            {
3797
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3798
                                RectCloudControl instance = new RectCloudControl()
3799
                                {
3800
                                    StartPoint = s.StartPoint,
3801
                                    EndPoint = s.EndPoint,
3802
                                    LeftBottomPoint = s.LB,
3803
                                    Paint = s.PaintState,
3804
                                    Opacity = s.Opac,
3805
                                    DashSize = s.DashSize,
3806
                                    TopRightPoint = s.TR,
3807
                                    PointSet = s.PointSet,
3808
                                    StrokeColor = _SetColor,
3809
                                    LineSize = Convert.ToDouble(data2.First()),
3810
                                    UserID = s.UserID
3811
                                };
3812
                                instance.Memo = s.Memo;
3813
                                //Layer.Children.Add(instance);
3814
                                instance.MarkupInfoID = markupInfoID;
3815
                                baseLayer.Add(instance);
3816
                                instance.ApplyTemplate();
3817
                                instance.SetRectCloud();
3818
                            }
3819
                            break;
3820
                        #endregion
3821
                        #region Sign
3822
                        case "SignControl":
3823
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
3824
                            {
3825
                                SignControl instance = new SignControl
3826
                                {
3827
                                    Angle = s.Angle,
3828
                                    StartPoint = s.StartPoint,
3829
                                    TopRightPoint = s.TR,
3830
                                    EndPoint = s.EndPoint,
3831
                                    LeftBottomPoint = s.LB,
3832
                                    PointSet = s.PointSet,
3833
                                    Opacity = s.Opac,
3834
                                    SignImage = null,
3835
                                    UserID = s.UserID,
3836
                                };
3837
                                instance.ApplyTemplate();
3838
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3839
3840
                                if (s.UserNumber != null)
3841
                                {
3842
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
3843
                                    if (_sign != null)
3844
                                    {
3845
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
3846
3847
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
3848
                                        stream.Write(imageBytes, 0, imageBytes.Length);
3849
                                        stream.Position = 0;
3850
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
3851
                                        BitmapImage returnImage = new BitmapImage();
3852
                                        returnImage.BeginInit();
3853
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
3854
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
3855
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
3856
                                        returnImage.StreamSource = ms;
3857
                                        returnImage.EndInit();
3858
                                        stream.Close();
3859
                                        instance.SignImage = returnImage;
3860
                                    }
3861
                                }
3862
3863
                                instance.Memo = s.Memo;
3864
                                //Layer.Children.Add(instance);
3865
                                instance.MarkupInfoID = markupInfoID;
3866
                                baseLayer.Add(instance);
3867
                                instance.ApplyTemplate();
3868
                                instance.SetImage();
3869
3870
                                //baseLayer.Add(instance);
3871
                                //instance.ApplyTemplate();
3872
                                //instance.SetImage();
3873
                                //return_control = instance;
3874
                            }
3875
                            break;
3876
                        #endregion
3877
                        #region Ink
3878
                        case "InkPresenter":
3879
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
3880
                            {
3881
#if SILVERLIGHT
3882
                                this._InkBoard.Strokes = s.SCC; 
3883
#endif
3884
                            }
3885
                            break;
3886
                        #endregion
3887
                        #region Date
3888
                        case "DateControl":
3889
                            {
3890
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
3891
                                {
3892
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3893
                                    DateControl instance = new DateControl
3894
                                    {
3895
                                        Angle = s.Angle,
3896
                                        StartPoint = s.StartPoint,
3897
                                        EndPoint = s.EndPoint,
3898
                                        LeftBottomPoint = s.LB,
3899
                                        TopRightPoint = s.TR,
3900
                                        Opacity = s.Opac,
3901
                                        FontColor = _SetColor,
3902
                                        LineSize = Convert.ToDouble(data2.First()),
3903
                                        Text = s.Text,
3904
                                        PointSet = s.PointSet,
3905
                                        UserID = s.UserID
3906
                                    };
3907
                                    instance.Memo = s.Memo;
3908
                                    instance.MarkupInfoID = markupInfoID;
3909
                                    //Layer.Children.Add(instance);
3910
                                    baseLayer.Add(instance);
3911
                                    instance.ApplyTemplate();
3912
                                    instance.SetDate();
3913
                                }
3914
                            }
3915
                            break;
3916
                        #endregion
3917
                        #region Symbol
3918
//                        case "SymControl":
3919
//                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
3920
//                            {
3921
//                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3922
//                                StringToPathConverter sm = new StringToPathConverter();
3923
//                                SymControl instance = new SymControl()
3924
//                                {
3925
//                                    LineSize = Convert.ToDouble(data2.First()),
3926
//                                    PointSet = s.PointSet,
3927
//                                    Paint = s.PaintState,
3928
//                                    StartPoint = s.StartPoint,
3929
//                                    StrokeColor = _SetColor,
3930
//                                    EndPoint = s.EndPoint,
3931
//                                    Angle = s.Angle,
3932
//                                    LeftBottomPoint = s.LB,
3933
//                                    TopRightPoint = s.TR,
3934
//                                    PathData = sm.Convert(s.PathInfo.ToString()),
3935
//                                    Opacity = s.Opac,
3936
//                                };
3937
//                                //if (ToolTipService.GetToolTip(instance).ToString() == "")
3938
//                                //{
3939
//#if SILVERLIGHT
3940
//                                ToolTipService.SetToolTip(instance, UserNumber);
3941
//#endif
3942
//                                //} //조장원
3943
//                                Layer.Children.Add(instance);
3944
//                                instance.ApplyTemplate();
3945
//                                instance.SetSymPath();
3946
//                            }
3947
//                            break;
3948
                        #endregion
3949
                        #region Image
3950
                        case "ImgControl":
3951
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
3952
                            {
3953
                                Image img = new Image();
3954
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
3955
3956
                                ImgControl instance = new ImgControl
3957
                                {
3958
                                    Angle = s.Angle,
3959
                                    StartPoint = s.StartPoint,
3960
                                    TopRightPoint = s.TR,
3961
                                    EndPoint = s.EndPoint,
3962
                                    LeftBottomPoint = s.LB,
3963
                                    PointSet = s.PointSet,
3964
                                    Opacity = s.Opac,
3965
                                    FilePath = s.ImagePath,
3966
                                    UserID = s.UserID,
3967
                                    ImageData = img.Source
3968
                                };
3969
                                //Layer.Children.Add(instance);
3970
                                instance.Memo = s.Memo;
3971
                                baseLayer.Add(instance);
3972
                                instance.MarkupInfoID = markupInfoID;
3973
                                instance.ApplyTemplate();
3974
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3975
                                instance.SetImage();
3976
3977
                            }
3978
                            break;
3979
                        #endregion
3980
                        #region SymbolN
3981
                        case "SymControlN":
3982
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
3983
                            {
3984
                                SymControlN instance = new SymControlN()
3985
                                {
3986
                                    PointSet = s.PointSet,
3987
                                    StartPoint = s.StartPoint,
3988
                                    EndPoint = s.EndPoint,
3989
                                    Angle = s.Angle,
3990
                                    LeftBottomPoint = s.LB,
3991
                                    TopRightPoint = s.TR,
3992
                                    Opacity = s.Opac,
3993
                                    PathXathData = s.DBData,
3994
                                };
3995
                                instance.Memo = s.Memo;
3996
                                baseLayer.Add(instance);
3997
                                instance.MarkupInfoID = markupInfoID;
3998
                                instance.ApplyTemplate();
3999
4000
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
4001
                                //instance.PathXathData = s.DBData;
4002
4003
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
4004
                                xamlData = xamlData.Replace("daelim", "DAELIM");
4005
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
4006
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
4007
                                writer.Write(xamlData);
4008
                                writer.Flush();
4009
                                stream.Position = 0;
4010
4011
                                object obj = XamlReader.Load(stream);
4012
                                instance.Base_ViewBox.Child = obj as UIElement;
4013
                                instance.PathXathData = appovalData;
4014
                                instance.SetViewBox();
4015
                            }
4016
                            break;
4017
                        #endregion
4018
                        default:
4019
                            break;
4020
                    };
4021
                }
4022
            }
4023
        }
4024
4025
4026
        /// <summary>
4027
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
4028
        /// </summary>
4029
        /// <param name="MarkupString"></param>
4030
        public void markupParseEx(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId)
4031
        {
4032
            if (MarkupString != "False")
4033
            {
4034
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
4035
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
4036
                string[] delimiterChars = { "|DZ|" };
4037
                string[] delimiterChars2 = { "|" };
4038
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
4039
                List<string> dataSet = new List<string>();
4040
4041
                foreach (var dataPease in data)
4042
                {
4043
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
4044
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
4045
                    switch (unkownControl.Name)
4046
                    {
4047
                        #region ArrowText
4048
                        case "ArrowTextControl":
4049
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
4050
                            {
4051
                                ////string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4052
                                //ArrowTextControl instance = new ArrowTextControl();
4053
                                //instance.MarkupInfoID = markupInfoID;
4054
                                ////Layer.Children.Add(instance);
4055
                                //baseLayer.Add(instance);
4056
                                ////instance.LineSize = Convert.ToDouble(data2.First());
4057
                                //instance.PointSet = s.PointSet;
4058
                                //instance.StartPoint = s.StartPoint;
4059
                                //instance.EndPoint = s.EndPoint;
4060
                                //instance.StrokeColor = new SolidColorBrush(Colors.Red);
4061
                                ////instance.DashSize = s.DashSize;
4062
                                //instance.ArrowTextStyle = s.ArrowStyle;
4063
                                //instance.isHighLight = s.isHighLight;
4064
                                //instance.ArrowText = s.ArrowText;
4065
                                //instance.Opacity = s.Opac;
4066
                                //instance.BorderSize = s.BorderSize;
4067
                                //instance.BoxWidth = s.BoxWidth;
4068
                                //instance.BoxHeight = s.BoxHeight;
4069
                                //instance.isFixed = s.isFixed;
4070
                                //instance.Angle = s.Angle;
4071
                                //instance.UserID = s.UserID;
4072
                                //instance.StrokeColor = _SetColor;
4073
                                //instance.isTrans = s.isTrans;
4074
                                //instance.MidPoint = s.MidPoint;
4075
                                //instance.Memo = s.Memo;
4076
                                //if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
4077
                                //{
4078
                                //    s.fontConfig = new List<string>();
4079
4080
                                //    s.fontConfig.Add("Arial");
4081
                                //    s.fontConfig.Add("Normal");
4082
                                //    s.fontConfig.Add("Normal");
4083
                                //    s.fontConfig.Add("30");
4084
                                //}
4085
                                //instance.TextFamily = new FontFamily(s.fontConfig[0]);
4086
                                ////instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
4087
                                ////instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
4088
                                //instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
4089
                                //instance.ApplyTemplate();
4090
                                //instance.SetArrowTextPath();
4091
                                //instance.CommentID = commentId;
4092
                                ////instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
4093
4094
4095
                                #region 신규
4096
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4097
                                ArrowTextControl instance = new ArrowTextControl();
4098
                                instance.MarkupInfoID = markupInfoID;
4099
                                //Layer.Children.Add(instance);
4100
                                baseLayer.Add(instance);
4101
                                instance.ApplyTemplate();
4102
                                //instance.LineSize = Convert.ToDouble(data2.First());
4103
                                instance.PointSet = s.PointSet;
4104
                                instance.StartPoint = s.StartPoint;
4105
                                instance.EndPoint = s.EndPoint;
4106
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
4107
                                //instance.DashSize = s.DashSize;
4108
                                instance.ArrowTextStyle = s.ArrowStyle;
4109
                                instance.isHighLight = s.isHighLight;
4110
                                instance.ArrowText = s.ArrowText;
4111
                                instance.Opacity = s.Opac;
4112
                                instance.BorderSize = s.BorderSize;
4113
                                instance.BoxWidth = s.BoxWidth;
4114
                                instance.BoxHeight = s.BoxHeight;
4115
                                instance.isFixed = s.isFixed;
4116
                                instance.Angle = s.Angle;
4117
                                instance.UserID = s.UserID;
4118
                                instance.StrokeColor = _SetColor;
4119
                                instance.isTrans = s.isTrans;
4120
                                instance.MidPoint = s.MidPoint;
4121
                                instance.Memo = s.Memo;
4122
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
4123
                                {
4124
                                    s.fontConfig = new List<string>();
4125
4126
                                    s.fontConfig.Add("Arial");
4127
                                    s.fontConfig.Add("Normal");
4128
                                    s.fontConfig.Add("Normal");
4129
                                    s.fontConfig.Add("30");
4130
                                }
4131
4132
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
4133
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
4134
                                instance.SetArrowTextPath();
4135
                                instance.Base_TextBox.IsHitTestVisible = false;
4136
                                instance.CommentID = commentId;
4137
                                #endregion
4138
4139
4140
                            };
4141
                            break;
4142
                        #endregion
4143
                        #region Arrow_Multi
4144
                        case "ArrowControl_Multi":
4145
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
4146
                            {
4147
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4148
                                ArrowControl_Multi instance = new ArrowControl_Multi
4149
                                {
4150
                                    LineSize = Convert.ToDouble(data2.First()),
4151
                                    StartPoint = s.StartPoint,
4152
                                    MiddlePoint = s.MidPoint,
4153
                                    DashSize = s.DashSize,
4154
                                    EndPoint = s.EndPoint,
4155
                                    PointSet = s.PointSet,
4156
                                    Opacity = s.Opac,
4157
                                    StrokeColor = _SetColor,
4158
                                    UserID = s.UserID
4159
                                };
4160
4161
                                //Layer.Children.Add(instance);
4162
                                instance.MarkupInfoID = markupInfoID;
4163
                                baseLayer.Add(instance);
4164
                                instance.ApplyTemplate();
4165
                                instance.SetArrowMultiPath();
4166
                                instance.Memo = s.Memo;
4167
                                instance.CommentID = commentId;
4168
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
4169
4170
                            }
4171
                            break;
4172
                        #endregion
4173
                        #region Rectangle
4174
                        case "RectangleControl":
4175
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
4176
                            {
4177
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4178
                                RectangleControl instance = new RectangleControl
4179
                                {
4180
                                    LineSize = Convert.ToDouble(data2.First()),
4181
                                    Paint = s.PaintState,
4182
                                    StartPoint = s.StartPoint,
4183
                                    EndPoint = s.EndPoint,
4184
                                    Angle = s.Angle,
4185
                                    StrokeColor = _SetColor,
4186
                                    DashSize = s.DashSize,
4187
                                    Opacity = s.Opac,
4188
                                    LeftBottomPoint = s.LB,
4189
                                    TopRightPoint = s.TR,
4190
                                    PointSet = s.PointSet,
4191
                                    UserID = s.UserID
4192
                                };
4193
4194
                                instance.Memo = s.Memo;
4195
                                //Layer.Children.Add(instance);
4196
                                instance.CommentID = commentId;
4197
                                instance.MarkupInfoID = markupInfoID;
4198
                                baseLayer.Add(instance);
4199
                                instance.ApplyTemplate();
4200
                                instance.SetRectPath();
4201
                            }
4202
                            break;
4203
                        #endregion
4204
                        #region Triangle
4205
                        case "TriControl":
4206
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
4207
                            {
4208
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4209
                                TriControl instance = new TriControl
4210
                                {
4211
                                    LineSize = Convert.ToDouble(data2.First()),
4212
                                    MidPoint = s.MidPoint,
4213
                                    StartPoint = s.StartPoint,
4214
                                    Paint = s.Paint,
4215
                                    EndPoint = s.EndPoint,
4216
                                    Opacity = s.Opac,
4217
                                    Angle = s.Angle,
4218
                                    DashSize = s.DashSize,
4219
                                    PointSet = s.PointSet,
4220
                                    StrokeColor = _SetColor,
4221
                                    UserID = s.UserID,
4222
                                };
4223
                                instance.Memo = s.Memo;
4224
                                //Layer.Children.Add(instance);
4225
                                instance.CommentID = commentId;
4226
                                instance.MarkupInfoID = markupInfoID;
4227
                                baseLayer.Add(instance);
4228
                                instance.ApplyTemplate();
4229
                                instance.SetTri();
4230
                            }
4231
                            break;
4232
                        #endregion
4233
                        #region Cicle
4234
                        case "CircleControl":
4235
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
4236
                            {
4237
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4238
                                CircleControl instance = new CircleControl
4239
                                {
4240
                                    LineSize = Convert.ToDouble(data2.First()),
4241
                                    Paint = s.PaintState,
4242
                                    StartPoint = s.StartPoint,
4243
                                    EndPoint = s.EndPoint,
4244
                                    LeftBottomPoint = s.LBP,
4245
                                    TopRightPoint = s.TRP,
4246
                                    Opacity = s.Opac,
4247
                                    Angle = s.Angle,
4248
                                    DashSize = s.DashSize,
4249
                                    PointSet = s.PointSet,
4250
                                    StrokeColor = _SetColor,
4251
                                    UserID = s.UserID,
4252
                                };
4253
                                instance.Memo = s.Memo;
4254
                                //Layer.Children.Add(instance);
4255
                                instance.CommentID = commentId;
4256
                                instance.MarkupInfoID = markupInfoID;
4257
                                baseLayer.Add(instance);
4258
                                instance.ApplyTemplate();
4259
                                instance.SetCircle();
4260
                            }
4261
                            break;
4262
                        #endregion
4263
                        #region Poly
4264
                        case "PolygonControl":
4265
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4266
                            {
4267
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4268
                                PolygonControl instance = new PolygonControl
4269
                                {
4270
                                    LineSize = Convert.ToDouble(data2.First()),
4271
                                    //Toler = s.Toler,
4272
                                    IsCompleted = s.IsCompleted,
4273
                                    //PointSet = new List<Point>(),
4274
                                    Opacity = s.Opac,
4275
                                    StrokeColor = _SetColor,
4276
                                    StartPoint = s.StartPoint,
4277
                                    PointSet = s.PointSet,
4278
                                    EndPoint = s.EndPoint,
4279
                                    UserID = s.UserID,
4280
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4281
                                    ControlType = s.Type,
4282
                                    DashSize = s.DashSize,
4283
                                    Paint = s.PaintState,
4284
                                    //PointC = s.PointC,
4285
                                };
4286
                                //Layer.Children.Add(instance);
4287
                                instance.MarkupInfoID = markupInfoID;
4288
                                baseLayer.Add(instance);
4289
                                instance.CommentID = commentId;
4290
                                instance.Memo = s.Memo;
4291
                                instance.ApplyTemplate();
4292
                                instance.SetPolyPath();
4293
4294
                                //instance.PointSet = s.PointSet;
4295
                                //instance.ClosePath();
4296
                                //instance.ChangePaint(s.PaintState);
4297
                            }
4298
                            break;
4299
                        #endregion
4300
                        #region InkControl
4301
                        case "InkControl":
4302
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4303
                            {
4304
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4305
                                InkControl instance = new InkControl
4306
                                {
4307
                                    LineSize = Convert.ToDouble(data2.First()),
4308
                                    //Toler = s.Toler,
4309
                                    IsCompleted = s.IsCompleted,
4310
                                    //PointSet = new List<Point>(),
4311
                                    Opacity = s.Opac,
4312
                                    StrokeColor = _SetColor,
4313
                                    StartPoint = s.StartPoint,
4314
                                    PointSet = s.PointSet,
4315
                                    UserID = s.UserID,
4316
                                    EndPoint = s.EndPoint,
4317
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4318
                                    ControlType = s.Type,
4319
                                    DashSize = s.DashSize,
4320
                                    Paint = s.PaintState,
4321
                                    //PointC = s.PointC,
4322
                                };
4323
                                //Layer.Children.Add(instance);
4324
                                instance.MarkupInfoID = markupInfoID;
4325
                                baseLayer.Add(instance);
4326
                                instance.CommentID = commentId;
4327
                                instance.Memo = s.Memo;
4328
                                instance.ApplyTemplate();
4329
                                instance.SetPolyPath();
4330
4331
                                //instance.PointSet = s.PointSet;
4332
                                //instance.ClosePath();
4333
                                //instance.ChangePaint(s.PaintState);
4334
                            }
4335
                            break;
4336
                        #endregion
4337
                        #region Cloud
4338
                        case "CloudControl":
4339
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
4340
                            {
4341
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4342
                                CloudControl instance = new CloudControl
4343
                                {
4344
                                    LineSize = Convert.ToDouble(data2.First()),
4345
                                    Toler = s.Toler,
4346
                                    PointSet = new List<Point>(),
4347
                                    ArcLength = s.ArcLength,
4348
                                    Paint = s.PaintState,
4349
                                    Opacity = s.Opac,
4350
                                    StrokeColor = _SetColor,
4351
                                    isTransOn = s.IsTrans,
4352
                                    isChain = s.IsChain,
4353
                                    DashSize = s.DashSize,
4354
                                    UserID = s.UserID,
4355
                                    StartPoint = s.StartPoint,
4356
                                    EndPoint = s.EndPoint,
4357
                                    //Fill = s.CloudFill,
4358
                                };
4359
                                instance.Memo = s.Memo;
4360
                                //Layer.Children.Add(instance);
4361
                                instance.MarkupInfoID = markupInfoID;
4362
                                baseLayer.Add(instance);                                
4363
                                instance.CommentID = commentId;                                
4364
                                instance.PointSet = s.PointSet;
4365
                                instance.ApplyTemplate();
4366
                                instance.ClosePath();
4367
                                instance.ChangePaint(s.PaintState);
4368
                            }
4369
                            break;
4370
                        #endregion
4371
                        #region Line
4372
                        case "LineControl":
4373
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
4374
                            {
4375
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4376
                                LineControl instance = new LineControl()
4377
                                {
4378
                                    LineStyleSet = s.LineStyleSet,
4379
                                    StartPoint = s.StartPoint,
4380
                                    DimSize = s.DimSize,
4381
                                    EndPoint = s.EndPoint,
4382
                                    DashSize = s.DashSize,
4383
                                    Interval = s.Interval,
4384
                                    PointSet = s.PointSet,
4385
                                    Opacity = s.Opac,
4386
                                    StrokeColor = _SetColor,
4387
                                    UserID = s.UserID,
4388
                                    LineSize = Convert.ToDouble(data2.First()),
4389
                                };
4390
                                instance.Memo = s.Memo;
4391
                                //Layer.Children.Add(instance);
4392
                                instance.CommentID = commentId;
4393
                                instance.MarkupInfoID = markupInfoID;
4394
                                baseLayer.Add(instance);
4395
                                instance.ApplyTemplate();
4396
                                instance.SetLinePath();
4397
                            }
4398
                            break;
4399
                        #endregion
4400
                        #region Text
4401
                        case "TextControl":
4402
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
4403
                            {
4404
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4405
                                TextControl instance = new TextControl()
4406
                                {
4407
                                    Text = s.Text,
4408
                                    StartPoint = s.StartPoint,
4409
                                    EndPoint = s.EndPoint,
4410
                                    CanvasX = s.StartPoint.X,
4411
                                    CanvasY = s.StartPoint.Y,
4412
                                    BoxWidth = s.BoxW,
4413
                                    BoxHeight = s.BoxH,
4414
                                    ControlType_No = s.paintMethod,
4415
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
4416
                                    TextSize = Convert.ToDouble(data2[1]),
4417
                                    FontColor = _SetColor,
4418
                                    //FontSize = 10,
4419
                                    UserID = s.UserID,
4420
                                    //isHighLight = s.isHighLight,
4421
                                    Angle = s.Angle,
4422
                                    PointSet = s.PointSet,
4423
                                    Opacity = s.Opac,
4424
                                    TextFamily = new FontFamily(s.fontConfig[0]),
4425
                                    //TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
4426
                                    //TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
4427
                                };
4428
4429
                                if (instance.Text != null)
4430
                                {
4431
                                    //Layer.Children.Add(instance);
4432
                                    instance.MarkupInfoID = markupInfoID;
4433
                                    baseLayer.Add(instance);
4434
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
4435
                                    instance.ApplyTemplate();
4436
                                    instance.Memo = s.Memo;
4437
                                    if (s.fontConfig.Count() == 4)
4438
                                    {
4439
                                        instance.UnderLine = TextDecorations.Underline;
4440
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
4441
                                    }
4442
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
4443
4444
                                    //instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
4445
4446
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
4447
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
4448
4449
                                    instance.CommentID = commentId;
4450
                                    instance.DrawingCloud();
4451
                                    instance.SetText();
4452
                                }
4453
                            }
4454
                            break;
4455
                        #endregion
4456
                        #region Arc
4457
                        case "ArcControl":
4458
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
4459
                            {
4460
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4461
                                ArcControl instance = new ArcControl()
4462
                                {
4463
                                    StartPoint = s.StartPoint,
4464
                                    EndPoint = s.EndPoint,
4465
                                    DashSize = s.DashSize,
4466
                                    PointSet = s.PointSet,
4467
                                    isTransOn = s.IsTransOn,
4468
                                    MidPoint = s.MidPoint,
4469
                                    StrokeColor = _SetColor,
4470
                                    Clock = s.Clock,
4471
                                    Opacity = s.Opac,
4472
                                    LineSize = Convert.ToDouble(data2.First()),
4473
                                    UserID = s.UserID,
4474
                                };
4475
                                instance.Memo = s.Memo;
4476
                                //Layer.Children.Add(instance);
4477
                                instance.MarkupInfoID = markupInfoID;
4478
                                baseLayer.Add(instance);
4479
                                instance.CommentID = commentId;
4480
                                instance.ApplyTemplate();
4481
                                instance.SetArcPath();
4482
                            }
4483
                            break;
4484
                        #endregion
4485
                        #region RectCloud
4486
                        case "RectCloudControl":
4487
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
4488
                            {
4489
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4490
                                RectCloudControl instance = new RectCloudControl()
4491
                                {
4492
                                    StartPoint = s.StartPoint,
4493
                                    EndPoint = s.EndPoint,
4494
                                    LeftBottomPoint = s.LB,
4495
                                    Paint = s.PaintState,
4496
                                    Opacity = s.Opac,
4497
                                    DashSize = s.DashSize,
4498
                                    TopRightPoint = s.TR,
4499
                                    PointSet = s.PointSet,
4500
                                    StrokeColor = _SetColor,
4501
                                    LineSize = Convert.ToDouble(data2.First()),
4502
                                    UserID = s.UserID
4503
                                };
4504
                                instance.Memo = s.Memo;
4505
                                //Layer.Children.Add(instance);
4506
                                instance.MarkupInfoID = markupInfoID;
4507
                                baseLayer.Add(instance);
4508
                                instance.CommentID = commentId;
4509
                                instance.ApplyTemplate();
4510
                                instance.SetRectCloud();
4511
                            }
4512
                            break;
4513
                        #endregion
4514
                        #region Sign
4515
                        case "SignControl":
4516
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
4517
                            {
4518
                                SignControl instance = new SignControl
4519
                                {
4520
                                    Angle = s.Angle,
4521
                                    StartPoint = s.StartPoint,
4522
                                    TopRightPoint = s.TR,
4523
                                    EndPoint = s.EndPoint,
4524
                                    LeftBottomPoint = s.LB,
4525
                                    PointSet = s.PointSet,
4526
                                    Opacity = s.Opac,
4527
                                    SignImage = null,
4528
                                    UserID = s.UserID,
4529
                                };
4530
                                instance.ApplyTemplate();
4531
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4532
4533
                                if (s.UserNumber != null)
4534
                                {
4535
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
4536
                                    if (_sign != null)
4537
                                    {
4538
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
4539
4540
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
4541
                                        stream.Write(imageBytes, 0, imageBytes.Length);
4542
                                        stream.Position = 0;
4543
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
4544
                                        BitmapImage returnImage = new BitmapImage();
4545
                                        returnImage.BeginInit();
4546
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
4547
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
4548
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
4549
                                        returnImage.StreamSource = ms;
4550
                                        returnImage.EndInit();
4551
                                        stream.Close();
4552
                                        instance.SignImage = returnImage;
4553
                                    }
4554
                                }
4555
4556
                                instance.MarkupInfoID = markupInfoID;
4557
                                instance.CommentID = commentId;
4558
                                baseLayer.Add(instance);
4559
                                instance.ApplyTemplate();
4560
                                instance.SetImage();
4561
                            }
4562
                            break;
4563
                        #endregion
4564
                        #region Ink
4565
                        case "InkPresenter":
4566
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
4567
                            {
4568
#if SILVERLIGHT
4569
                                this._InkBoard.Strokes = s.SCC; 
4570
#endif
4571
                            }
4572
                            break;
4573
                        #endregion
4574
                        #region Date
4575
                        case "DateControl":
4576
                            {
4577
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
4578
                                {
4579
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4580
                                    DateControl instance = new DateControl
4581
                                    {
4582
                                        Angle = s.Angle,
4583
                                        StartPoint = s.StartPoint,
4584
                                        EndPoint = s.EndPoint,
4585
                                        LeftBottomPoint = s.LB,
4586
                                        TopRightPoint = s.TR,
4587
                                        Opacity = s.Opac,
4588
                                        FontColor = _SetColor,
4589
                                        LineSize = Convert.ToDouble(data2.First()),
4590
                                        Text = s.Text,
4591
                                        PointSet = s.PointSet,
4592
                                        UserID = s.UserID
4593
                                    };
4594
                                    instance.Memo = s.Memo;
4595
                                    //Layer.Children.Add(instance);
4596
                                    baseLayer.Add(instance);
4597
                                    instance.CommentID = commentId;
4598
                                    instance.ApplyTemplate();
4599
                                    instance.SetDate();
4600
                                }
4601
                            }
4602
                            break;
4603
                        #endregion
4604
                        #region Symbol
4605
                        case "SymControl":
4606
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
4607
                            {
4608
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4609
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
4610
                                SymControl instance = new SymControl()
4611
                                {
4612
                                    LineSize = Convert.ToDouble(data2.First()),
4613
                                    PointSet = s.PointSet,
4614
                                    Paint = s.PaintState,
4615
                                    StartPoint = s.StartPoint,
4616
                                    StrokeColor = _SetColor,
4617
                                    EndPoint = s.EndPoint,
4618
                                    Angle = s.Angle,
4619
                                    LeftBottomPoint = s.LB,
4620
                                    TopRightPoint = s.TR,
4621
                                    PathData = sm.Convert(s.PathInfo.ToString()),
4622
                                    Opacity = s.Opac,
4623
                                };
4624
4625
                                instance.Memo = s.Memo;
4626
                                baseLayer.Add(instance);
4627
                                instance.CommentID = commentId;
4628
                                instance.ApplyTemplate();
4629
                                instance.SetSymPath();
4630
                            }
4631
                            break;
4632
                        #endregion
4633
                        #region Image
4634
                        case "ImgControl":
4635
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
4636
                            {
4637
                                Image img = new Image();
4638
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
4639
4640
                                ImgControl instance = new ImgControl
4641
                                {
4642
                                    Angle = s.Angle,
4643
                                    StartPoint = s.StartPoint,
4644
                                    TopRightPoint = s.TR,
4645
                                    EndPoint = s.EndPoint,
4646
                                    LeftBottomPoint = s.LB,
4647
                                    PointSet = s.PointSet,
4648
                                    Opacity = s.Opac,
4649
                                    FilePath = s.ImagePath,
4650
                                    UserID = s.UserID,
4651
                                    ImageData = img.Source
4652
                                };
4653
                                //Layer.Children.Add(instance);
4654
                                instance.Memo = s.Memo;
4655
                                baseLayer.Add(instance);
4656
                                instance.CommentID = commentId;
4657
                                instance.ApplyTemplate();
4658
                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4659
                                instance.SetImage();
4660
4661
                            }
4662
                            break;
4663
                        #endregion
4664
                        #region SymbolN
4665
                        case "SymControlN":
4666
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
4667
                            {
4668
                                SymControlN instance = new SymControlN()
4669
                                {
4670
                                    PointSet = s.PointSet,
4671
                                    StartPoint = s.StartPoint,
4672
                                    EndPoint = s.EndPoint,
4673
                                    Angle = s.Angle,
4674
                                    LeftBottomPoint = s.LB,
4675
                                    TopRightPoint = s.TR,
4676
                                    Opacity = s.Opac,
4677
                                    PathXathData = s.DBData,
4678
                                };
4679
                                instance.Memo = s.Memo;
4680
                                baseLayer.Add(instance);
4681
                                instance.CommentID = commentId;
4682
                                instance.ApplyTemplate();
4683
4684
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
4685
                                //instance.PathXathData = s.DBData;
4686
4687
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
4688
                                xamlData = xamlData.Replace("daelim", "DAELIM");
4689
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
4690
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
4691
                                writer.Write(xamlData);
4692
                                writer.Flush();
4693
                                stream.Position = 0;
4694
4695
                                object obj = XamlReader.Load(stream);
4696
                                instance.Base_ViewBox.Child = obj as UIElement;
4697
                                instance.PathXathData = appovalData;
4698
                                instance.SetViewBox();
4699
                            }
4700
                            break;
4701
                        #endregion
4702
                        default:
4703
4704
                            break;
4705
                    };
4706
                }
4707
            }
4708
        }
4709
4710
		//강인구 추가(12/12)
4711
        public Control markupParse_Paste(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer)
4712
        {
4713
            //GetUserSign getUser = new GetUserSign();
4714
            Control return_control = new Control();
4715
            if (MarkupString != "False")
4716
            {
4717
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(""));
4718
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
4719
                string[] delimiterChars = { "|DZ|" };
4720
                string[] delimiterChars2 = { "|" };
4721
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
4722
                List<string> dataSet = new List<string>();
4723
4724
                foreach (var dataPease in data)
4725
                {
4726
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
4727
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
4728
                    switch (unkownControl.Name)
4729
                    {
4730
                        #region Shape
4731
                        #region Rectangle
4732
                        case "RectangleControl":
4733
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
4734
                            {
4735
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4736
                                RectangleControl instance = new RectangleControl
4737
                                {
4738
                                    LineSize = Convert.ToDouble(data2.First()),
4739
                                    Paint = s.PaintState,
4740
                                    StartPoint = s.StartPoint,
4741
                                    EndPoint = s.EndPoint,
4742
                                    Angle = s.Angle,
4743
                                    StrokeColor = _SetColor,
4744
                                    DashSize = s.DashSize,
4745
                                    Opacity = s.Opac,
4746
                                    LeftBottomPoint = s.LB,
4747
                                    TopRightPoint = s.TR,
4748
                                    PointSet = s.PointSet,
4749
                                    UserID = s.UserID
4750
                                };
4751
                                baseLayer.Add(instance);
4752
                                instance.ApplyTemplate();
4753
4754
                                return_control = instance;
4755
                            }
4756
                            break;
4757
                        #endregion
4758
                        #region Triangle
4759
                        case "TriControl":
4760
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
4761
                            {
4762
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4763
                                TriControl instance = new TriControl
4764
                                {
4765
                                    LineSize = Convert.ToDouble(data2.First()),
4766
                                    MidPoint = s.MidPoint,
4767
                                    StartPoint = s.StartPoint,
4768
                                    Paint = s.Paint,
4769
                                    EndPoint = s.EndPoint,
4770
                                    Opacity = s.Opac,
4771
                                    Angle = s.Angle,
4772
                                    DashSize = s.DashSize,
4773
                                    PointSet = s.PointSet,
4774
                                    StrokeColor = _SetColor,
4775
4776
                                    UserID = s.UserID,
4777
                                };
4778
                                baseLayer.Add(instance);
4779
                                instance.ApplyTemplate();
4780
                                return_control = instance;
4781
                            }
4782
                            break;
4783
                        #endregion
4784
                        #region Cicle
4785
                        case "CircleControl":
4786
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
4787
                            {
4788
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4789
                                CircleControl instance = new CircleControl
4790
                                {
4791
                                    LineSize = Convert.ToDouble(data2.First()),
4792
                                    Paint = s.PaintState,
4793
                                    StartPoint = s.StartPoint,
4794
                                    EndPoint = s.EndPoint,
4795
                                    LeftBottomPoint = s.LBP,
4796
                                    TopRightPoint = s.TRP,
4797
                                    Opacity = s.Opac,
4798
                                    Angle = s.Angle,
4799
                                    DashSize = s.DashSize,
4800
                                    PointSet = s.PointSet,
4801
                                    StrokeColor = _SetColor,
4802
                                    UserID = s.UserID,
4803
                                };
4804
                                baseLayer.Add(instance);
4805
                                instance.ApplyTemplate();
4806
                                return_control = instance;
4807
                            }
4808
                            break;
4809
                        #endregion
4810
                        #region RectCloud
4811
                        case "RectCloudControl":
4812
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
4813
                            {
4814
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4815
                                RectCloudControl instance = new RectCloudControl()
4816
                                {
4817
                                    StartPoint = s.StartPoint,
4818
                                    EndPoint = s.EndPoint,
4819
                                    LeftBottomPoint = s.LB,
4820
                                    Paint = s.PaintState,
4821
                                    Opacity = s.Opac,
4822
                                    DashSize = s.DashSize,
4823
                                    TopRightPoint = s.TR,
4824
                                    PointSet = s.PointSet,
4825
                                    StrokeColor = _SetColor,
4826
4827
                                    LineSize = Convert.ToDouble(data2.First()),
4828
                                    UserID = s.UserID
4829
                                };
4830
                                baseLayer.Add(instance);
4831
                                instance.ApplyTemplate();
4832
                                return_control = instance;
4833
                            }
4834
                            break;
4835
                        #endregion
4836
                        #endregion
4837
4838
                        #region Polygon
4839
                        #region Poly
4840
                        case "PolygonControl":
4841
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4842
                            {
4843
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4844
                                PolygonControl instance = new PolygonControl
4845
                                {
4846
                                    LineSize = Convert.ToDouble(data2.First()),
4847
                                    //Toler = s.Toler,
4848
                                    IsCompleted = s.IsCompleted,
4849
                                    //PointSet = new List<Point>(),
4850
                                    Opacity = s.Opac,
4851
                                    StrokeColor = _SetColor,
4852
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4853
                                    ControlType = s.Type,
4854
                                    DashSize = s.DashSize,
4855
                                    StartPoint = s.StartPoint,
4856
                                    EndPoint = s.EndPoint,
4857
                                    PointSet = s.PointSet,
4858
                                    UserID = s.UserID,
4859
                                    Paint = s.PaintState,
4860
                                    //PointC = s.PointC,
4861
                                };
4862
                                baseLayer.Add(instance);
4863
                                instance.ApplyTemplate();
4864
                                return_control = instance;
4865
                            }
4866
                            break;
4867
                        #endregion
4868
                        #region InkControl
4869
                        case "InkControl":
4870
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4871
                            {
4872
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4873
                                InkControl instance = new InkControl
4874
                                {
4875
                                    LineSize = Convert.ToDouble(data2.First()),
4876
                                    //Toler = s.Toler,
4877
                                    IsCompleted = s.IsCompleted,
4878
                                    //PointSet = new List<Point>(),
4879
                                    Opacity = s.Opac,
4880
                                    StrokeColor = _SetColor,
4881
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4882
                                    ControlType = s.Type,
4883
                                    DashSize = s.DashSize,
4884
                                    StartPoint = s.StartPoint,
4885
                                    PointSet = s.PointSet,
4886
                                    UserID = s.UserID,
4887
                                    Paint = s.PaintState,
4888
                                    EndPoint = s.EndPoint,
4889
                                    //PointC = s.PointC,
4890
                                };
4891
                                baseLayer.Add(instance);
4892
                                instance.ApplyTemplate();
4893
                                return_control = instance;
4894
                            }
4895
                            break;
4896
                        #endregion
4897
                        #region Cloud
4898
                        case "CloudControl":
4899
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
4900
                            {
4901
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4902
                                CloudControl instance = new CloudControl
4903
                                {
4904
                                    LineSize = Convert.ToDouble(data2.First()),
4905
                                    Toler = s.Toler,
4906
                                    PointSet = s.PointSet,
4907
                                    ArcLength = s.ArcLength,
4908
                                    Paint = s.PaintState,
4909
                                    Opacity = s.Opac,
4910
                                    StrokeColor = _SetColor,
4911
4912
                                    isTransOn = s.IsTrans,
4913
                                    isChain = s.IsChain,
4914
                                    DashSize = s.DashSize,
4915
                                    UserID = s.UserID,
4916
4917
                                    StartPoint = s.StartPoint,
4918
                                    EndPoint = s.EndPoint,
4919
4920
                                    //Fill = s.CloudFill,
4921
                                };
4922
                                //instance.PointSet = s.PointSet;
4923
                                //instance.ClosePath();
4924
                                //instance.ChangePaint(s.PaintState);
4925
                                baseLayer.Add(instance);
4926
                                instance.ApplyTemplate();
4927
                                instance.SetCloud();
4928
                                //instance.ClosePath();
4929
                                //instance.ChangePaint(s.PaintState);
4930
                                return_control = instance;
4931
                            }
4932
                            break;
4933
                        #endregion
4934
                        #endregion
4935
4936
                        #region Line
4937
                        #region Line
4938
                        case "LineControl":
4939
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
4940
                            {
4941
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4942
                                LineControl instance = new LineControl()
4943
                                {
4944
                                    LineStyleSet = s.LineStyleSet,
4945
                                    StartPoint = s.StartPoint,
4946
                                    DimSize = s.DimSize,
4947
                                    EndPoint = s.EndPoint,
4948
                                    DashSize = s.DashSize,
4949
                                    Interval = s.Interval,
4950
                                    PointSet = s.PointSet,
4951
                                    Opacity = s.Opac,
4952
                                    StrokeColor = _SetColor,
4953
                                    UserID = s.UserID,
4954
                                    LineSize = Convert.ToDouble(data2.First()),
4955
                                };
4956
4957
                                baseLayer.Add(instance);
4958
                                instance.ApplyTemplate();
4959
                                instance.SetLinePath();
4960
                                return_control = instance;
4961
                            }
4962
                            break;
4963
                        #endregion
4964
                        #region Arrow_Multi
4965
                        case "ArrowControl_Multi":
4966
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
4967
                            {
4968
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4969
                                ArrowControl_Multi instance = new ArrowControl_Multi
4970
                                {
4971
                                    LineSize = Convert.ToDouble(data2.First()),
4972
                                    StartPoint = s.StartPoint,
4973
                                    MiddlePoint = s.MidPoint,
4974
                                    DashSize = s.DashSize,
4975
                                    EndPoint = s.EndPoint,
4976
                                    PointSet = s.PointSet,
4977
                                    Opacity = s.Opac,
4978
                                    StrokeColor = _SetColor,
4979
4980
                                    UserID = s.UserID
4981
                                };
4982
                                baseLayer.Add(instance);
4983
                                instance.ApplyTemplate();
4984
                                instance.SetArrowMultiPath();
4985
                                return_control = instance;
4986
                            }
4987
                            break;
4988
                        #endregion
4989
                        #region Arc
4990
                        case "ArcControl":
4991
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
4992
                            {
4993
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4994
                                ArcControl instance = new ArcControl()
4995
                                {
4996
                                    StartPoint = s.StartPoint,
4997
                                    EndPoint = s.EndPoint,
4998
                                    DashSize = s.DashSize,
4999
                                    PointSet = s.PointSet,
5000
                                    isTransOn = s.IsTransOn,
5001
                                    MidPoint = s.MidPoint,
5002
                                    StrokeColor = _SetColor,
5003
                                    Opacity = s.Opac,
5004
5005
                                    Clock = s.Clock,
5006
                                    LineSize = Convert.ToDouble(data2.First()),
5007
                                    UserID = s.UserID,
5008
                                };
5009
                                baseLayer.Add(instance);
5010
                                instance.ApplyTemplate();
5011
                                instance.OnApplyTemplate();
5012
                                instance.SetArcPath();
5013
                                return_control = instance;
5014
                            }
5015
                            break;
5016
                        #endregion
5017
                        #endregion
5018
5019
                        #region Text
5020
                        case "TextControl":
5021
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
5022
                            {
5023
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5024
                                TextControl instance = new TextControl()
5025
                                {
5026
                                    Text = s.Text,
5027
                                    StartPoint = s.StartPoint,
5028
                                    EndPoint = s.EndPoint,
5029
                                    CanvasX = s.StartPoint.X,
5030
                                    CanvasY = s.StartPoint.Y,
5031
                                    BoxWidth = s.BoxW,
5032
                                    BoxHeight = s.BoxH,
5033
                                    ControlType_No = s.paintMethod,
5034
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
5035
                                    TextSize = Convert.ToDouble(data2[1]),
5036
                                    FontColor = _SetColor,
5037
                                    FontSize = 10,
5038
                                    UserID = s.UserID,
5039
                                    //isHighLight = s.isHighLight,
5040
                                    Angle = s.Angle,
5041
                                    PointSet = s.PointSet,
5042
                                    Opacity = s.Opac,
5043
                                    TextFamily = new FontFamily(s.fontConfig[0]),
5044
                                    //TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
5045
                                    //TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
5046
                                };
5047
5048
                                if (instance.Text != null)
5049
                                {
5050
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
5051
                                    instance.ApplyTemplate();
5052
                                    if (s.fontConfig.Count() == 4)
5053
                                    {
5054
                                        instance.UnderLine = TextDecorations.Underline;
5055
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
5056
                                    }
5057
                                }
5058
                                baseLayer.Add(instance);
5059
                                instance.ApplyTemplate();
5060
5061
                                instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
5062
5063
                                instance.Base_TextBox.Visibility = Visibility.Collapsed;
5064
                                instance.Base_TextBlock.Visibility = Visibility.Visible;
5065
                        
5066
                                return_control = instance;
5067
                            }
5068
                            break;
5069
                        #endregion
5070
5071
                        #region ArrowText
5072
                        case "ArrowTextControl":
5073
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
5074
                            {
5075
                                //string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5076
                                ArrowTextControl instance = new ArrowTextControl();
5077
                                //instance.LineSize = Convert.ToDouble(data2.First());
5078
                                instance.PointSet = s.PointSet;
5079
                                instance.StartPoint = s.StartPoint;
5080
                                instance.EndPoint = s.EndPoint;
5081
                                instance.StrokeColor = _SetColor;
5082
                                //instance.DashSize = s.DashSize;
5083
                                instance.ArrowTextStyle = s.ArrowStyle;
5084
                                instance.isHighLight = s.isHighLight;
5085
                                instance.ArrowText = s.ArrowText;
5086
                                instance.Opacity = s.Opac;
5087
                                instance.BorderSize = s.BorderSize;
5088
                                instance.BoxWidth = s.BoxWidth;
5089
                                instance.BoxHeight = s.BoxHeight;
5090
                                instance.isFixed = s.isFixed;
5091
                                instance.Angle = s.Angle;
5092
                                instance.UserID = s.UserID;
5093
                                instance.isTrans = s.isTrans;
5094
                                instance.MidPoint = s.MidPoint;
5095
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
5096
                                {
5097
                                    s.fontConfig = new List<string>();
5098
5099
                                    s.fontConfig.Add("Arial");
5100
                                    s.fontConfig.Add("Normal");
5101
                                    s.fontConfig.Add("Normal");
5102
                                    s.fontConfig.Add("30");
5103
                                }
5104
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
5105
                                //instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
5106
                                //instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
5107
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
5108
                                baseLayer.Add(instance);
5109
                                instance.ApplyTemplate();
5110
                                instance.SetArrowTextPath();
5111
                                return_control = instance;
5112
                            };
5113
                            break;
5114
                        #endregion
5115
5116
                        #region ETC
5117
                        #region Ink
5118
                        case "InkPresenter":
5119
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
5120
                            {
5121
5122
                            }
5123
                            break;
5124
                        #endregion
5125
                        #region Date
5126
                        case "DateControl":
5127
                            {
5128
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
5129
                                {
5130
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5131
                                    DateControl instance = new DateControl
5132
                                    {
5133
                                        Angle = s.Angle,
5134
                                        StartPoint = s.StartPoint,
5135
                                        EndPoint = s.EndPoint,
5136
                                        LeftBottomPoint = s.LB,
5137
                                        TopRightPoint = s.TR,
5138
                                        Opacity = s.Opac,
5139
                                        FontColor = _SetColor,
5140
                                        LineSize = Convert.ToDouble(data2.First()),
5141
                                        Text = s.Text,
5142
                                        PointSet = s.PointSet,
5143
                                        UserID = s.UserID
5144
                                    };
5145
                                    baseLayer.Add(instance);
5146
                                    instance.ApplyTemplate();
5147
                                    return_control = instance;
5148
                                }
5149
                            }
5150
                            break;
5151
                        #endregion
5152
                        #region Image
5153
                        case "ImgControl":
5154
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
5155
                            {
5156
                                Image img = new Image();
5157
                                img.Source = new BitmapImage(new Uri(s.ImagePath));
5158
5159
                                ImgControl instance = new ImgControl
5160
                                {
5161
                                    Angle = s.Angle,
5162
                                    StartPoint = s.StartPoint,
5163
                                    TopRightPoint = s.TR,
5164
                                    EndPoint = s.EndPoint,
5165
                                    LeftBottomPoint = s.LB,
5166
                                    PointSet = s.PointSet,
5167
                                    Opacity = s.Opac,
5168
                                    FilePath = s.ImagePath,
5169
                                    UserID = s.UserID,
5170
                                    ImageData = img.Source
5171
                                };
5172
5173
                                instance.ApplyTemplate();
5174
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5175
                                baseLayer.Add(instance);
5176
                                instance.ApplyTemplate();
5177
                                instance.SetImage();
5178
                                return_control = instance;
5179
                            }
5180
                            break;
5181
                        #endregion
5182
                        #region Sign
5183
                        case "SignControl":
5184
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
5185
                            {
5186
                                SignControl instance = new SignControl
5187
                                {
5188
                                    Angle = s.Angle,
5189
                                    StartPoint = s.StartPoint,
5190
                                    TopRightPoint = s.TR,
5191
                                    EndPoint = s.EndPoint,
5192
                                    LeftBottomPoint = s.LB,
5193
                                    PointSet = s.PointSet,
5194
                                    Opacity = s.Opac,
5195
                                    SignImage = null,
5196
                                    UserID = s.UserID,
5197
                                };
5198
                                instance.ApplyTemplate();
5199
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5200
5201
                                if (s.UserNumber != null)
5202
                                {
5203
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
5204
                                    if (_sign != null)
5205
                                    {
5206
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
5207
5208
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
5209
                                        stream.Write(imageBytes, 0, imageBytes.Length);
5210
                                        stream.Position = 0;
5211
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
5212
                                        BitmapImage returnImage = new BitmapImage();
5213
                                        returnImage.BeginInit();
5214
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
5215
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
5216
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
5217
                                        returnImage.StreamSource = ms;
5218
                                        returnImage.EndInit();
5219
                                        stream.Close();
5220
                                        instance.SignImage = returnImage;
5221
                                    }
5222
                                }
5223
5224
                                baseLayer.Add(instance);
5225
                                instance.ApplyTemplate();
5226
                                instance.SetImage();
5227
                                return_control = instance;
5228
                            }
5229
                            break;
5230
                        #endregion
5231
                        #region Symbol
5232
                        case "SymControl":
5233
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
5234
                            {
5235
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5236
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
5237
                                SymControl instance = new SymControl
5238
                                {
5239
                                    //Angle = s.Angle,
5240
                                    //StartPoint = s.StartPoint,
5241
                                    //TopRightPoint = s.TR,
5242
                                    //EndPoint = s.EndPoint,
5243
                                    //LeftBottomPoint = s.LB,
5244
                                    //PointSet = s.PointSet,
5245
                                    //Opacity = s.Opac,
5246
                                    //FilePath = s.ImagePath,
5247
                                    //UserID = s.UserID,
5248
                                    //ImageData = s.ImageData
5249
                                    LineSize = Convert.ToDouble(data2.First()),
5250
                                    PointSet = s.PointSet,
5251
                                    Paint = s.PaintState,
5252
                                    StartPoint = s.StartPoint,
5253
                                    StrokeColor = _SetColor,
5254
                                    EndPoint = s.EndPoint,
5255
                                    Angle = s.Angle,
5256
                                    UserID = s.UserID,
5257
                                    LeftBottomPoint = s.LB,
5258
                                    TopRightPoint = s.TR,
5259
                                    PathData = sm.Convert(s.PathInfo.ToString()),
5260
                                    Opacity = s.Opac,
5261
                                };
5262
5263
                                baseLayer.Add(instance);
5264
                                //instance.OnApplyTemplate();
5265
                                instance.ApplyTemplate();
5266
                                instance.SetSymPath();
5267
                                return_control = instance;
5268
                            }
5269
                            break;
5270
                        #endregion
5271
                        
5272
                        #region SymbolN
5273
                        case "SymControlN":
5274
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
5275
                            {
5276
                                SymControlN instance = new SymControlN()
5277
                                {
5278
                                    PointSet = s.PointSet,
5279
                                    StartPoint = s.StartPoint,
5280
                                    EndPoint = s.EndPoint,
5281
                                    Angle = s.Angle,
5282
                                    LeftBottomPoint = s.LB,
5283
                                    TopRightPoint = s.TR,
5284
                                    Opacity = s.Opac,
5285
                                    PathXathData = s.DBData,
5286
                                };
5287
                                instance.Memo = s.Memo;
5288
                                baseLayer.Add(instance);
5289
                                instance.ApplyTemplate();
5290
5291
                                return_control = instance;
5292
5293
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
5294
                                //instance.PathXathData = s.DBData;
5295
5296
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
5297
                                //xamlData = xamlData.Replace("daelim", "DAELIM");
5298
                                //System.IO.MemoryStream stream = new System.IO.MemoryStream();
5299
                                //System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
5300
                                //writer.Write(xamlData);
5301
                                //writer.Flush();
5302
                                //stream.Position = 0;
5303
5304
                                //object obj = XamlReader.Load(stream);
5305
                                //instance.Base_ViewBox.Child = obj as UIElement;
5306
                                //instance.PathXathData = appovalData;
5307
                                //instance.SetViewBox();
5308
                            }
5309
                            break;
5310
                        #endregion
5311
                        #endregion 
5312
                        default:
5313
                            break;
5314
                    };
5315
                }
5316
            }
5317
            return return_control;
5318
        }
5319
5320
        public S_BaseControl markupParse_GetBaseControl(string MarkupString)
5321
        {
5322
            var item = JsonSerializerHelper.UnCompressString(MarkupString); //언패킹작업
5323
            var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
5324
            return unknownData;
5325
        }
5326
    }
5327
}
클립보드 이미지 추가 (최대 크기: 500 MB)