프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Controls / Parsing / MarkupParse.cs @ 53880c83

이력 | 보기 | 이력해설 | 다운로드 (374 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 53880c83 ljiyeon
using Svg2Xaml;
30 787a4489 KangIngu
31
namespace MarkupToPDF.Controls.Parsing
32
{
33
    public partial class LayerControl : Control
34
    {
35
        public GetUserSign getUser = new GetUserSign();
36 b200de5a KangIngu
        //public string appovalData = "eJyycS/KTFHwS8xNtVVKBAMlhYrcnLxiW6WMkpICK3394uSM1NzEYr3czOSi/OL8tBK95Pxc/fLMvLQKfSMDAzP9isTcHP2CotTi1LySxJLM/DwlOxuQqXpOicnZ6UX5pXkpdjbB+TmZKc75OflFTkWlxRkKYKatkrIbFCgp+BckJmeWVNoqGegZKino29noYxgSlJpckpiXnpOqEFxSlFqSnGGr5JaZk6ME4uZnp0KNMwACmFBIRmZydl5qMdA7pjAxn8y8VK/8zDxbpSCQsUpQ38MNV1IIz0wpAZptZADU45GamZ5RYqtkYamk4JyYVwYMCZ/UNKCArpGeKVwoJL8AJqIP8T00DILyy11S0zLzMkEBUwz0AjIfbrgWWBt2OWM9U3zSBviljfBJaiGFM7pDQ1IrSpxy8pOzFUAsWyXHgIAg/zBXFyUFt/y8knCoCa4VJUWJTvk5KRDh4MwqYEgaG4B4RamQaEOJFY/8oswqoMLEHMeczPS8XGCSsVVyBpKpRUoKYalFJZnJWKVgTrRVgqQNdNc5VSqkJKbmZOYS4TwjWjrPGBGkMAoAAAD//w==";
37 787a4489 KangIngu
        public string ProjectNo = "";
38
39
        #region 주석
40
        //        public void markupParseConSolidate(string MarkupString, Canvas Layer, List<DisplayColorInfo> dc, string ToolTipMessage, string userID)
41
        //        {
42
        //            if (MarkupString != "False")
43
        //            {
44
        //                //SolidColorBrush _SetColor = new SolidColorBrush(StringToColorConverter.Parse(DisplayColor));
45
        //                SolidColorBrush _SetColor = new SolidColorBrush(Colors.Blue);
46
        //                string[] delimiterChars = { "|DZ|" };
47
        //                string[] delimiterChars2 = { "|" };
48
        //                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
49
        //                List<string> dataSet = new List<string>();
50
51
        //                foreach (var dataPease in data)
52
        //                {
53
        //                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
54
        //                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
55
        //                    switch (unkownControl.Name)
56
        //                    {
57
        //                        #region Arrow
58
        //                        case "ArrowControl":
59
        //                            using (S_ArrowControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl>(item))
60
        //                            {
61
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
62
        //                                LineControl instance = new LineControl
63
        //                                {
64
        //                                    LineSize = Convert.ToDouble(data2.First()),
65
        //                                    LineStyle = s.ArStyle,
66
        //                                    StartPoint = s.StartPoint,
67
        //                                    EndPoint = s.EndPoint,
68
        //                                    DimSize = s.DimSize,
69
        //                                    DashSize = s.DashSize,
70
        //                                    PointSet = s.PointSet,
71
        //                                    UserID = s.UserID,
72
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
73
        //                                    Opacity = s.Opac,
74
        //                                };
75
76
        //                                ToolTipService.SetToolTip(instance, s.UserID);
77
        //                                Layer.Children.Add(instance);
78
        //                                instance.ApplyTemplate();
79
        //                                instance.SetLinePath();
80
        //                            }
81
        //                            break;
82
        //                        #endregion
83
        //                        #region ArrowText
84
        //                        case "ArrowTextControl":
85
        //                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
86
        //                            {
87
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
88
        //                                ArrowTextControl instance = new ArrowTextControl();
89
        //                                Layer.Children.Add(instance);
90
        //                                instance.LineSize = Convert.ToDouble(data2.First());
91
        //                                instance.PointSet = s.PointSet;
92
        //                                instance.StartPoint = s.StartPoint;
93
        //                                instance.EndPoint = s.EndPoint;
94
        //                                instance.isHighLight = s.isHighLight;
95
        //                                //instance.StrokeColor = GetUserColor(dc, s.UserID);
96
        //                                //instance.DashSize = s.DashSize;
97
        //                                instance.ArrowTextStyle = s.ArrowStyle;
98
        //                                instance.ArrowText = s.ArrowText;
99
        //                                instance.Opacity = s.Opac;
100
        //                                instance.isFixed = s.isFixed;
101
        //                                instance.UserID = s.UserID;
102
        //                                instance.BorderSize = s.BorderSize;
103
        //                                instance.BoxWidth = s.BoxWidth;
104
        //                                instance.BoxHeight = s.BoxHeight;
105
        //                                instance.isTrans = s.isTrans;
106
        //                                instance.Angle = s.Angle;
107
        //                                instance.MidPoint = s.MP;
108
109
        //                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
110
        //                                {
111
        //                                    s.fontConfig = new List<string>();
112
113
        //                                    s.fontConfig.Add("Arial");
114
        //                                    s.fontConfig.Add("Normal");
115
        //                                    s.fontConfig.Add("Normal");
116
        //                                    s.fontConfig.Add("30");
117
        //                                }
118
        //                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
119
        //                                //instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
120
        //                                //instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
121
        //                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
122
123
        //                                instance.ApplyTemplate();
124
        //                                instance.SetArrowTextPath();
125
        //                                ToolTipService.SetToolTip(instance, s.UserID);
126
        //                            };
127
        //                            break;
128
        //                        #endregion
129
        //                        #region Arrow_Multi
130
        //                        case "ArrowControl_Multi":
131
        //                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
132
        //                            {
133
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
134
        //                                ArrowControl_Multi instance = new ArrowControl_Multi
135
        //                                {
136
        //                                    LineSize = Convert.ToDouble(data2.First()),
137
        //                                    StartPoint = s.StartPoint,
138
        //                                    MiddlePoint = s.MP,
139
        //                                    DashSize = s.DashSize,
140
        //                                    EndPoint = s.EndPoint,
141
        //                                    PointSet = s.PointSet,
142
        //                                    Opacity = s.Opac,
143
        //                                    UserID = s.UserID,
144
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
145
        //                                };
146
        //                                ToolTipService.SetToolTip(instance, s.UserID);
147
        //                                Layer.Children.Add(instance);
148
        //                                instance.ApplyTemplate();
149
        //                                instance.SetArrowMultiPath();
150
        //                                //instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
151
152
        //                            }
153
        //                            break;
154
        //                        #endregion
155
        //                        #region Rectangle
156
        //                        case "RectagleControl":
157
        //                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
158
        //                            {
159
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
160
161
162
        //                                RectangleControl instance = new RectangleControl
163
        //                                {
164
        //                                    LineSize = Convert.ToDouble(data2.First()),
165
        //                                    //Paint = s.PaintState,
166
        //                                    StartPoint = s.StartPoint,
167
        //                                    EndPoint = s.EndPoint,
168
        //                                    //Angle = s.Angle,
169
170
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
171
        //                                    //DashSize = s.DashSize,
172
        //                                    //UserID = s.UserID,
173
        //                                    Opacity = s.Opac,
174
        //                                    LeftBottomPoint = s.LB,
175
        //                                    TopRightPoint = s.TR,
176
        //                                    PointSet = s.PointSet
177
        //                                };
178
        //                                ToolTipService.SetToolTip(instance, s.UserID);
179
180
        //                                Layer.Children.Add(instance);
181
        //                                instance.ApplyTemplate();
182
        //                                //instance.SetRectPath();
183
        //                                instance.SetRectPath(null);
184
        //                            }
185
        //                            break;
186
        //                        #endregion
187
        //                        #region Triangle
188
        //                        case "TriControl":
189
        //                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
190
        //                            {
191
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
192
        //                                TriControl instance = new TriControl
193
        //                                {
194
        //                                    LineSize = Convert.ToDouble(data2.First()),
195
        //                                    MidPoint = s.MP,
196
        //                                    StartPoint = s.StartPoint,
197
        //                                    Paint = s.Paint,
198
        //                                    EndPoint = s.EndPoint,
199
        //                                    Opacity = s.Opac,
200
        //                                    UserID = s.UserID,
201
        //                                    Angle = s.Angle,
202
        //                                    DashSize = s.DashSize,
203
        //                                    PointSet = s.PointSet,
204
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
205
        //                                };
206
        //                                ToolTipService.SetToolTip(instance, s.UserID);
207
        //                                Layer.Children.Add(instance);
208
        //                                instance.ApplyTemplate();
209
        //                                instance.SetTri();
210
        //                            }
211
        //                            break;
212
        //                        #endregion
213
        //                        #region Cicle
214
        //                        case "CicleControl":
215
        //                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
216
        //                            {
217
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
218
        //                                CircleControl instance = new CircleControl
219
        //                                {
220
        //                                    LineSize = Convert.ToDouble(data2.First()),
221
        //                                    Paint = s.PaintState,
222
        //                                    StartPoint = s.StartPoint,
223
        //                                    EndPoint = s.EndPoint,
224
        //                                    LeftBottomPoint = s.LBP,
225
        //                                    TopRightPoint = s.TRP,
226
        //                                    Opacity = s.Opac,
227
        //                                    Angle = s.Angle,
228
        //                                    DashSize = s.DashSize,
229
        //                                    PointSet = s.PointSet,
230
        //                                    UserID = s.UserID,
231
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
232
        //                                };
233
        //                                ToolTipService.SetToolTip(instance, s.UserID);
234
        //                                Layer.Children.Add(instance);
235
        //                                instance.ApplyTemplate();
236
        //                                instance.SetCircle();
237
        //                            }
238
        //                            break;
239
        //                        #endregion
240
        //                        #region Cloud
241
        //                        case "CloudControl":
242
        //                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
243
        //                            {
244
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
245
        //                                CloudControl instance = new CloudControl
246
        //                                {
247
        //                                    LineSize = Convert.ToDouble(data2.First()),
248
        //                                    Toler = s.Toler,
249
        //                                    PointSet = new List<Point>(),
250
        //                                    ArcLength = s.ArcLength,
251
        //                                    Paint = s.PaintState,
252
        //                                    Opacity = s.Opac,
253
        //                                    UserID = s.UserID,
254
        //                                    isChain = s.IsChain,
255
        //                                    DashSize = s.DashSize,
256
        //                                    isTransOn = s.IsTrans,
257
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
258
        //                                    //Fill = s.CloudFill,
259
        //                                };
260
        //                                ToolTipService.SetToolTip(instance, s.UserID);
261
        //                                Layer.Children.Add(instance);
262
        //                                instance.ApplyTemplate();
263
        //                                instance.PointSet = s.PointSet;
264
        //                                instance.ChangePaint(s.PaintState);
265
        //                            }
266
        //                            break;
267
        //                        #endregion
268
        //                        #region Line
269
        //                        case "LineControl":
270
        //                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
271
        //                            {
272
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
273
        //                                LineControl instance = new LineControl()
274
        //                                {
275
        //                                    LineStyle = s.LnSet,
276
        //                                    StartPoint = s.StartPoint,
277
        //                                    EndPoint = s.EndPoint,
278
        //                                    DashSize = s.DashSize,
279
        //                                    PointSet = s.PointSet,
280
        //                                    Opacity = s.Opac,
281
        //                                    UserID = s.UserID,
282
        //                                    Interval = s.Interval,
283
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
284
        //                                    LineSize = Convert.ToDouble(data2.First()),
285
        //                                };
286
        //                                ToolTipService.SetToolTip(instance, s.UserID);
287
        //                                Layer.Children.Add(instance);
288
        //                                instance.ApplyTemplate();
289
        //                                instance.SetLinePath();
290
        //                            }
291
        //                            break;
292
        //                        #endregion
293
        //                        #region Text
294
        //                        case "TextControl":
295
        //                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
296
        //                            {
297
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
298
        //                                TextControl instance = new TextControl()
299
        //                                {
300
        //                                    Text = s.Text,
301
        //                                    StartPoint = s.StartPoint,
302
        //                                    EndPoint = s.EndPoint,
303
        //                                    Paint = s.PaintState,
304
        //                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
305
        //                                    TextSize = Convert.ToDouble(data2[1]),
306
        //                                    //FontColor = GetUserColor(dc, s.UserID),
307
        //                                    FontSize = 10,
308
        //                                    //isHighLight = s.isHighLight,
309
        //                                    Angle = s.Angle,
310
        //                                    PointSet = s.PointSet,
311
        //                                    Opacity = s.Opac,
312
        //                                    UserID = s.UserID,
313
        //                                    TextFamily = new FontFamily(s.fontConfig[0]),
314
        //                                    //TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
315
        //                                    //TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
316
        //                                };
317
        //                                if (instance.Text != null && instance.Text != "")
318
        //                                {
319
        //                                    ToolTipService.SetToolTip(instance, s.UserID);
320
        //                                    Layer.Children.Add(instance);
321
322
        //                                    if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
323
        //                                    {
324
        //                                        s.fontConfig = new List<string>();
325
326
        //                                        s.fontConfig.Add("Arial");
327
        //                                        s.fontConfig.Add("Normal");
328
        //                                        s.fontConfig.Add("Normal");
329
        //                                        s.fontConfig.Add("30");
330
        //                                    }
331
        //                                    instance.TextFamily = new FontFamily(s.fontConfig[0]);
332
        //                                    //instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
333
        //                                    //instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
334
335
        //                                    //if (s.fontConfig.Count == 3)
336
        //                                    //{
337
        //                                    //    instance.TextSize = 30;
338
        //                                    //}
339
        //                                    //else
340
        //                                    //{
341
        //                                    //    instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
342
        //                                    //}
343
344
345
        //                                    instance.ApplyTemplate();
346
        //                                    if (s.fontConfig.Count() == 4)
347
        //                                    {
348
        //                                        instance.UnderLine = TextDecorations.Underline;
349
        //                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
350
        //                                    }
351
        //                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
352
        //                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
353
        //                                    instance.DrawingCloud();
354
        //                                }
355
        //                            }
356
        //                            break;
357
        //                        #endregion
358
        //                        #region Arc
359
        //                        case "ArcControl":
360
        //                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
361
        //                            {
362
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
363
        //                                ArcControl instance = new ArcControl()
364
        //                                {
365
        //                                    StartPoint = s.StartPoint,
366
        //                                    EndPoint = s.EndPoint,
367
        //                                    DashSize = s.DashSize,
368
        //                                    PointSet = s.PointSet,
369
        //                                    MidPoint = s.MP,
370
        //                                    UserID = s.UserID,
371
        //                                    isTransOn = s.IsTrans,
372
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
373
        //                                    LineSize = Convert.ToDouble(data2.First()),
374
        //                                };
375
        //                                ToolTipService.SetToolTip(instance, s.UserID);
376
        //                                Layer.Children.Add(instance);
377
        //                                instance.ApplyTemplate();
378
        //                                instance.SetArcPath();
379
        //                            }
380
        //                            break;
381
        //                        #endregion
382
        //                        #region RectCloud
383
        //                        case "RectCloudControl":
384
        //                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
385
        //                            {
386
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
387
        //                                RectCloudControl instance = new RectCloudControl()
388
        //                                {
389
        //                                    StartPoint = s.StartPoint,
390
        //                                    EndPoint = s.EndPoint,
391
        //                                    LeftBottomPoint = s.LB,
392
        //                                    Paint = s.PaintState,
393
        //                                    Opacity = s.Opac,
394
        //                                    TopRightPoint = s.TR,
395
        //                                    UserID = s.UserID,
396
        //                                    PointSet = s.PointSet,
397
        //                                    DashSize = s.DashSize,
398
        //                                    //StrokeColor = GetUserColor(dc, s.UserID),
399
        //                                    LineSize = Convert.ToDouble(data2.First()),
400
        //                                };
401
        //                                ToolTipService.SetToolTip(instance, s.UserID);
402
        //                                Layer.Children.Add(instance);
403
        //                                instance.ApplyTemplate();
404
        //                                instance.SetRectCloud();
405
        //                            }
406
        //                            break;
407
        //                        #endregion
408
        ////                        #region Sign
409
        ////                        case "SignControl":
410
        ////                            {
411
        ////                                using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
412
        ////                                {
413
        ////                                    SignControl instance = new SignControl
414
        ////                                    {
415
        ////                                        Angle = s.Angle,
416
        ////                                        UserNumber = s.UserNumber,
417
        ////                                        StartPoint = s.StartPoint,
418
        ////                                        TopRightPoint = s.TR,
419
        ////                                        EndPoint = s.EndPoint,
420
        ////                                        UserID = s.UserID,
421
        ////                                        LeftBottomPoint = s.LB,
422
        ////                                        PointSet = s.PointSet,
423
        ////                                        SignImage = null,
424
        ////                                    };
425
        ////                                    ToolTipService.SetToolTip(instance, s.UserID);
426
        ////#if SILVERLIGHT
427
        ////                                    SignUserSet.Add(instance);
428
        ////#endif
429
        ////                                    Layer.Children.Add(instance);
430
        ////                                    instance.ApplyTemplate();
431
        ////                                    instance.SetImage();
432
        ////                                }
433
        ////                            }
434
        ////                            break;
435
        ////                        #endregion
436
        ////                        #region SymbolN
437
        ////                        case "SymControlN":
438
        ////                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
439
        ////                            {
440
        ////                                SymControlN instance = new SymControlN()
441
        ////                                {
442
        ////                                    PointSet = s.PointSet,
443
        ////                                    StartPoint = s.StartPoint,
444
        ////                                    EndPoint = s.EndPoint,
445
        ////                                    Angle = s.Angle,
446
        ////                                    LeftBottomPoint = s.LB,
447
        ////                                    UserID = s.UserID,
448
        ////                                    TopRightPoint = s.TR,
449
        ////                                    Opacity = s.Opac,
450
        ////                                    //PathXathData = s.DBData,
451
        ////                                };
452
        ////                                Layer.Children.Add(instance);
453
        ////                                instance.ApplyTemplate();
454
        ////                                ToolTipService.SetToolTip(instance, s.UserID);
455
        ////#else
456
        ////                                instance.PathXathData = JsonSerializerHelper.UnCompressString_NonPrefix(s.DBData);
457
        ////                                MemoryStream memoryStream = new MemoryStream(Convert.FromBase64String(instance.PathXathData));
458
        ////                                object obj = XamlReader.Load(memoryStream);
459
        ////#endif
460
        ////                                instance.Base_ViewBox.Child = obj as UIElement;
461
        ////                                instance.SetViewBox();
462
        ////                            }
463
        ////                            break;
464
        ////                        #endregion
465
        //                        //#region Ink
466
        //                        //case "InkPresenter":
467
        //                        //    using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
468
        //                        //    {
469
470
        //                        //        if (((Layer as UIElement) as FrameworkElement).Name == "BaseLayer")
471
        //                        //        {
472
        //                        //                //this._InkBoard.Strokes = s.SCC;
473
        //                        //            foreach (var root in s.SCC)
474
        //                        //            {
475
        //                        //                if (s.UserID != null && data.Count() >1)
476
        //                        //                {
477
        //                        //                    root.DrawingAttributes.Color = GetUserColor(dc, s.UserID).Color;    
478
        //                        //                }
479
        //                        //                this._InkBoard.Strokes.Add(root);
480
        //                        //            }   
481
        //                        //        }
482
        //                        //        else
483
        //                        //        {
484
        //                        //            InkPresenter instance = new InkPresenter();
485
        //                        //            instance.Strokes = s.SCC;
486
        //                        //            if (s.UserID != null)
487
        //                        //            {
488
        //                        //                instance.Tag = s.UserID.ToString();
489
        //                        //            }
490
        //                        //            foreach (var stroke in instance.Strokes)
491
        //                        //            {
492
        //                        //                if (s.UserID != null && data.Count() > 1)
493
        //                        //                {
494
        //                        //                    stroke.DrawingAttributes.Color = GetUserColor(dc, s.UserID).Color;
495
        //                        //                }
496
497
        //                        //                if (stroke.DrawingAttributes.Color == StringToColorConverter.Parse("#FFFF0000"))
498
        //                        //                {
499
        //                        //                    stroke.DrawingAttributes.Color = GetUserColor(dc, s.UserID).Color;
500
        //                        //                }
501
        //                        //                //stroke.DrawingAttributes.Color = GetUserColor(dc, userID).Color;
502
        //                        //            }
503
        //                        //            ToolTipService.SetToolTip(instance, s.UserID);
504
        //                        //            Layer.Children.Add(instance);
505
        //                        //        }
506
507
        //                        //    }
508
        //                        //    break;
509
        //                        //#endregion
510
        //                        #region Date
511
        //                        case "DateControl":
512
        //                            {
513
        //                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
514
        //                                {
515
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
516
        //                                    DateControl instance = new DateControl
517
        //                                    {
518
        //                                        Angle = s.Angle,
519
        //                                        StartPoint = s.StartPoint,
520
        //                                        EndPoint = s.EndPoint,
521
        //                                        LeftBottomPoint = s.LB,
522
        //                                        TopRightPoint = s.TR,
523
        //                                        Opacity = s.Opac,
524
        //                                        //FontColor = GetUserColor(dc, s.UserID),
525
        //                                        UserID = s.UserID,
526
        //                                        LineSize = Convert.ToDouble(data2.First()),
527
        //                                        Text = s.Text,
528
        //                                        PointSet = s.PointSet,
529
        //                                    };
530
        //                                    ToolTipService.SetToolTip(instance, s.UserID);
531
        //                                    Layer.Children.Add(instance);
532
        //                                    instance.ApplyTemplate();
533
        //                                    instance.SetDate();
534
        //                                }
535
        //                            }
536
        //                            break;
537
        //                        #endregion
538
        //                        //#region Symbol
539
        //                        //case "SymControl":
540
        //                        //    using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
541
        //                        //    {
542
        //                        //        string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
543
        //                        //        StringToPathConverter sm = new StringToPathConverter();
544
        //                        //        SymControl instance = new SymControl()
545
        //                        //        {
546
        //                        //            LineSize = Convert.ToDouble(data2.First()),
547
        //                        //            PointSet = s.PointSet,
548
        //                        //            Paint = s.PaintState,
549
        //                        //            StartPoint = s.StartPoint,
550
        //                        //            StrokeColor = GetUserColor(dc, s.UserID),
551
        //                        //            EndPoint = s.EndPoint,
552
        //                        //            Angle = s.Angle,
553
        //                        //            UserID = s.UserID,
554
        //                        //            LeftBottomPoint = s.LB,
555
        //                        //            TopRightPoint = s.TR,
556
        //                        //            PathData = sm.Convert(s.PathInfo.ToString()),
557
        //                        //            Opacity = s.Opac,
558
        //                        //        };
559
        //                        //        ToolTipService.SetToolTip(instance, s.UserID);
560
        //                        //        Layer.Children.Add(instance);
561
        //                        //        instance.ApplyTemplate();
562
        //                        //        instance.SetSymPath();
563
        //                        //    }
564
        //                        //    break;
565
        //                        //#endregion
566
        //                        #region Image
567
        //                        case "ImgControl":
568
        //                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
569
        //                            {
570
        //                                ImgControl instance = new ImgControl
571
        //                                {
572
        //                                    Angle = s.Angle,
573
        //                                    StartPoint = s.StartPoint,
574
        //                                    TopRightPoint = s.TR,
575
        //                                    EndPoint = s.EndPoint,
576
        //                                    LeftBottomPoint = s.LB,
577
        //                                    PointSet = s.PointSet,
578
        //                                    UserID = s.UserID,
579
        //                                    Opacity = s.Opac,
580
        //                                    FilePath = s.ImagePath,
581
        //                                };
582
        //                                Layer.Children.Add(instance);
583
        //                                instance.ApplyTemplate();
584
        //                                try
585
        //                                {
586
        //                                    instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
587
        //                                    ToolTipService.SetToolTip(instance, s.UserID);
588
        //                                    instance.SetImage();
589
        //                                }
590
        //                                catch (Exception)
591
        //                                {
592
        //                                    break;
593
        //                                }
594
595
596
        //                            }
597
        //                            break;
598
        //                        #endregion
599
        //                        default:
600
        //                            break;
601
        //                    };
602
        //                }
603
        //            }
604
        //        }
605
        //        /// <summary>
606
        //        /// 복사전용
607
        //        /// </summary>
608
        //        /// <param name="MarkupString"></param>
609
        //        /// <param name="Layer"></param>
610
        //        /// <param name="ToolTipMessage"></param>
611
        //        public void markupParse(string MarkupString, Canvas Layer, string ToolTipMessage)
612
        //        {
613
        //            if (MarkupString != "False")
614
        //            {
615
        //                SignUserSet = new List<SignControl>();
616
        //                CopyDataSet = new List<UIElement>();
617
        //                string[] delimiterChars = { "|DZ|" };
618
        //                string[] delimiterChars2 = { "|" };
619
        //                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
620
        //                //ServiceDeepViewClient client = new ServiceDeepViewClient(this._Basebinding, this._BaseEndPoint);
621
        //                List<string> dataSet = new List<string>();
622
        //                foreach (var dataPease in data)
623
        //                {
624
        //                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
625
        //                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
626
        //                    switch (unkownControl.Name)
627
        //                    {
628
        //                        #region Arrow
629
        //                        case "ArrowControl":
630
        //                            using (S_ArrowControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl>(item))
631
        //                            {
632
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
633
        //                                ArrowControl instance = new ArrowControl
634
        //                                {
635
        //                                    LineSize = Convert.ToDouble(data2.First()),
636
        //                                    ArrowStyle = s.ArStyle,
637
        //                                    StartPoint = s.StartPoint,
638
        //                                    EndPoint = s.EndPoint,
639
        //                                    DimSize = s.DimSize,
640
        //                                    DashSize = s.DashSize,
641
        //                                    PointSet = s.PointSet,
642
643
        //                                    StrokeColor = new SolidColorBrush(Colors.Red)
644
        //                                };
645
        //                                Layer.Children.Add(instance);
646
        //                                CopyDataSet.Add(instance);
647
        //                                instance.ApplyTemplate();
648
        //                                instance.SetArrowPath();
649
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
650
651
        //                            }
652
        //                            break;
653
        //                        #endregion
654
        //                        #region RectCloud
655
        //                        case "RectCloudControl":
656
        //                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
657
        //                            {
658
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
659
        //                                RectCloudControl instance = new RectCloudControl()
660
        //                                {
661
        //                                    StartPoint = s.StartPoint,
662
        //                                    EndPoint = s.EndPoint,
663
        //                                    LeftBottomPoint = s.LB,
664
        //                                    Paint = s.PaintState,
665
        //                                    Opacity = s.Opac,
666
        //                                    TopRightPoint = s.TR,
667
        //                                    PointSet = s.PointSet,
668
        //                                    DashSize = s.DashSize,
669
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
670
        //                                    LineSize = Convert.ToDouble(data2.First()),
671
        //                                };
672
        //                                Layer.Children.Add(instance);
673
        //                                instance.ApplyTemplate();
674
        //                                CopyDataSet.Add(instance);
675
        //                                instance.SetRectCloud();
676
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
677
        //                            }
678
        //                            break;
679
        //                        #endregion
680
        //                        #region ArrowText
681
        //                        case "ArrowTextControl":
682
        //                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
683
        //                            {
684
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
685
        //                                ArrowTextControl instance = new ArrowTextControl();
686
        //                                Layer.Children.Add(instance);
687
        //                                instance.LineSize = Convert.ToDouble(data2.First());
688
        //                                instance.PointSet = s.PointSet;
689
        //                                instance.StartPoint = s.StartPoint;
690
        //                                instance.EndPoint = s.EndPoint;
691
        //                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
692
        //                                instance.DashSize = s.DashSize;
693
        //                                instance.ArrowTextStyle = s.ArrowStyle;
694
        //                                instance.ArrowText = s.ArrowText;
695
        //                                instance.BorderSize = s.BorderSize;
696
        //                                instance.BoxWidth = s.BoxWidth;
697
        //                                instance.BoxHeight = s.BoxHeight;
698
        //                                instance.isHighLight = s.isHighLight;
699
        //                                instance.isFixed = s.isFixed;
700
        //                                instance.ApplyTemplate();
701
        //                                instance.SetArrowTextPath();
702
        //                                instance.isTrans = s.isTrans;
703
        //                                instance.MidPoint = s.MP;
704
        //                                instance.Angle = s.Angle;
705
        //                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
706
        //                                {
707
        //                                    s.fontConfig = new List<string>();
708
709
        //                                    s.fontConfig.Add("Arial");
710
        //                                    s.fontConfig.Add("Normal");
711
        //                                    s.fontConfig.Add("Normal");
712
        //                                    s.fontConfig.Add("30");
713
        //                                }
714
        //                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
715
        //                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
716
        //                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
717
        //                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
718
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
719
        //                                CopyDataSet.Add(instance);
720
        //                                instance.ApplyTemplate();
721
        //                                instance.SetArrowTextPath();
722
        //                            };
723
724
        //                            break;
725
        //                        #endregion
726
        //                        #region Arrow_Multi
727
        //                        case "ArrowControl_Multi":
728
        //                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
729
        //                            {
730
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
731
        //                                ArrowControl_Multi instance = new ArrowControl_Multi
732
        //                                {
733
        //                                    LineSize = Convert.ToDouble(data2.First()),
734
        //                                    StartPoint = s.StartPoint,
735
        //                                    MiddlePoint = s.MP,
736
        //                                    DashSize = s.DashSize,
737
        //                                    EndPoint = s.EndPoint,
738
        //                                    PointSet = s.PointSet,
739
        //                                    StrokeColor = new SolidColorBrush(Colors.Red)
740
        //                                };
741
        //                                Layer.Children.Add(instance);
742
        //                                CopyDataSet.Add(instance);
743
        //                                instance.ApplyTemplate();
744
        //                                instance.SetArrowMultiPath();
745
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
746
747
        //                            }
748
        //                            break;
749
        //                        #endregion
750
        //                        #region Rectangle
751
        //                        case "RectagleControl":
752
        //                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
753
        //                            {
754
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
755
        //                                RectagleControl instance = new RectagleControl
756
        //                                {
757
        //                                    LineSize = Convert.ToDouble(data2.First()),
758
        //                                    Paint = s.PaintState,
759
        //                                    StartPoint = s.StartPoint,
760
        //                                    EndPoint = s.EndPoint,
761
        //                                    Angle = s.Angle,
762
        //                                    LeftBottomPoint = s.LB,
763
        //                                    TopRightPoint = s.TR,
764
        //                                    Opacity = s.Opac,
765
        //                                    PointSet = s.PointSet,
766
        //                                    DashSize = s.DashSize
767
        //                                };
768
        //                                Layer.Children.Add(instance);
769
        //                                CopyDataSet.Add(instance);
770
        //                                instance.ApplyTemplate();
771
        //                                instance.SetRectPath();
772
        //                            }
773
        //                            break;
774
        //                        #endregion
775
        //                        #region Triangle
776
        //                        case "TriControl":
777
        //                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
778
        //                            {
779
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
780
        //                                TriControl instance = new TriControl
781
        //                                {
782
        //                                    LineSize = Convert.ToDouble(data2.First()),
783
        //                                    MidPoint = s.MP,
784
        //                                    Paint = s.Paint,
785
        //                                    StartPoint = s.StartPoint,
786
        //                                    EndPoint = s.EndPoint,
787
        //                                    Angle = s.Angle,
788
        //                                    DashSize = s.DashSize,
789
        //                                    PointSet = s.PointSet
790
        //                                };
791
        //                                Layer.Children.Add(instance);
792
        //                                CopyDataSet.Add(instance);
793
        //                                instance.ApplyTemplate();
794
        //                                instance.SetTri();
795
        //                            }
796
        //                            break;
797
        //                        #endregion
798
        //                        #region Cicle
799
        //                        case "CicleControl":
800
        //                            using (S_CicleControl s = JsonSerializerHelper.JsonDeserialize<S_CicleControl>(item))
801
        //                            {
802
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
803
        //                                CicleControl instance = new CicleControl
804
        //                                {
805
        //                                    LineSize = Convert.ToDouble(data2.First()),
806
        //                                    Paint = s.PaintState,
807
        //                                    StartPoint = s.StartPoint,
808
        //                                    EndPoint = s.EndPoint,
809
        //                                    LeftBottomPoint = s.LBP,
810
        //                                    TopRightPoint = s.TRP,
811
        //                                    Angle = s.Angle,
812
        //                                    DashSize = s.DashSize,
813
        //                                    PointSet = s.PointSet,
814
        //                                };
815
        //                                Layer.Children.Add(instance);
816
        //                                CopyDataSet.Add(instance);
817
        //                                instance.ApplyTemplate();
818
        //                                instance.SetCicle();
819
        //                            }
820
        //                            break;
821
        //                        #endregion
822
        //                        #region Cloud
823
        //                        case "CloudControl":
824
        //                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
825
        //                            {
826
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
827
        //                                CloudControl instance = new CloudControl
828
        //                                {
829
        //                                    LineSize = Convert.ToDouble(data2.First()),
830
        //                                    Toler = s.Toler,
831
        //                                    PointSet = new List<Point>(),
832
        //                                    ArcLength = s.ArcLength,
833
        //                                    DashSize = s.DashSize,
834
        //                                    Paint = s.PaintState,
835
        //                                    isChain = s.IsChain,
836
        //                                    isTransOn = s.IsTrans,
837
        //                                    //Fill = s.CloudFill,
838
        //                                };
839
840
        //                                Layer.Children.Add(instance);
841
        //                                CopyDataSet.Add(instance);
842
        //                                instance.ApplyTemplate();
843
        //                                instance.PointSet = s.pointSet;
844
        //                                instance.ClosePath();
845
        //                            }
846
        //                            break;
847
        //                        #endregion
848
        //                        #region Line
849
        //                        case "LineControl":
850
        //                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
851
        //                            {
852
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
853
        //                                LineControl instance = new LineControl()
854
        //                                {
855
        //                                    LineStyle = s.LnSet,
856
        //                                    StartPoint = s.StartPoint,
857
        //                                    EndPoint = s.EndPoint,
858
        //                                    DashSize = s.DashSize,
859
        //                                    Interval = s.Interval,
860
        //                                    PointSet = s.PointSet,
861
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
862
        //                                    LineSize = Convert.ToDouble(data2.First()),
863
        //                                };
864
        //                                Layer.Children.Add(instance);
865
        //                                CopyDataSet.Add(instance);
866
        //                                instance.ApplyTemplate();
867
        //                                instance.SetLinePath();
868
        //                            }
869
        //                            break;
870
        //                        #endregion
871
        //                        #region Text
872
        //                        case "TextControl":
873
        //                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
874
        //                            {
875
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
876
        //                                TextControl instance = new TextControl()
877
        //                                {
878
        //                                    Text = s.Text,
879
        //                                    StartPoint = s.StartPoint,
880
        //                                    EndPoint = s.EndPoint,
881
        //                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
882
        //                                    TextSize = Convert.ToDouble(data2[1]),
883
        //                                    FontColor = new SolidColorBrush(Colors.Red),
884
        //                                    FontSize = 10,
885
        //                                    Angle = s.Angle,
886
        //                                    PointSet = s.PointSet,
887
        //                                    Paint = s.PaintState,
888
        //                                    isHighLight = s.isHighLight,
889
        //                                    TextFamily = new FontFamily(s.fontConfig[0]),
890
        //                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
891
        //                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
892
        //                                };
893
        //                                if (instance.Text == "" || instance.Text == null)
894
        //                                {
895
896
        //                                }
897
        //                                else
898
        //                                {
899
900
        //                                    instance.SetText();
901
        //                                    CopyDataSet.Add(instance);
902
        //                                    Layer.Children.Add(instance);
903
        //                                    if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
904
        //                                    {
905
        //                                        s.fontConfig = new List<string>();
906
907
        //                                        s.fontConfig.Add("Arial");
908
        //                                        s.fontConfig.Add("Normal");
909
        //                                        s.fontConfig.Add("Normal");
910
        //                                        s.fontConfig.Add("30");
911
        //                                    }
912
        //                                    instance.TextFamily = new FontFamily(s.fontConfig[0]);
913
        //                                    instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
914
        //                                    instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
915
916
        //                                    //if (s.fontConfig.Count == 3)
917
        //                                    //{
918
        //                                    //    if (true)
919
        //                                    //    {
920
921
        //                                    //    }
922
        //                                    //    instance.TextSize = 30;
923
        //                                    //}
924
        //                                    //else
925
        //                                    //{
926
        //                                    //    instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
927
        //                                    //}
928
        //                                    instance.ApplyTemplate();
929
        //                                    instance.DrawingCloud();
930
        //                                    if (s.fontConfig.Count() == 4)
931
        //                                    {
932
        //                                        instance.UnderLine = TextDecorations.Underline;
933
        //                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
934
        //                                    }
935
        //                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
936
        //                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
937
        //                                }
938
        //                            }
939
        //                            break;
940
        //                        #endregion
941
        //                        #region Arc
942
        //                        case "ArcControl":
943
        //                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
944
        //                            {
945
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
946
        //                                ArcControl instance = new ArcControl()
947
        //                                {
948
        //                                    StartPoint = s.StartPoint,
949
        //                                    MidPoint = s.MP,
950
        //                                    EndPoint = s.EndPoint,
951
        //                                    isTransOn = s.IsTrans,
952
        //                                    DashSize = s.DashSize,
953
        //                                    PointSet = s.PointSet,
954
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
955
        //                                    LineSize = Convert.ToDouble(data2.First()),
956
        //                                };
957
        //                                Layer.Children.Add(instance);
958
        //                                CopyDataSet.Add(instance);
959
        //                                instance.ApplyTemplate();
960
        //                                instance.SetArcPath();
961
        //                            }
962
        //                            break;
963
        //                        #endregion
964
        //                        #region Sign
965
        //                        case "SignControl":
966
        //                            {
967
        //                                using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
968
        //                                {
969
        //                                    ImageSource img;
970
971
972
        //                                    SignControl instance_Sign = new SignControl
973
        //                                    {
974
        //                                        Angle = s.Angle,
975
        //                                        UserNumber = s.UserNumber,
976
        //                                        StartPoint = s.StartPoint,
977
        //                                        TopRightPoint = s.TR,
978
        //                                        EndPoint = s.EndPoint,
979
        //                                        LeftBottomPoint = s.LB,
980
        //                                        PointSet = s.PointSet,
981
        //                                    };
982
983
984
        //                                    try
985
        //                                    {
986
        //                                        this.SignSet.TryGetValue(s.UserNumber, out img);
987
        //                                        instance_Sign.SignImage = img;
988
        //                                    }
989
        //                                    catch (Exception)
990
        //                                    {
991
        //                                        SignUserSet.Add(instance_Sign);
992
        //                                        this.GetSignImageLoaded(SignUserSet);
993
        //                                    }
994
        //                                    Layer.Children.Add(instance_Sign);
995
        //                                    CopyDataSet.Add(instance_Sign);
996
        //                                    instance_Sign.ApplyTemplate();
997
        //                                    instance_Sign.SetImage();
998
        //                                }
999
        //                            }
1000
        //                            break;
1001
        //                        #endregion
1002
        //                        #region Date
1003
        //                        case "DateControl":
1004
        //                            {
1005
        //                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
1006
        //                                {
1007
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1008
        //                                    DateControl instance = new DateControl
1009
        //                                    {
1010
        //                                        Angle = s.Angle,
1011
        //                                        StartPoint = s.StartPoint,
1012
        //                                        EndPoint = s.EndPoint,
1013
        //                                        LeftBottomPoint = s.LB,
1014
        //                                        TopRightPoint = s.TR,
1015
        //                                        Opacity = s.Opac,
1016
        //                                        FontColor = new SolidColorBrush(Colors.Red),
1017
        //                                        LineSize = Convert.ToDouble(data2.First()),
1018
        //                                        Text = s.Text,
1019
        //                                        PointSet = s.PointSet,
1020
        //                                    };
1021
1022
        //                                    Layer.Children.Add(instance);
1023
        //                                    CopyDataSet.Add(instance);
1024
        //                                    instance.ApplyTemplate();
1025
        //                                    instance.SetDate();
1026
        //                                }
1027
        //                            }
1028
        //                            break;
1029
        //                        #endregion
1030
        //                        #region Symbol
1031
        //                        case "SymControl":
1032
        //                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1033
        //                            {
1034
1035
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1036
        //                                StringToPathConverter sm = new StringToPathConverter();
1037
        //                                SymControl instance = new SymControl()
1038
        //                                {
1039
        //                                    LineSize = Convert.ToDouble(data2.First()),
1040
        //                                    PointSet = s.PointSet,
1041
        //                                    Paint = s.PaintState,
1042
        //                                    StartPoint = s.StartPoint,
1043
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
1044
        //                                    EndPoint = s.EndPoint,
1045
        //                                    Angle = s.Angle,
1046
        //                                    LeftBottomPoint = s.LB,
1047
        //                                    TopRightPoint = s.TR,
1048
        //                                    PathData = sm.Convert(s.PathInfo.ToString()),
1049
        //                                    Opacity = s.Opac,
1050
        //                                };
1051
        //                                Layer.Children.Add(instance);
1052
        //                                CopyDataSet.Add(instance);
1053
        //                                instance.ApplyTemplate();
1054
        //                                instance.SetSymPath();
1055
        //                            }
1056
        //                            break;
1057
        //                        #endregion
1058
        //                        #region Image
1059
        //                        case "ImgControl":
1060
        //                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
1061
        //                            {
1062
        //                                ImgControl instance = new ImgControl
1063
        //                                {
1064
        //                                    Angle = s.Angle,
1065
        //                                    StartPoint = s.StartPoint,
1066
        //                                    TopRightPoint = s.TR,
1067
        //                                    EndPoint = s.EndPoint,
1068
        //                                    LeftBottomPoint = s.LB,
1069
        //                                    PointSet = s.PointSet,
1070
        //                                    Opacity = s.Opac,
1071
        //                                    FilePath = s.ImagePath,
1072
        //                                };
1073
        //                                Layer.Children.Add(instance);
1074
        //                                instance.ApplyTemplate();
1075
        //                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
1076
        //                                CopyDataSet.Add(instance);
1077
        //                                instance.SetImage();
1078
        //                            }
1079
        //                            break;
1080
        //                        #endregion
1081
        //                        #region SymbolN
1082
        //                        case "SymControlN":
1083
        //                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
1084
        //                            {
1085
        //                                SymControlN instance = new SymControlN()
1086
        //                                {
1087
        //                                    PointSet = s.PointSet,
1088
        //                                    StartPoint = s.StartPoint,
1089
        //                                    EndPoint = s.EndPoint,
1090
        //                                    Angle = s.Angle,
1091
        //                                    LeftBottomPoint = s.LB,
1092
        //                                    TopRightPoint = s.TR,
1093
        //                                    Opacity = s.Opac,
1094
        //                                    //PathXathData = s.DBData,
1095
        //                                };
1096
        //                                if (instance.PointSet.Count == 4)
1097
        //                                {
1098
        //                                    Layer.Children.Add(instance);
1099
        //                                    CopyDataSet.Add(instance);
1100
        //                                    instance.ApplyTemplate();
1101
        //                                    instance.PathXathData = JsonSerializerHelper.UnCompressString_NonPrefix(s.DBData);
1102
        //                                    object obj = XamlReader.Load(JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData));
1103
        //                                    instance.Base_ViewBox.Child = obj as UIElement;
1104
        //                                    instance.SetViewBox();
1105
        //                                }
1106
1107
1108
        //                            }
1109
        //                            break;
1110
        //                        #endregion
1111
        //                        #region Ink
1112
        //                        case "InkPresenter":
1113
        //                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
1114
        //                            {
1115
        //                                this._InkBoard.Strokes = s.SCC;
1116
        //                            }
1117
        //                            break;
1118
        //        #endregion
1119
        //                        #region Poly
1120
        //                        case "PolyControl":
1121
        //                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
1122
        //                            {
1123
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1124
        //                                PolyControl instance = new PolyControl()
1125
        //                                {
1126
        //                                    //LineSize = Convert.ToDouble(data2.First()),
1127
        //                                    LineSize = LineSize,
1128
        //                                    PointSet = s.PointSet,
1129
        //                                    PointC = s.PointC,
1130
        //                                    StartPoint = s.StartPoint,
1131
        //                                    EndPoint = s.EndPoint,
1132
        //                                    Opacity = s.Opac,
1133
        //                                };
1134
        //                                Layer.Children.Add(instance);
1135
        //                                CopyDataSet.Add(instance);
1136
        //                                instance.ApplyTemplate();
1137
        //                                instance.SetPolyPath();
1138
        //                            };
1139
        //                            break;
1140
        //        #endregion
1141
        //                        default:
1142
        //                            break;
1143
        //                    };
1144
1145
        //                    foreach (var copyData in CopyDataSet)
1146
        //                    {
1147
        //                        Layer.Children.Remove(copyData);
1148
        //                    }
1149
        //                }
1150
        //            }
1151
        //        }
1152
1153
        //        /// <summary>
1154
        //        /// Undo Redo 전용
1155
        //        /// </summary>
1156
        //        /// <param name="MarkupString"></param>
1157
        //        /// <param name="Layer"></param>
1158
        //        /// <param name="ToolTipMessage"></param>
1159
        //        public void markupParseUndo(string MarkupString, Canvas Layer, string ToolTipMessage)
1160
        //        {
1161
        //            if (MarkupString != "False")
1162
        //            {
1163
        //                SignUserSet = new List<SignControl>();
1164
        //                CopyDataSet = new List<UIElement>();
1165
        //                string[] delimiterChars = { "|DZ|" };
1166
        //                string[] delimiterChars2 = { "|" };
1167
        //                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
1168
        //                //ServiceDeepViewClient client = new ServiceDeepViewClient(this._Basebinding, this._BaseEndPoint);
1169
        //                List<string> dataSet = new List<string>();
1170
        //                foreach (var dataPease in data)
1171
        //                {
1172
        //                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
1173
        //                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
1174
        //                    switch (unkownControl.Name)
1175
        //                    {
1176
        //                        #region Arrow
1177
        //                        case "ArrowControl":
1178
        //                            using (S_ArrowControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl>(item))
1179
        //                            {
1180
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1181
        //                                ArrowControl instance = new ArrowControl
1182
        //                                {
1183
        //                                    LineSize = Convert.ToDouble(data2.First()),
1184
        //                                    ArrowStyle = s.ArStyle,
1185
        //                                    StartPoint = s.StartPoint,
1186
        //                                    EndPoint = s.EndPoint,
1187
        //                                    DashSize = s.DashSize,
1188
        //                                    PointSet = s.PointSet,
1189
        //                                    DimSize = s.DimSize,
1190
1191
        //                                    StrokeColor = new SolidColorBrush(Colors.Red)
1192
        //                                };
1193
        //                                Layer.Children.Add(instance);
1194
        //                                instance.ApplyTemplate();
1195
        //                                instance.SetArrowPath();
1196
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1197
1198
        //                            }
1199
        //                            break;
1200
        //                        #endregion
1201
        //                        #region RectCloud
1202
        //                        case "RectCloudControl":
1203
        //                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
1204
        //                            {
1205
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1206
        //                                RectCloudControl instance = new RectCloudControl()
1207
        //                                {
1208
        //                                    StartPoint = s.StartPoint,
1209
        //                                    EndPoint = s.EndPoint,
1210
        //                                    LeftBottomPoint = s.LB,
1211
        //                                    Paint = s.PaintState,
1212
        //                                    Opacity = s.Opac,
1213
        //                                    TopRightPoint = s.TR,
1214
        //                                    PointSet = s.PointSet,
1215
        //                                    DashSize = s.DashSize,
1216
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
1217
        //                                    LineSize = Convert.ToDouble(data2.First()),
1218
        //                                };
1219
        //                                Layer.Children.Add(instance);
1220
        //                                instance.ApplyTemplate();
1221
        //                                instance.SetRectCloud();
1222
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1223
        //                            }
1224
        //                            break;
1225
        //                        #endregion
1226
        //                        #region ArrowText
1227
        //                        case "ArrowTextControl":
1228
        //                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
1229
        //                            {
1230
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1231
        //                                ArrowTextControl instance = new ArrowTextControl();
1232
        //                                Layer.Children.Add(instance);
1233
        //                                instance.LineSize = Convert.ToDouble(data2.First());
1234
        //                                instance.PointSet = s.PointSet;
1235
        //                                instance.StartPoint = s.StartPoint;
1236
        //                                instance.EndPoint = s.EndPoint;
1237
        //                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
1238
        //                                instance.DashSize = s.DashSize;
1239
        //                                instance.ArrowTextStyle = s.ArrowStyle;
1240
        //                                instance.ArrowText = s.ArrowText;
1241
        //                                instance.BorderSize = s.BorderSize;
1242
        //                                instance.BoxWidth = s.BoxWidth;
1243
        //                                instance.BoxHeight = s.BoxHeight;
1244
        //                                instance.isHighLight = s.isHighLight;
1245
        //                                instance.ApplyTemplate();
1246
        //                                instance.isFixed = s.isFixed;
1247
        //                                instance.SetArrowTextPath();
1248
        //                                instance.isTrans = s.isTrans;
1249
        //                                instance.Angle = s.Angle;
1250
        //                                instance.MidPoint = s.MP;
1251
        //                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
1252
        //                                {
1253
        //                                    s.fontConfig = new List<string>();
1254
1255
        //                                    s.fontConfig.Add("Arial");
1256
        //                                    s.fontConfig.Add("Normal");
1257
        //                                    s.fontConfig.Add("Normal");
1258
        //                                    s.fontConfig.Add("30");
1259
        //                                }
1260
        //                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
1261
        //                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
1262
        //                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
1263
        //                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
1264
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1265
        //                                instance.ApplyTemplate();
1266
        //                                instance.SetArrowTextPath();
1267
        //                            };
1268
1269
        //                            break;
1270
        //                        #endregion
1271
        //                        #region Arrow_Multi
1272
        //                        case "ArrowControl_Multi":
1273
        //                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
1274
        //                            {
1275
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1276
        //                                ArrowControl_Multi instance = new ArrowControl_Multi
1277
        //                                {
1278
        //                                    LineSize = Convert.ToDouble(data2.First()),
1279
        //                                    StartPoint = s.StartPoint,
1280
        //                                    MiddlePoint = s.MP,
1281
        //                                    DashSize = s.DashSize,
1282
        //                                    EndPoint = s.EndPoint,
1283
        //                                    PointSet = s.PointSet,
1284
        //                                    StrokeColor = new SolidColorBrush(Colors.Red)
1285
        //                                };
1286
        //                                Layer.Children.Add(instance);
1287
        //                                instance.ApplyTemplate();
1288
        //                                instance.SetArrowMultiPath();
1289
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1290
1291
        //                            }
1292
        //                            break;
1293
        //                        #endregion
1294
        //                        #region Rectangle
1295
        //                        case "RectagleControl":
1296
        //                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
1297
        //                            {
1298
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1299
        //                                RectagleControl instance = new RectagleControl
1300
        //                                {
1301
        //                                    LineSize = Convert.ToDouble(data2.First()),
1302
        //                                    Paint = s.PaintState,
1303
        //                                    StartPoint = s.StartPoint,
1304
        //                                    EndPoint = s.EndPoint,
1305
        //                                    Angle = s.Angle,
1306
        //                                    LeftBottomPoint = s.LB,
1307
        //                                    TopRightPoint = s.TR,
1308
        //                                    Opacity = s.Opac,
1309
        //                                    PointSet = s.PointSet,
1310
        //                                    DashSize = s.DashSize
1311
        //                                };
1312
        //                                Layer.Children.Add(instance);
1313
        //                                instance.ApplyTemplate();
1314
        //                                instance.SetRectPath();
1315
        //                            }
1316
        //                            break;
1317
        //                        #endregion
1318
        //                        #region Triangle
1319
        //                        case "TriControl":
1320
        //                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
1321
        //                            {
1322
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1323
        //                                TriControl instance = new TriControl
1324
        //                                {
1325
        //                                    LineSize = Convert.ToDouble(data2.First()),
1326
        //                                    MidPoint = s.MP,
1327
        //                                    Paint = s.Paint,
1328
        //                                    StartPoint = s.StartPoint,
1329
        //                                    EndPoint = s.EndPoint,
1330
        //                                    Angle = s.Angle,
1331
        //                                    DashSize = s.DashSize,
1332
        //                                    PointSet = s.PointSet
1333
        //                                };
1334
        //                                Layer.Children.Add(instance);
1335
        //                                instance.ApplyTemplate();
1336
        //                                instance.SetTri();
1337
        //                            }
1338
        //                            break;
1339
        //                        #endregion
1340
        //                        #region Cicle
1341
        //                        case "CicleControl":
1342
        //                            using (S_CicleControl s = JsonSerializerHelper.JsonDeserialize<S_CicleControl>(item))
1343
        //                            {
1344
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1345
        //                                CicleControl instance = new CicleControl
1346
        //                                {
1347
        //                                    LineSize = Convert.ToDouble(data2.First()),
1348
        //                                    Paint = s.PaintState,
1349
        //                                    StartPoint = s.StartPoint,
1350
        //                                    EndPoint = s.EndPoint,
1351
        //                                    LeftBottomPoint = s.LBP,
1352
        //                                    TopRightPoint = s.TRP,
1353
        //                                    Angle = s.Angle,
1354
        //                                    DashSize = s.DashSize,
1355
        //                                    PointSet = s.PointSet,
1356
        //                                };
1357
        //                                Layer.Children.Add(instance);
1358
        //                                instance.ApplyTemplate();
1359
        //                                instance.SetCicle();
1360
        //                            }
1361
        //                            break;
1362
        //                        #endregion
1363
        //                        #region Cloud
1364
        //                        case "CloudControl":
1365
        //                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
1366
        //                            {
1367
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1368
        //                                CloudControl instance = new CloudControl
1369
        //                                {
1370
        //                                    LineSize = Convert.ToDouble(data2.First()),
1371
        //                                    Toler = s.Toler,
1372
        //                                    PointSet = new List<Point>(),
1373
        //                                    ArcLength = s.ArcLength,
1374
        //                                    Paint = s.PaintState,
1375
        //                                    isTransOn = s.IsTrans,
1376
        //                                    DashSize = s.DashSize,
1377
        //                                    isChain = s.IsChain,
1378
        //                                    //Fill = s.CloudFill,
1379
        //                                };
1380
1381
        //                                Layer.Children.Add(instance);
1382
        //                                instance.ApplyTemplate();
1383
        //                                instance.PointSet = s.pointSet;
1384
        //                                instance.ClosePath();
1385
        //                                instance.SetCloud();
1386
        //                            }
1387
        //                            break;
1388
        //                        #endregion
1389
        //                        #region Line
1390
        //                        case "LineControl":
1391
        //                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
1392
        //                            {
1393
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1394
        //                                LineControl instance = new LineControl()
1395
        //                                {
1396
        //                                    LineStyle = s.LnSet,
1397
        //                                    StartPoint = s.StartPoint,
1398
        //                                    EndPoint = s.EndPoint,
1399
        //                                    DashSize = s.DashSize,
1400
        //                                    PointSet = s.PointSet,
1401
        //                                    Interval = s.Interval,
1402
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
1403
        //                                    LineSize = Convert.ToDouble(data2.First()),
1404
        //                                };
1405
        //                                Layer.Children.Add(instance);
1406
        //                                instance.ApplyTemplate();
1407
        //                                instance.SetLinePath();
1408
        //                            }
1409
        //                            break;
1410
        //                        #endregion
1411
        //                        #region Text
1412
        //                        case "TextControl":
1413
        //                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
1414
        //                            {
1415
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1416
        //                                TextControl instance = new TextControl()
1417
        //                                {
1418
        //                                    Text = s.Text,
1419
        //                                    StartPoint = s.StartPoint,
1420
        //                                    EndPoint = s.EndPoint,
1421
        //                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
1422
        //                                    TextSize = Convert.ToDouble(data2[1]),
1423
        //                                    FontColor = new SolidColorBrush(StringToColorConverter.Parse(s.FontColor)),
1424
        //                                    FontSize = 10,
1425
        //                                    Angle = s.Angle,
1426
        //                                    PointSet = s.PointSet,
1427
        //                                    Paint = s.PaintState,
1428
        //                                    isHighLight = s.isHighLight,
1429
        //                                    TextFamily = new FontFamily(s.fontConfig[0]),
1430
        //                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
1431
        //                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
1432
        //                                };
1433
1434
        //                                instance.SetText();
1435
        //                                Layer.Children.Add(instance);
1436
        //                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
1437
        //                                {
1438
        //                                    s.fontConfig = new List<string>();
1439
1440
        //                                    s.fontConfig.Add("Arial");
1441
        //                                    s.fontConfig.Add("Normal");
1442
        //                                    s.fontConfig.Add("Normal");
1443
        //                                    s.fontConfig.Add("30");
1444
        //                                }
1445
        //                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
1446
        //                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
1447
        //                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
1448
1449
        //                                //if (s.fontConfig.Count == 3)
1450
        //                                //{
1451
        //                                //    instance.TextSize = 30;
1452
        //                                //}
1453
        //                                //else
1454
        //                                //{
1455
        //                                //    instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
1456
        //                                //}
1457
        //                                instance.ApplyTemplate();
1458
        //                                instance.DrawingCloud();
1459
        //                                if (s.fontConfig.Count() == 4)
1460
        //                                {
1461
        //                                    instance.UnderLine = TextDecorations.Underline;
1462
        //                                    instance.Base_TextBlock.TextDecorations = instance.UnderLine;
1463
        //                                }
1464
        //                                instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
1465
        //                                instance.Base_TextBox.Visibility = Visibility.Collapsed;
1466
        //                            }
1467
        //                            break;
1468
        //                        #endregion
1469
        //                        #region Arc
1470
        //                        case "ArcControl":
1471
        //                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
1472
        //                            {
1473
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1474
        //                                ArcControl instance = new ArcControl()
1475
        //                                {
1476
        //                                    StartPoint = s.StartPoint,
1477
        //                                    MidPoint = s.MP,
1478
        //                                    EndPoint = s.EndPoint,
1479
        //                                    isTransOn = s.IsTrans,
1480
        //                                    DashSize = s.DashSize,
1481
        //                                    PointSet = s.PointSet,
1482
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
1483
        //                                    LineSize = Convert.ToDouble(data2.First()),
1484
        //                                };
1485
        //                                Layer.Children.Add(instance);
1486
        //                                instance.ApplyTemplate();
1487
        //                                instance.SetArcPath();
1488
        //                            }
1489
        //                            break;
1490
        //                        #endregion
1491
        //                        #region Sign
1492
        //                        case "SignControl":
1493
        //                            {
1494
        //                                using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
1495
        //                                {
1496
        //                                    ImageSource img;
1497
1498
1499
        //                                    SignControl instance_Sign = new SignControl
1500
        //                                    {
1501
        //                                        Angle = s.Angle,
1502
        //                                        UserNumber = s.UserNumber,
1503
        //                                        StartPoint = s.StartPoint,
1504
        //                                        TopRightPoint = s.TR,
1505
        //                                        EndPoint = s.EndPoint,
1506
        //                                        LeftBottomPoint = s.LB,
1507
        //                                        PointSet = s.PointSet,
1508
        //                                    };
1509
1510
1511
        //                                    try
1512
        //                                    {
1513
        //                                        this.SignSet.TryGetValue(s.UserNumber, out img);
1514
        //                                        instance_Sign.SignImage = img;
1515
        //                                    }
1516
        //                                    catch (Exception)
1517
        //                                    {
1518
        //                                        SignUserSet.Add(instance_Sign);
1519
        //                                        this.GetSignImageLoaded(SignUserSet);
1520
        //                                    }
1521
        //                                    Layer.Children.Add(instance_Sign);
1522
        //                                    instance_Sign.ApplyTemplate();
1523
        //                                    instance_Sign.SetImage();
1524
        //                                }
1525
        //                            }
1526
        //                            break;
1527
        //                        #endregion
1528
        //                        #region Date
1529
        //                        case "DateControl":
1530
        //                            {
1531
        //                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
1532
        //                                {
1533
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1534
        //                                    DateControl instance = new DateControl
1535
        //                                    {
1536
        //                                        Angle = s.Angle,
1537
        //                                        StartPoint = s.StartPoint,
1538
        //                                        EndPoint = s.EndPoint,
1539
        //                                        LeftBottomPoint = s.LB,
1540
        //                                        TopRightPoint = s.TR,
1541
        //                                        Opacity = s.Opac,
1542
        //                                        FontColor = new SolidColorBrush(Colors.Red),
1543
        //                                        LineSize = Convert.ToDouble(data2.First()),
1544
        //                                        Text = s.Text,
1545
        //                                        PointSet = s.PointSet,
1546
        //                                    };
1547
1548
        //                                    Layer.Children.Add(instance);
1549
        //                                    instance.ApplyTemplate();
1550
        //                                    instance.SetDate();
1551
        //                                }
1552
        //                            }
1553
        //                            break;
1554
        //                        #endregion
1555
        //                        #region Symbol
1556
        //                        case "SymControl":
1557
        //                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
1558
        //                            {
1559
1560
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1561
        //                                StringToPathConverter sm = new StringToPathConverter();
1562
        //                                SymControl instance = new SymControl()
1563
        //                                {
1564
        //                                    LineSize = Convert.ToDouble(data2.First()),
1565
        //                                    PointSet = s.PointSet,
1566
        //                                    Paint = s.PaintState,
1567
        //                                    StartPoint = s.StartPoint,
1568
        //                                    StrokeColor = new SolidColorBrush(Colors.Red),
1569
        //                                    EndPoint = s.EndPoint,
1570
        //                                    Angle = s.Angle,
1571
        //                                    LeftBottomPoint = s.LB,
1572
        //                                    TopRightPoint = s.TR,
1573
        //                                    PathData = sm.Convert(s.PathInfo.ToString()),
1574
        //                                    Opacity = s.Opac,
1575
        //                                };
1576
        //                                Layer.Children.Add(instance);
1577
        //                                instance.ApplyTemplate();
1578
        //                                instance.SetSymPath();
1579
        //                            }
1580
        //                            break;
1581
        //                        #endregion
1582
        //                        #region Image
1583
        //                        case "ImgControl":
1584
        //                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
1585
        //                            {
1586
        //                                ImgControl instance = new ImgControl
1587
        //                                {
1588
        //                                    Angle = s.Angle,
1589
        //                                    StartPoint = s.StartPoint,
1590
        //                                    TopRightPoint = s.TR,
1591
        //                                    EndPoint = s.EndPoint,
1592
        //                                    LeftBottomPoint = s.LB,
1593
        //                                    PointSet = s.PointSet,
1594
        //                                    Opacity = s.Opac,
1595
        //                                    FilePath = s.ImagePath,
1596
        //                                };
1597
        //                                Layer.Children.Add(instance);
1598
        //                                instance.ApplyTemplate();
1599
        //                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
1600
        //                                instance.SetImage();
1601
        //                            }
1602
        //                            break;
1603
        //                        #endregion
1604
        //                        #region SymbolN
1605
        //                        case "SymControlN":
1606
        //                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
1607
        //                            {
1608
        //                                SymControlN instance = new SymControlN()
1609
        //                                {
1610
        //                                    PointSet = s.PointSet,
1611
        //                                    StartPoint = s.StartPoint,
1612
        //                                    EndPoint = s.EndPoint,
1613
        //                                    Angle = s.Angle,
1614
        //                                    LeftBottomPoint = s.LB,
1615
        //                                    TopRightPoint = s.TR,
1616
        //                                    Opacity = s.Opac,
1617
        //                                    //PathXathData = s.DBData,
1618
        //                                };
1619
1620
        //                                Layer.Children.Add(instance);
1621
        //                                instance.ApplyTemplate();
1622
        //                                instance.PathXathData = JsonSerializerHelper.UnCompressString_NonPrefix(s.DBData);
1623
        //                                object obj = XamlReader.Load(JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData));
1624
        //                                instance.Base_ViewBox.Child = obj as UIElement;
1625
        //                                instance.SetViewBox();
1626
        //                            }
1627
        //                            break;
1628
        //                        #endregion
1629
        //                        #region Ink
1630
        //                        case "InkPresenter":
1631
        //                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
1632
        //                            {
1633
        //                                this._InkBoard.Strokes = s.SCC;
1634
        //                            }
1635
        //                            break;
1636
        //                        #endregion
1637
        //                        #region Poly
1638
        //                        case "PolyControl":
1639
        //                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
1640
        //                            {
1641
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1642
        //                                PolyControl instance = new PolyControl()
1643
        //                                {
1644
        //                                    //LineSize = Convert.ToDouble(data2.First()),
1645
        //                                    LineSize = LineSize,
1646
        //                                    PointSet = s.PointSet,
1647
        //                                    PointC = s.PointC,
1648
        //                                    StartPoint = s.StartPoint,
1649
        //                                    EndPoint = s.EndPoint,
1650
        //                                    Opacity = s.Opac,
1651
        //                                };
1652
        //                                Layer.Children.Add(instance);
1653
        //                                instance.ApplyTemplate();
1654
        //                                instance.SetPolyPath();
1655
        //                            };
1656
        //                            break;
1657
        //                        #endregion
1658
        //                        default:
1659
        //                            break;
1660
        //                    };
1661
1662
        //                    foreach (var copyData in CopyDataSet)
1663
        //                    {
1664
        //                        Layer.Children.Remove(copyData);
1665
        //                    }
1666
        //                }
1667
        //            }
1668
        //        }
1669
1670
1671
        //        /// <summary>
1672
        //        /// 복사전용
1673
        //        /// </summary>
1674
        //        /// <param name="MarkupString"></param>
1675
        //        /// <param name="Layer"></param>
1676
        //        /// <param name="ToolTipMessage"></param>
1677
        //        public MarkupEditToolKit.Adorner.AdornerFinal markupParseToAdorner(string MarkupString, Canvas Layer, string ToolTipMessage)
1678
        //        {
1679
        //            MarkupEditToolKit.Adorner.AdornerFinal af = new Adorner.AdornerFinal();
1680
        //            {
1681
        //                if (MarkupString != "False")
1682
        //                {
1683
        //                    SignUserSet = new List<SignControl>();
1684
        //                    CopyDataSet = new List<UIElement>();
1685
        //                    string[] delimiterChars = { "|DZ|" };
1686
        //                    string[] delimiterChars2 = { "|" };
1687
        //                    string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
1688
        //                    //ServiceDeepViewClient client = new ServiceDeepViewClient(this._Basebinding, this._BaseEndPoint);
1689
        //                    List<string> dataSet = new List<string>();
1690
        //                    foreach (var dataPease in data)
1691
        //                    {
1692
        //                        var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
1693
        //                        var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
1694
        //                        switch (unkownControl.Name)
1695
        //                        {
1696
        //                            #region Arrow
1697
        //                            case "ArrowControl":
1698
        //                                using (S_ArrowControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl>(item))
1699
        //                                {
1700
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1701
        //                                    ArrowControl instance = new ArrowControl
1702
        //                                    {
1703
        //                                        LineSize = Convert.ToDouble(data2.First()),
1704
        //                                        ArrowStyle = s.ArStyle,
1705
        //                                        StartPoint = s.StartPoint,
1706
        //                                        DimSize = s.DimSize,
1707
        //                                        EndPoint = s.EndPoint,
1708
        //                                        DashSize = s.DashSize,
1709
        //                                        PointSet = s.PointSet,
1710
1711
        //                                        StrokeColor = new SolidColorBrush(Colors.Red)
1712
        //                                    };
1713
        //                                    Layer.Children.Add(instance);
1714
        //                                    CopyDataSet.Add(instance);
1715
        //                                    instance.ApplyTemplate();
1716
        //                                    instance.SetArrowPath();
1717
        //                                    instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1718
1719
        //                                }
1720
        //                                break;
1721
        //        #endregion
1722
        //                            #region RectCloud
1723
        //                            case "RectCloudControl":
1724
        //                                using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
1725
        //                                {
1726
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1727
        //                                    RectCloudControl instance = new RectCloudControl()
1728
        //                                    {
1729
        //                                        StartPoint = s.StartPoint,
1730
        //                                        EndPoint = s.EndPoint,
1731
        //                                        LeftBottomPoint = s.LB,
1732
        //                                        Paint = s.PaintState,
1733
        //                                        Opacity = s.Opac,
1734
        //                                        TopRightPoint = s.TR,
1735
        //                                        PointSet = s.PointSet,
1736
        //                                        DashSize = s.DashSize,
1737
        //                                        StrokeColor = new SolidColorBrush(Colors.Red),
1738
        //                                        LineSize = Convert.ToDouble(data2.First()),
1739
        //                                    };
1740
        //                                    Layer.Children.Add(instance);
1741
        //                                    instance.ApplyTemplate();
1742
        //                                    CopyDataSet.Add(instance);
1743
        //                                    instance.SetRectCloud();
1744
        //                                    instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1745
        //                                }
1746
        //                                break;
1747
        //        #endregion
1748
        //                            #region ArrowText
1749
        //                            case "ArrowTextControl":
1750
        //                                using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
1751
        //                                {
1752
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1753
        //                                    ArrowTextControl instance = new ArrowTextControl();
1754
        //                                    Layer.Children.Add(instance);
1755
        //                                    instance.LineSize = Convert.ToDouble(data2.First());
1756
        //                                    instance.PointSet = s.PointSet;
1757
        //                                    instance.StartPoint = s.StartPoint;
1758
        //                                    instance.EndPoint = s.EndPoint;
1759
        //                                    instance.StrokeColor = new SolidColorBrush(Colors.Red);
1760
        //                                    instance.DashSize = s.DashSize;
1761
        //                                    instance.ArrowTextStyle = s.ArrowStyle;
1762
        //                                    instance.ArrowText = s.ArrowText;
1763
        //                                    instance.BorderSize = s.BorderSize;
1764
        //                                    instance.isFixed = s.isFixed;
1765
        //                                    instance.BoxWidth = s.BoxWidth;
1766
        //                                    instance.BoxHeight = s.BoxHeight;
1767
        //                                    instance.isHighLight = s.isHighLight;
1768
        //                                    instance.ApplyTemplate();
1769
        //                                    instance.SetArrowTextPath();
1770
        //                                    instance.isTrans = s.isTrans;
1771
        //                                    instance.MidPoint = s.MP;
1772
        //                                    instance.Angle = s.Angle;
1773
        //                                    if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
1774
        //                                    {
1775
        //                                        s.fontConfig = new List<string>();
1776
1777
        //                                        s.fontConfig.Add("Arial");
1778
        //                                        s.fontConfig.Add("Normal");
1779
        //                                        s.fontConfig.Add("Normal");
1780
        //                                        s.fontConfig.Add("30");
1781
        //                                    }
1782
        //                                    instance.TextFamily = new FontFamily(s.fontConfig[0]);
1783
        //                                    instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
1784
        //                                    instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
1785
        //                                    instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
1786
        //                                    instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1787
        //                                    CopyDataSet.Add(instance);
1788
        //                                    instance.ApplyTemplate();
1789
        //                                    instance.SetArrowTextPath();
1790
        //                                };
1791
1792
        //                                break;
1793
        //        #endregion
1794
        //                            #region Arrow_Multi
1795
        //                            case "ArrowControl_Multi":
1796
        //                                using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
1797
        //                                {
1798
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1799
        //                                    ArrowControl_Multi instance = new ArrowControl_Multi
1800
        //                                    {
1801
        //                                        LineSize = Convert.ToDouble(data2.First()),
1802
        //                                        StartPoint = s.StartPoint,
1803
        //                                        MiddlePoint = s.MP,
1804
        //                                        DashSize = s.DashSize,
1805
        //                                        EndPoint = s.EndPoint,
1806
        //                                        PointSet = s.PointSet,
1807
        //                                        StrokeColor = new SolidColorBrush(Colors.Red)
1808
        //                                    };
1809
        //                                    Layer.Children.Add(instance);
1810
        //                                    CopyDataSet.Add(instance);
1811
        //                                    instance.ApplyTemplate();
1812
        //                                    instance.SetArrowMultiPath();
1813
        //                                    instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
1814
1815
        //                                }
1816
        //                                break;
1817
        //        #endregion
1818
        //                            #region Rectangle
1819
        //                            case "RectagleControl":
1820
        //                                using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
1821
        //                                {
1822
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1823
        //                                    RectagleControl instance = new RectagleControl
1824
        //                                    {
1825
        //                                        LineSize = Convert.ToDouble(data2.First()),
1826
        //                                        Paint = s.PaintState,
1827
        //                                        StartPoint = s.StartPoint,
1828
        //                                        EndPoint = s.EndPoint,
1829
        //                                        Angle = s.Angle,
1830
        //                                        LeftBottomPoint = s.LB,
1831
        //                                        TopRightPoint = s.TR,
1832
        //                                        Opacity = s.Opac,
1833
        //                                        PointSet = s.PointSet,
1834
        //                                        DashSize = s.DashSize
1835
        //                                    };
1836
        //                                    Layer.Children.Add(instance);
1837
        //                                    CopyDataSet.Add(instance);
1838
        //                                    instance.ApplyTemplate();
1839
        //                                    instance.SetRectPath();
1840
        //                                }
1841
        //                                break;
1842
        //        #endregion
1843
        //                            #region Triangle
1844
        //                            case "TriControl":
1845
        //                                using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
1846
        //                                {
1847
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1848
        //                                    TriControl instance = new TriControl
1849
        //                                    {
1850
        //                                        LineSize = Convert.ToDouble(data2.First()),
1851
        //                                        MidPoint = s.MP,
1852
        //                                        Paint = s.Paint,
1853
        //                                        StartPoint = s.StartPoint,
1854
        //                                        EndPoint = s.EndPoint,
1855
        //                                        Angle = s.Angle,
1856
        //                                        DashSize = s.DashSize,
1857
        //                                        PointSet = s.PointSet
1858
        //                                    };
1859
        //                                    Layer.Children.Add(instance);
1860
        //                                    CopyDataSet.Add(instance);
1861
        //                                    instance.ApplyTemplate();
1862
        //                                    instance.SetTri();
1863
        //                                }
1864
        //                                break;
1865
        //        #endregion
1866
        //                            #region Cicle
1867
        //                            case "CicleControl":
1868
        //                                using (S_CicleControl s = JsonSerializerHelper.JsonDeserialize<S_CicleControl>(item))
1869
        //                                {
1870
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1871
        //                                    CicleControl instance = new CicleControl
1872
        //                                    {
1873
        //                                        LineSize = Convert.ToDouble(data2.First()),
1874
        //                                        Paint = s.PaintState,
1875
        //                                        StartPoint = s.StartPoint,
1876
        //                                        EndPoint = s.EndPoint,
1877
        //                                        LeftBottomPoint = s.LBP,
1878
        //                                        TopRightPoint = s.TRP,
1879
        //                                        Angle = s.Angle,
1880
        //                                        DashSize = s.DashSize,
1881
        //                                        PointSet = s.PointSet,
1882
        //                                    };
1883
        //                                    Layer.Children.Add(instance);
1884
        //                                    CopyDataSet.Add(instance);
1885
        //                                    instance.ApplyTemplate();
1886
        //                                    instance.SetCicle();
1887
        //                                }
1888
        //                                break;
1889
        //        #endregion
1890
        //                            #region Cloud
1891
        //                            case "CloudControl":
1892
        //                                using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
1893
        //                                {
1894
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1895
        //                                    CloudControl instance = new CloudControl
1896
        //                                    {
1897
        //                                        LineSize = Convert.ToDouble(data2.First()),
1898
        //                                        Toler = s.Toler,
1899
        //                                        PointSet = new List<Point>(),
1900
        //                                        ArcLength = s.ArcLength,
1901
        //                                        Paint = s.PaintState,
1902
        //                                        isTransOn = s.IsTrans,
1903
        //                                        DashSize = s.DashSize,
1904
        //                                        isChain = s.IsChain,
1905
        //                                        //Fill = s.CloudFill,
1906
        //                                    };
1907
1908
        //                                    Layer.Children.Add(instance);
1909
        //                                    CopyDataSet.Add(instance);
1910
        //                                    instance.ApplyTemplate();
1911
        //                                    instance.PointSet = s.pointSet;
1912
        //                                    instance.ClosePath();
1913
        //                                }
1914
        //                                break;
1915
        //        #endregion
1916
        //                            #region Line
1917
        //                            case "LineControl":
1918
        //                                using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
1919
        //                                {
1920
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1921
        //                                    LineControl instance = new LineControl()
1922
        //                                    {
1923
        //                                        LineStyle = s.LnSet,
1924
        //                                        StartPoint = s.StartPoint,
1925
        //                                        EndPoint = s.EndPoint,
1926
        //                                        DashSize = s.DashSize,
1927
        //                                        Interval = s.Interval,
1928
        //                                        PointSet = s.PointSet,
1929
        //                                        StrokeColor = new SolidColorBrush(Colors.Red),
1930
        //                                        LineSize = Convert.ToDouble(data2.First()),
1931
        //                                    };
1932
        //                                    Layer.Children.Add(instance);
1933
        //                                    CopyDataSet.Add(instance);
1934
        //                                    instance.ApplyTemplate();
1935
        //                                    instance.SetLinePath();
1936
        //                                }
1937
        //                                break;
1938
        //        #endregion
1939
        //                            #region SymbolN
1940
        //                            case "SymControlN":
1941
        //                                using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
1942
        //                                {
1943
        //                                    SymControlN instance = new SymControlN()
1944
        //                                    {
1945
        //                                        PointSet = s.PointSet,
1946
        //                                        StartPoint = s.StartPoint,
1947
        //                                        EndPoint = s.EndPoint,
1948
        //                                        Angle = s.Angle,
1949
        //                                        LeftBottomPoint = s.LB,
1950
        //                                        TopRightPoint = s.TR,
1951
        //                                        Opacity = s.Opac,
1952
        //                                        //PathXathData = s.DBData,
1953
        //                                    };
1954
        //                                    Layer.Children.Add(instance);
1955
        //                                    CopyDataSet.Add(instance);
1956
        //                                    instance.ApplyTemplate();
1957
        //                                    instance.PathXathData = JsonSerializerHelper.UnCompressString_NonPrefix(s.DBData);
1958
        //                                    object obj = XamlReader.Load(instance.PathXathData);
1959
        //                                    instance.Base_ViewBox.Child = obj as UIElement;
1960
        //                                    instance.SetViewBox();
1961
        //                                }
1962
        //                                break;
1963
        //        #endregion
1964
        //                            #region Text
1965
        //                            case "TextControl":
1966
        //                                using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
1967
        //                                {
1968
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
1969
        //                                    TextControl instance = new TextControl()
1970
        //                                    {
1971
        //                                        Text = s.Text,
1972
        //                                        StartPoint = s.StartPoint,
1973
        //                                        EndPoint = s.EndPoint,
1974
        //                                        LineSize = new Thickness(Convert.ToDouble(data2.First())),
1975
        //                                        TextSize = Convert.ToDouble(data2[1]),
1976
        //                                        FontColor = new SolidColorBrush(StringToColorConverter.Parse(s.FontColor)),
1977
        //                                        FontSize = 10,
1978
        //                                        Angle = s.Angle,
1979
        //                                        Paint = s.PaintState,
1980
        //                                        PointSet = s.PointSet,
1981
        //                                        isHighLight = s.isHighLight,
1982
        //                                        TextFamily = new FontFamily(s.fontConfig[0]),
1983
        //                                        TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
1984
        //                                        TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
1985
        //                                    };
1986
1987
        //                                    instance.SetText();
1988
        //                                    CopyDataSet.Add(instance);
1989
        //                                    Layer.Children.Add(instance);
1990
        //                                    if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
1991
        //                                    {
1992
        //                                        s.fontConfig = new List<string>();
1993
1994
        //                                        s.fontConfig.Add("Arial");
1995
        //                                        s.fontConfig.Add("Normal");
1996
        //                                        s.fontConfig.Add("Normal");
1997
        //                                        s.fontConfig.Add("30");
1998
        //                                    }
1999
        //                                    instance.TextFamily = new FontFamily(s.fontConfig[0]);
2000
        //                                    instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
2001
        //                                    instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
2002
2003
        //                                    if (s.fontConfig.Count == 3)
2004
        //                                    {
2005
        //                                        instance.TextSize = 30;
2006
        //                                    }
2007
        //                                    else
2008
        //                                    {
2009
        //                                        instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
2010
        //                                    }
2011
        //                                    instance.ApplyTemplate();
2012
        //                                    if (s.fontConfig.Count() == 4)
2013
        //                                    {
2014
        //                                        instance.UnderLine = TextDecorations.Underline;
2015
        //                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
2016
        //                                    }
2017
        //                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
2018
        //                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
2019
        //                                }
2020
        //                                break;
2021
        //        #endregion
2022
        //                            #region Arc
2023
        //                            case "ArcControl":
2024
        //                                using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
2025
        //                                {
2026
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2027
        //                                    ArcControl instance = new ArcControl()
2028
        //                                    {
2029
        //                                        StartPoint = s.StartPoint,
2030
        //                                        MidPoint = s.MP,
2031
        //                                        EndPoint = s.EndPoint,
2032
        //                                        DashSize = s.DashSize,
2033
        //                                        isTransOn = s.IsTrans,
2034
        //                                        PointSet = s.PointSet,
2035
        //                                        StrokeColor = new SolidColorBrush(Colors.Red),
2036
        //                                        LineSize = Convert.ToDouble(data2.First()),
2037
        //                                    };
2038
        //                                    Layer.Children.Add(instance);
2039
        //                                    CopyDataSet.Add(instance);
2040
        //                                    instance.ApplyTemplate();
2041
        //                                    instance.SetArcPath();
2042
        //                                }
2043
        //                                break;
2044
        //        #endregion
2045
        //                            #region Sign
2046
        //                            case "SignControl":
2047
        //                                {
2048
        //                                    using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
2049
        //                                    {
2050
        //                                        ImageSource img;
2051
2052
2053
        //                                        SignControl instance_Sign = new SignControl
2054
        //                                        {
2055
        //                                            Angle = s.Angle,
2056
        //                                            UserNumber = s.UserNumber,
2057
        //                                            StartPoint = s.StartPoint,
2058
        //                                            TopRightPoint = s.TR,
2059
        //                                            EndPoint = s.EndPoint,
2060
        //                                            LeftBottomPoint = s.LB,
2061
        //                                            PointSet = s.PointSet,
2062
        //                                        };
2063
2064
2065
        //                                        try
2066
        //                                        {
2067
        //                                            this.SignSet.TryGetValue(s.UserNumber, out img);
2068
        //                                            instance_Sign.SignImage = img;
2069
        //                                        }
2070
        //                                        catch (Exception)
2071
        //                                        {
2072
        //                                            SignUserSet.Add(instance_Sign);
2073
        //                                            this.GetSignImageLoaded(SignUserSet);
2074
        //                                        }
2075
        //                                        Layer.Children.Add(instance_Sign);
2076
        //                                        CopyDataSet.Add(instance_Sign);
2077
        //                                        instance_Sign.ApplyTemplate();
2078
        //                                        instance_Sign.SetImage();
2079
        //                                    }
2080
        //                                }
2081
        //                                break;
2082
        //        #endregion
2083
        //                            #region Date
2084
        //                            case "DateControl":
2085
        //                                {
2086
        //                                    using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
2087
        //                                    {
2088
        //                                        string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2089
        //                                        DateControl instance = new DateControl
2090
        //                                        {
2091
        //                                            Angle = s.Angle,
2092
        //                                            StartPoint = s.StartPoint,
2093
        //                                            EndPoint = s.EndPoint,
2094
        //                                            LeftBottomPoint = s.LB,
2095
        //                                            TopRightPoint = s.TR,
2096
        //                                            Opacity = s.Opac,
2097
        //                                            FontColor = new SolidColorBrush(Colors.Red),
2098
        //                                            LineSize = Convert.ToDouble(data2.First()),
2099
        //                                            Text = s.Text,
2100
        //                                            PointSet = s.PointSet,
2101
        //                                        };
2102
2103
        //                                        Layer.Children.Add(instance);
2104
        //                                        CopyDataSet.Add(instance);
2105
        //                                        instance.ApplyTemplate();
2106
        //                                        instance.SetDate();
2107
        //                                    }
2108
        //                                }
2109
        //                                break;
2110
        //        #endregion
2111
        //                            #region Symbol
2112
        //                            case "SymControl":
2113
        //                                using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
2114
        //                                {
2115
2116
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2117
        //                                    StringToPathConverter sm = new StringToPathConverter();
2118
        //                                    SymControl instance = new SymControl()
2119
        //                                    {
2120
        //                                        LineSize = Convert.ToDouble(data2.First()),
2121
        //                                        PointSet = s.PointSet,
2122
        //                                        Paint = s.PaintState,
2123
        //                                        StartPoint = s.StartPoint,
2124
        //                                        StrokeColor = new SolidColorBrush(Colors.Red),
2125
        //                                        EndPoint = s.EndPoint,
2126
        //                                        Angle = s.Angle,
2127
        //                                        LeftBottomPoint = s.LB,
2128
        //                                        TopRightPoint = s.TR,
2129
        //                                        PathData = sm.Convert(s.PathInfo.ToString()),
2130
        //                                        Opacity = s.Opac,
2131
        //                                    };
2132
        //                                    Layer.Children.Add(instance);
2133
        //                                    CopyDataSet.Add(instance);
2134
        //                                    instance.ApplyTemplate();
2135
        //                                    instance.SetSymPath();
2136
        //                                }
2137
        //                                break;
2138
        //        #endregion
2139
        //                            #region Ink
2140
        //                            case "InkPresenter":
2141
        //                                using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
2142
        //                                {
2143
        //                                    this._InkBoard.Strokes = s.SCC;
2144
        //                                }
2145
        //                                break;
2146
        //        #endregion
2147
        //                            #region Poly
2148
        //                            case "PolyControl":
2149
        //                                using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
2150
        //                                {
2151
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2152
        //                                    PolyControl instance = new PolyControl()
2153
        //                                    {
2154
        //                                        //LineSize = Convert.ToDouble(data2.First()),
2155
        //                                        LineSize = LineSize,
2156
        //                                        PointSet = s.PointSet,
2157
        //                                        PointC = s.PointC,
2158
        //                                        StartPoint = s.StartPoint,
2159
        //                                        EndPoint = s.EndPoint,
2160
        //                                        Opacity = s.Opac,
2161
        //                                    };
2162
        //                                    Layer.Children.Add(instance);
2163
        //                                    CopyDataSet.Add(instance);
2164
        //                                    instance.ApplyTemplate();
2165
        //                                    instance.SetPolyPath();
2166
        //                                };
2167
        //                                break;
2168
        //        #endregion
2169
        //                            #region Image
2170
        //                            case "ImgControl":
2171
        //                                using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
2172
        //                                {
2173
        //                                    ImgControl instance = new ImgControl
2174
        //                                    {
2175
        //                                        Angle = s.Angle,
2176
        //                                        StartPoint = s.StartPoint,
2177
        //                                        TopRightPoint = s.TR,
2178
        //                                        EndPoint = s.EndPoint,
2179
        //                                        LeftBottomPoint = s.LB,
2180
        //                                        PointSet = s.PointSet,
2181
        //                                        Opacity = s.Opac,
2182
        //                                        FilePath = s.ImagePath,
2183
        //                                    };
2184
        //                                    Layer.Children.Add(instance);
2185
        //                                    instance.ApplyTemplate();
2186
        //                                    instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
2187
        //                                    CopyDataSet.Add(instance);
2188
        //                                    instance.SetImage();
2189
        //                                }
2190
        //                                break;
2191
        //        #endregion
2192
2193
        //                            default:
2194
        //                                break;
2195
        //                        };
2196
        //                    }
2197
        //                }
2198
2199
2200
        //                foreach (var item in CopyDataSet)
2201
        //                {
2202
        //                    Layer.Children.Remove(item);
2203
        //                    af.addMemberControl(item);
2204
        //                }
2205
        //            }
2206
        //            return af;
2207
        //        } 
2208
2209
        //        public SolidColorBrush GetUserColor_KCOM(List<CommonLib.DisplayColorInfo> dc, string UserID)
2210
        //        {
2211
        //            var item = dc.Where(p => p.UserID == UserID).FirstOrDefault();
2212
        //            if (item != null)
2213
        //            {
2214
        //                return new SolidColorBrush(StringToColorConverter.Parse(item.DisplayColor));
2215
        //            }
2216
        //            else
2217
        //            {
2218
        //                return new SolidColorBrush(Colors.Red);
2219
        //            }
2220
2221
        //        }
2222
2223
        //        /// <summary>
2224
        //        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
2225
        //        /// </summary>
2226
        //        /// <param name="MarkupString"></param>
2227
        //        public void markupParsePrint(string MarkupString, Canvas Layer, string DisplayColor,List<CommonLib.DisplayColorInfo> dc,string ToolTipMessage)
2228
        //        {
2229
        //            if (MarkupString != "False")
2230
        //            {
2231
2232
        //                SolidColorBrush _SetColor = new SolidColorBrush(StringToColorConverter.Parse(DisplayColor));
2233
        //                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
2234
        //                string[] delimiterChars = { "|DZ|" };
2235
        //                string[] delimiterChars2 = { "|" };
2236
        //                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
2237
        //                List<string> dataSet = new List<string>();
2238
2239
        //                foreach (var dataPease in data)
2240
        //                {
2241
        //                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
2242
        //                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
2243
        //                    switch (unkownControl.Name)
2244
        //                    {
2245
        //                        #region Arrow
2246
        //                        case "ArrowControl":
2247
        //                            using (S_ArrowControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl>(item))
2248
        //                            {
2249
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2250
        //                                ArrowControl instance = new ArrowControl
2251
        //                                {
2252
        //                                    LineSize = Convert.ToDouble(data2.First()),
2253
        //                                    ArrowStyle = s.ArStyle,
2254
        //                                    DimSize = s.DimSize,
2255
        //                                    StartPoint = s.StartPoint,
2256
        //                                    EndPoint = s.EndPoint,
2257
        //                                    DashSize = s.DashSize,
2258
        //                                    UserID = s.UserID,
2259
        //                                    PointSet = s.PointSet,
2260
        //                                    //StrokeColor = _SetColor,
2261
        //                                    StrokeColor = GetUserColor_KCOM(dc, s.UserID),
2262
        //                                    Opacity = s.Opac,
2263
        //                                };
2264
        //#if SILVERLIGHT
2265
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2266
        //#endif
2267
2268
        //                                Layer.Children.Add(instance);
2269
        //                                instance.ApplyTemplate();
2270
        //                                instance.SetArrowPath();
2271
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
2272
2273
        //                            }
2274
        //                            break;
2275
        //                        #endregion
2276
        //                        #region ArrowText
2277
        //                        case "ArrowTextControl":
2278
        //                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
2279
        //                            {
2280
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2281
        //                                ArrowTextControl instance = new ArrowTextControl();
2282
        //                                Layer.Children.Add(instance);
2283
        //                                instance.LineSize = Convert.ToDouble(data2.First());
2284
        //                                instance.PointSet = s.PointSet;
2285
        //                                instance.StartPoint = s.StartPoint;
2286
        //                                instance.EndPoint = s.EndPoint;
2287
        //                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
2288
        //                                instance.DashSize = s.DashSize;
2289
        //                                instance.ArrowTextStyle = s.ArrowStyle;
2290
        //                                instance.isHighLight = s.isHighLight;
2291
        //                                instance.ArrowText = s.ArrowText;
2292
        //                                instance.Opacity = s.Opac;
2293
        //                                instance.BorderSize = s.BorderSize;
2294
        //                                instance.BoxWidth = s.BoxWidth;
2295
        //                                instance.BoxHeight = s.BoxHeight;
2296
        //                                instance.isFixed = s.isFixed;
2297
        //                                instance.Angle = s.Angle;
2298
        //                                instance.StrokeColor = _SetColor;
2299
        //                                instance.isTrans = s.isTrans;
2300
        //                                instance.UserID = s.UserID;
2301
        //                                instance.MidPoint = s.MP;
2302
        //                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
2303
        //                                {
2304
        //                                    s.fontConfig = new List<string>();
2305
2306
        //                                    s.fontConfig.Add("Arial");
2307
        //                                    s.fontConfig.Add("Normal");
2308
        //                                    s.fontConfig.Add("Normal");
2309
        //                                    s.fontConfig.Add("30");
2310
        //                                }
2311
        //                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
2312
        //                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
2313
        //                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
2314
        //                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
2315
        //                                instance.ApplyTemplate();
2316
        //                                instance.SetArrowTextPath();
2317
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
2318
        //                            };
2319
        //                            break;
2320
        //                        #endregion
2321
        //                        #region Arrow_Multi
2322
        //                        case "ArrowControl_Multi":
2323
        //                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
2324
        //                            {
2325
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2326
        //                                ArrowControl_Multi instance = new ArrowControl_Multi
2327
        //                                {
2328
        //                                    LineSize = Convert.ToDouble(data2.First()),
2329
        //                                    StartPoint = s.StartPoint,
2330
        //                                    MiddlePoint = s.MP,
2331
        //                                    DashSize = s.DashSize,
2332
        //                                    EndPoint = s.EndPoint,
2333
        //                                    UserID = s.UserID,
2334
        //                                    PointSet = s.PointSet,
2335
        //                                    Opacity = s.Opac,
2336
        //                                    StrokeColor = GetUserColor_KCOM(dc, s.UserID),
2337
        //                                };
2338
        //#if SILVERLIGHT
2339
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2340
        //#endif
2341
        //                                Layer.Children.Add(instance);
2342
        //                                instance.ApplyTemplate();
2343
        //                                instance.SetArrowMultiPath();
2344
        //                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
2345
2346
        //                            }
2347
        //                            break;
2348
        //                        #endregion
2349
        //                        #region Rectangle
2350
        //                        case "RectagleControl":
2351
        //                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
2352
        //                            {
2353
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2354
        //                                RectagleControl instance = new RectagleControl
2355
        //                                {
2356
        //                                    LineSize = Convert.ToDouble(data2.First()),
2357
        //                                    Paint = s.PaintState,
2358
        //                                    StartPoint = s.StartPoint,
2359
        //                                    EndPoint = s.EndPoint,
2360
        //                                    Angle = s.Angle,
2361
        //                                    UserID = s.UserID,
2362
        //                                    StrokeColor = _SetColor,
2363
        //                                    DashSize = s.DashSize,
2364
        //                                    Opacity = s.Opac,
2365
        //                                    LeftBottomPoint = s.LB,
2366
        //                                    TopRightPoint = s.TR,
2367
        //                                    PointSet = s.PointSet
2368
        //                                };
2369
        //                                if (ToolTipService.GetToolTip(instance) == null)
2370
        //                                {
2371
        //#if SILVERLIGHT
2372
        //                                    ToolTipService.SetToolTip(instance, UserNumber);
2373
        //#endif
2374
        //                                }
2375
2376
        //                                Layer.Children.Add(instance);
2377
        //                                instance.ApplyTemplate();
2378
        //                                instance.SetRectPath();
2379
        //                            }
2380
        //                            break;
2381
        //                        #endregion
2382
        //                        #region Triangle
2383
        //                        case "TriControl":
2384
        //                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
2385
        //                            {
2386
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2387
        //                                TriControl instance = new TriControl
2388
        //                                {
2389
        //                                    LineSize = Convert.ToDouble(data2.First()),
2390
        //                                    MidPoint = s.MP,
2391
        //                                    StartPoint = s.StartPoint,
2392
        //                                    Paint = s.Paint,
2393
        //                                    EndPoint = s.EndPoint,
2394
        //                                    Opacity = s.Opac,
2395
        //                                    UserID = s.UserID,
2396
        //                                    Angle = s.Angle,
2397
        //                                    DashSize = s.DashSize,
2398
        //                                    PointSet = s.PointSet,
2399
        //                                    StrokeColor = _SetColor,
2400
        //                                };
2401
        //#if SILVERLIGHT
2402
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2403
        //#endif
2404
        //                                Layer.Children.Add(instance);
2405
        //                                instance.ApplyTemplate();
2406
        //                                instance.SetTri();
2407
        //                            }
2408
        //                            break;
2409
        //                        #endregion
2410
        //                        #region Cicle
2411
        //                        case "CicleControl":
2412
        //                            using (S_CicleControl s = JsonSerializerHelper.JsonDeserialize<S_CicleControl>(item))
2413
        //                            {
2414
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2415
        //                                CicleControl instance = new CicleControl
2416
        //                                {
2417
        //                                    LineSize = Convert.ToDouble(data2.First()),
2418
        //                                    Paint = s.PaintState,
2419
        //                                    StartPoint = s.StartPoint,
2420
        //                                    EndPoint = s.EndPoint,
2421
        //                                    LeftBottomPoint = s.LBP,
2422
        //                                    TopRightPoint = s.TRP,
2423
        //                                    UserID = s.UserID,
2424
        //                                    Opacity = s.Opac,
2425
        //                                    Angle = s.Angle,
2426
        //                                    DashSize = s.DashSize,
2427
        //                                    PointSet = s.PointSet,
2428
        //                                    StrokeColor = _SetColor,
2429
        //                                };
2430
        //#if SILVERLIGHT
2431
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2432
        //#endif
2433
        //                                Layer.Children.Add(instance);
2434
        //                                instance.ApplyTemplate();
2435
        //                                instance.SetCicle();
2436
        //                            }
2437
        //                            break;
2438
        //                        #endregion
2439
        //                        #region Cloud
2440
        //                        case "CloudControl":
2441
        //                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
2442
        //                            {
2443
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2444
        //                                CloudControl instance = new CloudControl
2445
        //                                {
2446
        //                                    LineSize = Convert.ToDouble(data2.First()),
2447
        //                                    Toler = s.Toler,
2448
        //                                    PointSet = new List<Point>(),
2449
        //                                    ArcLength = s.ArcLength,
2450
        //                                    Paint = s.PaintState,
2451
        //                                    Opacity = s.Opac,
2452
        //                                    UserID = s.UserID,
2453
        //                                    StrokeColor = _SetColor,
2454
        //                                    isTransOn = s.IsTrans,
2455
        //                                    isChain = s.IsChain,
2456
        //                                    DashSize = s.DashSize,
2457
        //                                    //Fill = s.CloudFill,
2458
        //                                };
2459
        //#if SILVERLIGHT
2460
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2461
        //#endif
2462
        //                                Layer.Children.Add(instance);
2463
        //                                instance.ApplyTemplate();
2464
        //                                instance.PointSet = s.pointSet;
2465
        //                                instance.ClosePath();
2466
        //                                instance.ChangePaint(s.PaintState);
2467
        //                            }
2468
        //                            break;
2469
        //                        #endregion
2470
        //                        #region Line
2471
        //                        case "LineControl":
2472
        //                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
2473
        //                            {
2474
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2475
        //                                LineControl instance = new LineControl()
2476
        //                                {
2477
        //                                    LineStyle = s.LnSet,
2478
        //                                    StartPoint = s.StartPoint,
2479
        //                                    EndPoint = s.EndPoint,
2480
        //                                    DashSize = s.DashSize,
2481
        //                                    Interval = s.Interval,
2482
        //                                    PointSet = s.PointSet,
2483
        //                                    Opacity = s.Opac,
2484
        //                                    UserID = s.UserID,
2485
        //                                    StrokeColor = GetUserColor_KCOM(dc, s.UserID),
2486
        //                                    LineSize = Convert.ToDouble(data2.First()),
2487
        //                                };
2488
        //#if SILVERLIGHT
2489
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2490
        //#endif
2491
        //                                Layer.Children.Add(instance);
2492
        //                                instance.ApplyTemplate();
2493
        //                                instance.SetLinePath();
2494
        //                            }
2495
        //                            break;
2496
        //                        #endregion
2497
        //                        #region Text
2498
        //                        case "TextControl":
2499
        //                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
2500
        //                            {
2501
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2502
        //                                TextControl instance = new TextControl()
2503
        //                                {
2504
        //                                    Text = s.Text,
2505
        //                                    StartPoint = s.StartPoint,
2506
        //                                    EndPoint = s.EndPoint,
2507
        //                                    Paint = s.PaintState,
2508
        //                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
2509
        //                                    TextSize = Convert.ToDouble(data2[1]),
2510
        //                                    FontColor = _SetColor,
2511
        //                                    FontSize = 10,
2512
        //                                    UserID = s.UserID,
2513
        //                                    isHighLight = s.isHighLight,
2514
        //                                    Angle = s.Angle,
2515
        //                                    PointSet = s.PointSet,
2516
        //                                    Opacity = s.Opac,
2517
        //                                    TextFamily = new FontFamily(s.fontConfig[0]),
2518
        //                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
2519
        //                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
2520
        //                                };
2521
        //#if SILVERLIGHT
2522
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2523
        //#endif
2524
        //                                if (instance.Text != null)
2525
        //                                {
2526
        //                                    Layer.Children.Add(instance);
2527
        //                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
2528
        //                                    if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
2529
        //                                    {
2530
        //                                        s.fontConfig = new List<string>();
2531
2532
        //                                        s.fontConfig.Add("Arial");
2533
        //                                        s.fontConfig.Add("Normal");
2534
        //                                        s.fontConfig.Add("Normal");
2535
        //                                        s.fontConfig.Add("30");
2536
        //                                    }
2537
        //                                    instance.TextFamily = new FontFamily(s.fontConfig[0]);
2538
        //                                    instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
2539
        //                                    instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
2540
2541
        //                                    //if (s.fontConfig.Count == 3)
2542
        //                                    //{
2543
        //                                    //    instance.TextSize = 30;
2544
        //                                    //}
2545
        //                                    //else
2546
        //                                    //{
2547
        //                                    //    instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
2548
        //                                    //}
2549
        //                                    instance.ApplyTemplate();
2550
        //                                    if (s.fontConfig.Count() == 4)
2551
        //                                    {
2552
        //                                        instance.UnderLine = TextDecorations.Underline;
2553
        //                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
2554
        //                                    }
2555
        //                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
2556
        //                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
2557
2558
        //                                    instance.DrawingCloud();
2559
        //                                }
2560
        //                            }
2561
        //                            break;
2562
        //                        #endregion
2563
        //                        #region Arc
2564
        //                        case "ArcControl":
2565
        //                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
2566
        //                            {
2567
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2568
        //                                ArcControl instance = new ArcControl()
2569
        //                                {
2570
        //                                    StartPoint = s.StartPoint,
2571
        //                                    EndPoint = s.EndPoint,
2572
        //                                    DashSize = s.DashSize,
2573
        //                                    PointSet = s.PointSet,
2574
        //                                    isTransOn = s.IsTrans,
2575
        //                                    MidPoint = s.MP,
2576
        //                                    StrokeColor = _SetColor,
2577
        //                                    UserID = s.UserID,
2578
        //                                    LineSize = Convert.ToDouble(data2.First()),
2579
        //                                };
2580
        //#if SILVERLIGHT
2581
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2582
        //#endif
2583
        //                                Layer.Children.Add(instance);
2584
        //                                instance.ApplyTemplate();
2585
        //                                instance.SetArcPath();
2586
        //                            }
2587
        //                            break;
2588
        //                        #endregion
2589
        //                        #region RectCloud
2590
        //                        case "RectCloudControl":
2591
        //                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
2592
        //                            {
2593
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2594
        //                                RectCloudControl instance = new RectCloudControl()
2595
        //                                {
2596
        //                                    StartPoint = s.StartPoint,
2597
        //                                    EndPoint = s.EndPoint,
2598
        //                                    LeftBottomPoint = s.LB,
2599
        //                                    UserID = s.UserID,
2600
        //                                    Paint = s.PaintState,
2601
        //                                    Opacity = s.Opac,
2602
        //                                    DashSize = s.DashSize,
2603
        //                                    TopRightPoint = s.TR,
2604
        //                                    PointSet = s.PointSet,
2605
        //                                    StrokeColor = _SetColor,
2606
        //                                    LineSize = Convert.ToDouble(data2.First()),
2607
        //                                };
2608
        //#if SILVERLIGHT
2609
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2610
        //#endif
2611
        //                                Layer.Children.Add(instance);
2612
        //                                instance.ApplyTemplate();
2613
        //                                instance.SetRectCloud();
2614
        //                            }
2615
        //                            break;
2616
        //                        #endregion
2617
        //                        #region Sign
2618
        //                        case "SignControl":
2619
        //                            {
2620
        //                                using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
2621
        //                                {
2622
        //                                    SignControl instance = new SignControl
2623
        //                                    {
2624
        //                                        Angle = s.Angle,
2625
        //                                        UserNumber = s.UserNumber,
2626
        //                                        StartPoint = s.StartPoint,
2627
        //                                        UserID = s.UserID,
2628
        //                                        TopRightPoint = s.TR,
2629
        //                                        EndPoint = s.EndPoint,
2630
        //                                        LeftBottomPoint = s.LB,
2631
        //                                        PointSet = s.PointSet,
2632
        //                                        SignImage = null,
2633
        //                                    };
2634
        //#if SILVERLIGHT
2635
        //                                    ToolTipService.SetToolTip(instance, UserNumber);
2636
        //#endif
2637
        //#if SILVERLIGHT
2638
        //                                    SignUserSet.Add(instance);
2639
        //#endif
2640
        //                                    Layer.Children.Add(instance);
2641
        //                                    instance.ApplyTemplate();
2642
        //                                    instance.SetImage();
2643
        //                                }
2644
        //                            }
2645
        //                            break;
2646
        //                        #endregion
2647
        //                        #region Ink
2648
        //                        case "InkPresenter":
2649
        //                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
2650
        //                            {
2651
        //#if SILVERLIGHT
2652
        //                                this._InkBoard.Strokes = s.SCC;
2653
        //#endif
2654
        //                            }
2655
        //                            break;
2656
        //                        #endregion
2657
        //                        #region Date
2658
        //                        case "DateControl":
2659
        //                            {
2660
        //                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
2661
        //                                {
2662
        //                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2663
        //                                    DateControl instance = new DateControl
2664
        //                                    {
2665
        //                                        Angle = s.Angle,
2666
        //                                        StartPoint = s.StartPoint,
2667
        //                                        UserID = s.UserID,
2668
        //                                        EndPoint = s.EndPoint,
2669
        //                                        LeftBottomPoint = s.LB,
2670
        //                                        TopRightPoint = s.TR,
2671
        //                                        Opacity = s.Opac,
2672
        //                                        FontColor = _SetColor,
2673
        //                                        LineSize = Convert.ToDouble(data2.First()),
2674
        //                                        Text = s.Text,
2675
        //                                        PointSet = s.PointSet,
2676
        //                                    };
2677
        //#if SILVERLIGHT
2678
        //                                    ToolTipService.SetToolTip(instance, UserNumber);
2679
        //#endif
2680
        //                                    Layer.Children.Add(instance);
2681
        //                                    instance.ApplyTemplate();
2682
        //                                    instance.SetDate();
2683
        //                                }
2684
        //                            }
2685
        //                            break;
2686
        //                        #endregion
2687
        //                        #region Symbol
2688
        //                        case "SymControl":
2689
        //                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
2690
        //                            {
2691
        //                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2692
        //                                StringToPathConverter sm = new StringToPathConverter();
2693
        //                                SymControl instance = new SymControl()
2694
        //                                {
2695
        //                                    LineSize = Convert.ToDouble(data2.First()),
2696
        //                                    PointSet = s.PointSet,
2697
        //                                    Paint = s.PaintState,
2698
        //                                    StartPoint = s.StartPoint,
2699
        //                                    StrokeColor = _SetColor,
2700
        //                                    EndPoint = s.EndPoint,
2701
        //                                    Angle = s.Angle,
2702
        //                                    UserID = s.UserID,
2703
        //                                    LeftBottomPoint = s.LB,
2704
        //                                    TopRightPoint = s.TR,
2705
        //                                    PathData = sm.Convert(s.PathInfo.ToString()),
2706
        //                                    Opacity = s.Opac,
2707
        //                                };
2708
        //                                //if (ToolTipService.GetToolTip(instance).ToString() == "")
2709
        //                                //{
2710
        //#if SILVERLIGHT
2711
        //                                ToolTipService.SetToolTip(instance, UserNumber);
2712
        //#endif
2713
        //                                //} //조장원
2714
        //                                Layer.Children.Add(instance);
2715
        //                                instance.ApplyTemplate();
2716
        //                                instance.SetSymPath();
2717
        //                            }
2718
        //                            break;
2719
        //                        #endregion
2720
        //                        #region Image
2721
        //                        case "ImgControl":
2722
        //                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
2723
        //                            {
2724
        //                                ImgControl instance = new ImgControl
2725
        //                                {
2726
        //                                    Angle = s.Angle,
2727
        //                                    StartPoint = s.StartPoint,
2728
        //                                    TopRightPoint = s.TR,
2729
        //                                    EndPoint = s.EndPoint,
2730
        //                                    LeftBottomPoint = s.LB,
2731
        //                                    PointSet = s.PointSet,
2732
        //                                    Opacity = s.Opac,
2733
        //                                    UserID = s.UserID,
2734
        //                                    FilePath = s.ImagePath,
2735
        //                                };
2736
        //                                Layer.Children.Add(instance);
2737
        //                                instance.ApplyTemplate();
2738
2739
        //                                instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
2740
        //                                instance.SetImage();
2741
        //                                //                                if (ToolTipService.GetToolTip(instance).ToString() == "")
2742
        //                                //                                {
2743
        //                                //#if SILVERLIGHT
2744
        //                                //                                    ToolTipService.SetToolTip(instance, UserNumber);
2745
        //                                //#endif
2746
        //                                //                                }
2747
        //                            }
2748
        //                            break;
2749
        //                        #endregion
2750
        //                        #region SymbolN
2751
        //                        case "SymControlN":
2752
        //                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
2753
        //                            {
2754
        //                                SymControlN instance = new SymControlN()
2755
        //                                {
2756
        //                                    PointSet = s.PointSet,
2757
        //                                    StartPoint = s.StartPoint,
2758
        //                                    EndPoint = s.EndPoint,
2759
        //                                    Angle = s.Angle,
2760
        //                                    LeftBottomPoint = s.LB,
2761
        //                                    TopRightPoint = s.TR,
2762
        //                                    Opacity = s.Opac,
2763
        //                                    UserID = s.UserID,
2764
        //                                    //PathXathData = s.DBData,
2765
        //                                };
2766
2767
        //                                //if (ToolTipService.GetToolTip(instance).ToString() == "")
2768
        //                                //{
2769
        //#if SILVERLIGHT
2770
        //                                //ToolTipService.SetToolTip(instance, UserNumber);
2771
        //#endif
2772
        //                                //}
2773
        //                                Layer.Children.Add(instance);
2774
        //                                instance.ApplyTemplate();
2775
        //#if SILVERLIGHT
2776
2777
        //                                instance.PathXathData = JsonSerializerHelper.UnCompressString_NonPrefix(s.DBData);
2778
        //                                object obj = XamlReader.Load(JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData));
2779
        //                                //object obj = XamlReader.Load(instance.PathXathData);
2780
        //                                instance.Base_ViewBox.Child = obj as UIElement;
2781
        //#else
2782
        //                                MemoryStream memoryStream = new MemoryStream(Convert.FromBase64String(instance.PathXathData));
2783
        //                                object obj = XamlReader.Load(memoryStream);
2784
        //#endif
2785
        //                                instance.SetViewBox();
2786
        //                            }
2787
        //                            break;
2788
        //                        #endregion
2789
        //                        default:
2790
        //                            break;
2791
        //                    };
2792
        //                }
2793
        //            }
2794
        //#if SILVERLIGHT
2795
        //            this.GetSignImageLoaded(SignUserSet);
2796
        //#endif
2797
        //        } 
2798
        #endregion
2799
2800
2801
        public string markupParse_GetMemo(string MarkupString)
2802
        {
2803
            var item = JsonSerializerHelper.UnCompressString(MarkupString); //언패킹작업
2804
            var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
2805
            return unknownData.Memo;
2806
        }
2807 b200de5a KangIngu
2808 787a4489 KangIngu
        //프린트
2809
        public void markupParse(string MarkupString, Canvas Layer, string DisplayColor, string ToolTipMessage)
2810
        {
2811
            if (MarkupString != "False")
2812
            {
2813
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
2814
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
2815
                string[] delimiterChars = { "|DZ|" };
2816
                string[] delimiterChars2 = { "|" };
2817
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
2818
                List<string> dataSet = new List<string>();
2819
2820
                foreach (var dataPease in data)
2821
                {
2822
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
2823
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
2824
                    switch (unkownControl.Name)
2825
                    {
2826
                        #region Shape
2827
                        #region Rectangle
2828
                        case "RectangleControl":
2829
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
2830
                            {
2831
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2832
                                RectangleControl instance = new RectangleControl
2833
                                {
2834
                                    LineSize = Convert.ToDouble(data2.First()),
2835
                                    Paint = s.PaintState,
2836
                                    StartPoint = s.StartPoint,
2837
                                    EndPoint = s.EndPoint,
2838
                                    Angle = s.Angle,
2839
                                    StrokeColor = _SetColor,
2840
                                    DashSize = s.DashSize,
2841
                                    Opacity = s.Opac,
2842
                                    LeftBottomPoint = s.LB,
2843
                                    TopRightPoint = s.TR,
2844
                                    PointSet = s.PointSet,
2845
                                    UserID = s.UserID
2846
                                };
2847
2848
                                Layer.Children.Add(instance);
2849
                                instance.ApplyTemplate();
2850
                                instance.SetRectPath();
2851
                            }
2852
                            break;
2853
                        #endregion
2854
                        #region Triangle
2855
                        case "TriControl":
2856
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
2857
                            {
2858
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2859
                                TriControl instance = new TriControl
2860
                                {
2861
                                    LineSize = Convert.ToDouble(data2.First()),
2862
                                    MidPoint = s.MidPoint,
2863
                                    StartPoint = s.StartPoint,
2864
                                    Paint = s.Paint,
2865
                                    EndPoint = s.EndPoint,
2866
                                    Opacity = s.Opac,
2867
                                    Angle = s.Angle,
2868
                                    DashSize = s.DashSize,
2869
                                    PointSet = s.PointSet,
2870
                                    StrokeColor = _SetColor,
2871
                                    UserID = s.UserID,
2872
                                };
2873
2874
                                Layer.Children.Add(instance);
2875
                                instance.ApplyTemplate();
2876
                                instance.SetTri();
2877
                            }
2878
                            break;
2879
                        #endregion
2880
                        #region Cicle
2881
                        case "CircleControl":
2882
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
2883
                            {
2884
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2885
                                CircleControl instance = new CircleControl
2886
                                {
2887
                                    LineSize = Convert.ToDouble(data2.First()),
2888
                                    Paint = s.PaintState,
2889
                                    StartPoint = s.StartPoint,
2890
                                    EndPoint = s.EndPoint,
2891
                                    LeftBottomPoint = s.LBP,
2892
                                    TopRightPoint = s.TRP,
2893
                                    Opacity = s.Opac,
2894
                                    Angle = s.Angle,
2895
                                    DashSize = s.DashSize,
2896
                                    PointSet = s.PointSet,
2897
                                    StrokeColor = _SetColor,
2898
                                    UserID = s.UserID,
2899
                                };
2900
2901
                                Layer.Children.Add(instance);
2902
                                instance.ApplyTemplate();
2903
                                instance.SetCircle();
2904
                            }
2905
                            break;
2906
                        #endregion
2907
                        #region RectCloud
2908
                        case "RectCloudControl":
2909
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
2910
                            {
2911
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2912
                                RectCloudControl instance = new RectCloudControl()
2913
                                {
2914
                                    StartPoint = s.StartPoint,
2915
                                    EndPoint = s.EndPoint,
2916
                                    LeftBottomPoint = s.LB,
2917
                                    Paint = s.PaintState,
2918
                                    Opacity = s.Opac,
2919
                                    DashSize = s.DashSize,
2920
                                    TopRightPoint = s.TR,
2921
                                    PointSet = s.PointSet,
2922
                                    StrokeColor = _SetColor,
2923
                                    LineSize = Convert.ToDouble(data2.First()),
2924 53393bae KangIngu
                                    ArcLength = s.ArcLength,
2925 787a4489 KangIngu
                                    UserID = s.UserID
2926
                                };
2927
2928
                                Layer.Children.Add(instance);
2929
                                instance.ApplyTemplate();
2930
                                instance.SetRectCloud();
2931
                            }
2932
                            break;
2933
                        #endregion
2934
                        #endregion
2935
2936
                        #region Polygon
2937
                        #region Poly
2938
                        case "PolygonControl":
2939
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
2940
                            {
2941
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2942
                                PolygonControl instance = new PolygonControl
2943
                                {
2944
                                    LineSize = Convert.ToDouble(data2.First()),
2945
                                    //Toler = s.Toler,
2946
                                    IsCompleted = s.IsCompleted,
2947
                                    //PointSet = new List<Point>(),
2948
                                    Opacity = s.Opac,
2949
                                    StrokeColor = _SetColor,
2950
                                    StartPoint = s.StartPoint,
2951
                                    EndPoint = s.EndPoint,
2952
                                    PointSet = s.PointSet,
2953
                                    UserID = s.UserID,
2954
                                    DashSize = s.DashSize,
2955
                                    Paint = s.PaintState,
2956
                                    //강인구 추가(Chain인지 Polygon인지 구분)
2957
                                    ControlType = s.Type,
2958
                                    //PointC = s.PointC,
2959
                                };
2960
                                Layer.Children.Add(instance);
2961
2962
                                instance.ApplyTemplate();
2963
                                instance.SetPolyPath();
2964
2965
                                //instance.PointSet = s.PointSet;
2966
                                //instance.ClosePath();
2967
                                //instance.ChangePaint(s.PaintState);
2968
                            }
2969
                            break;
2970
                        #endregion
2971
                        #region InkControl
2972
                        case "InkControl":
2973
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
2974
                            {
2975
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
2976
                                InkControl instance = new InkControl
2977
                                {
2978
                                    LineSize = Convert.ToDouble(data2.First()),
2979
                                    //Toler = s.Toler,
2980
                                    IsCompleted = s.IsCompleted,
2981
                                    //PointSet = new List<Point>(),
2982
                                    Opacity = s.Opac,
2983
                                    StrokeColor = _SetColor,
2984
                                    StartPoint = s.StartPoint,
2985
                                    EndPoint = s.EndPoint,
2986
                                    PointSet = s.PointSet,
2987
                                    UserID = s.UserID,
2988
                                    DashSize = s.DashSize,
2989
                                    Paint = s.PaintState,
2990
                                    //강인구 추가(Chain인지 Polygon인지 구분)
2991
                                    ControlType = s.Type,
2992
                                    //PointC = s.PointC,
2993
                                };
2994
                                Layer.Children.Add(instance);
2995
2996
                                instance.ApplyTemplate();
2997
                                instance.SetPolyPath();
2998
2999
                                //instance.PointSet = s.PointSet;
3000
                                //instance.ClosePath();
3001
                                //instance.ChangePaint(s.PaintState);
3002
                            }
3003
                            break;
3004
                        #endregion
3005
                        #region Cloud
3006
                        case "CloudControl":
3007
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
3008
                            {
3009
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3010
                                CloudControl instance = new CloudControl
3011
                                {
3012
                                    LineSize = Convert.ToDouble(data2.First()),
3013
                                    Toler = s.Toler,
3014
                                    PointSet = new List<Point>(),
3015
                                    ArcLength = s.ArcLength,
3016
                                    Paint = s.PaintState,
3017
                                    Opacity = s.Opac,
3018
                                    StrokeColor = _SetColor,
3019
                                    isTransOn = s.IsTrans,
3020
                                    isChain = s.IsChain,
3021
                                    DashSize = s.DashSize,
3022
                                    UserID = s.UserID,
3023
                                    StartPoint = s.StartPoint,
3024
                                    EndPoint = s.EndPoint,
3025
                                    //Fill = s.CloudFill,
3026
                                };
3027
                                Layer.Children.Add(instance);
3028
                                instance.pointSet = s.PointSet;
3029 f633b10b KangIngu
                                instance.PointSet = s.PointSet;
3030 787a4489 KangIngu
                                instance.ApplyTemplate();
3031
                                instance.ClosePath();
3032
                                instance.ChangePaint(s.PaintState);
3033
                            }
3034
                            break;
3035
                        #endregion
3036
                        #endregion
3037
3038
                        #region Line
3039
                        #region Line
3040
                        case "LineControl":
3041
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
3042
                            {
3043
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3044
                                LineControl instance = new LineControl()
3045
                                {
3046
                                    LineStyleSet = s.LineStyleSet,
3047
                                    StartPoint = s.StartPoint,
3048
                                    DimSize = s.DimSize,
3049
                                    EndPoint = s.EndPoint,
3050
                                    DashSize = s.DashSize,
3051
                                    Interval = s.Interval,
3052
                                    PointSet = s.PointSet,
3053
                                    Opacity = s.Opac,
3054
                                    StrokeColor = _SetColor,
3055
                                    UserID = s.UserID,
3056
                                    LineSize = Convert.ToDouble(data2.First()),
3057
                                };
3058
                                Layer.Children.Add(instance);
3059
                                instance.ApplyTemplate();
3060
                                instance.SetLinePath();
3061
                            }
3062
                            break;
3063
                        #endregion
3064
                        #region Arrow_Multi
3065
                        case "ArrowControl_Multi":
3066
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
3067
                            {
3068
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3069
                                ArrowControl_Multi instance = new ArrowControl_Multi
3070
                                {
3071
                                    LineSize = Convert.ToDouble(data2.First()),
3072
                                    StartPoint = s.StartPoint,
3073
                                    MiddlePoint = s.MidPoint,
3074
                                    DashSize = s.DashSize,
3075
                                    EndPoint = s.EndPoint,
3076
                                    PointSet = s.PointSet,
3077
                                    Opacity = s.Opac,
3078
                                    StrokeColor = _SetColor,
3079
                                    UserID = s.UserID
3080
                                };
3081
3082
                                Layer.Children.Add(instance);
3083
                                instance.ApplyTemplate();
3084
                                instance.SetArrowMultiPath();
3085
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3086
3087
                            }
3088
                            break;
3089
                        #endregion
3090
                        #region Arc
3091
                        case "ArcControl":
3092
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
3093
                            {
3094
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3095
                                ArcControl instance = new ArcControl()
3096
                                {
3097
                                    StartPoint = s.StartPoint,
3098
                                    EndPoint = s.EndPoint,
3099
                                    DashSize = s.DashSize,
3100
                                    PointSet = s.PointSet,
3101
                                    isTransOn = s.IsTransOn,
3102
                                    MidPoint = s.MidPoint,
3103
                                    StrokeColor = _SetColor,
3104
                                    Opacity = s.Opac,
3105
                                    Clock = s.Clock,
3106
                                    LineSize = Convert.ToDouble(data2.First()),
3107
                                    UserID = s.UserID,
3108
                                };
3109
3110
                                Layer.Children.Add(instance);
3111
                                instance.ApplyTemplate();
3112
                                instance.SetArcPath();
3113
                            }
3114
                            break;
3115
                        #endregion
3116 40b3ce25 ljiyeon
                        #region ArrowArc
3117
                        case "ArrowArcControl":
3118
                            using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item))
3119
                            {
3120
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3121
                                ArrowArcControl instance = new ArrowArcControl()
3122
                                {
3123
                                    StartPoint = s.StartPoint,
3124
                                    EndPoint = s.EndPoint,
3125
                                    DashSize = s.DashSize,
3126
                                    PointSet = s.PointSet,
3127
                                    isTransOn = s.IsTransOn,
3128
                                    MidPoint = s.MidPoint,
3129
                                    StrokeColor = _SetColor,
3130
                                    Opacity = s.Opac,
3131
                                    Clock = s.Clock,
3132
                                    LineSize = Convert.ToDouble(data2.First()),
3133
                                    UserID = s.UserID,
3134
                                };
3135 787a4489 KangIngu
3136 40b3ce25 ljiyeon
                                Layer.Children.Add(instance);
3137
                                instance.ApplyTemplate();
3138
                                instance.SetArcPath();
3139
                            }
3140
                            break;
3141
                        #endregion
3142
                        #endregion
3143 787a4489 KangIngu
                        #region Text
3144
                        case "TextControl":
3145
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
3146
                            {
3147
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3148
                                TextControl instance = new TextControl()
3149
                                {
3150
                                    Text = s.Text,
3151
                                    StartPoint = s.StartPoint,
3152
                                    EndPoint = s.EndPoint,
3153
                                    CanvasX = s.StartPoint.X,
3154
                                    CanvasY = s.StartPoint.Y,
3155
                                    BoxWidth = s.BoxW,
3156
                                    BoxHeight = s.BoxH,
3157
                                    ControlType_No = s.paintMethod,
3158
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
3159
                                    TextSize = Convert.ToDouble(data2[1]),
3160
                                    FontColor = _SetColor,
3161
                                    FontSize = 10,
3162
                                    UserID = s.UserID,
3163
                                    //isHighLight = s.isHighLight,
3164
                                    Angle = s.Angle,
3165
                                    PointSet = s.PointSet,
3166
                                    Opacity = s.Opac,
3167
                                    TextFamily = new FontFamily(s.fontConfig[0]),
3168 d4b0c723 KangIngu
                                    //인구 추가(2018.04.17)
3169
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
3170
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
3171 787a4489 KangIngu
                                };
3172
3173
                                if (instance.Text != null)
3174
                                {
3175
                                    Layer.Children.Add(instance);
3176
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
3177
                                    instance.ApplyTemplate();
3178
                                    if (s.fontConfig.Count() == 4)
3179
                                    {
3180
                                        instance.UnderLine = TextDecorations.Underline;
3181
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
3182
                                    }
3183
                                    instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
3184
3185
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3186
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3187
                                    instance.DrawingCloud();
3188
                                    instance.SetText();
3189
                                }
3190
                            }
3191
                            break;
3192
                        #endregion
3193
3194
                        #region ArrowText
3195
                        case "ArrowTextControl":
3196
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
3197
                            {
3198 f8769f8a ljiyeon
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3199 787a4489 KangIngu
                                ArrowTextControl instance = new ArrowTextControl();
3200
                                Layer.Children.Add(instance);
3201 f8769f8a ljiyeon
                                instance.LineSize = Convert.ToDouble(data2.First());
3202 787a4489 KangIngu
                                instance.PointSet = s.PointSet;
3203
                                instance.StartPoint = s.StartPoint;
3204
                                instance.EndPoint = s.EndPoint;
3205
                                instance.StrokeColor = _SetColor;
3206
                                //instance.DashSize = s.DashSize;
3207
                                instance.ArrowTextStyle = s.ArrowStyle;
3208
                                instance.isHighLight = s.isHighLight;
3209
                                instance.ArrowText = s.ArrowText;
3210
                                instance.Opacity = s.Opac;
3211
                                instance.BorderSize = s.BorderSize;
3212
                                instance.BoxWidth = s.BoxWidth;
3213
                                instance.BoxHeight = s.BoxHeight;
3214
                                instance.isFixed = s.isFixed;
3215
                                instance.Angle = s.Angle;
3216
                                instance.UserID = s.UserID;
3217
                                instance.isTrans = s.isTrans;
3218
                                instance.MidPoint = s.MidPoint;
3219
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
3220
                                {
3221
                                    s.fontConfig = new List<string>();
3222
3223
                                    s.fontConfig.Add("Arial");
3224
                                    s.fontConfig.Add("Normal");
3225
                                    s.fontConfig.Add("Normal");
3226
                                    s.fontConfig.Add("30");
3227
                                }
3228
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
3229 d4b0c723 KangIngu
                                //인구 추가(2018.04.17)
3230
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
3231
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
3232 787a4489 KangIngu
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
3233 e17af42b KangIngu
3234 787a4489 KangIngu
                                instance.ApplyTemplate();
3235 e17af42b KangIngu
3236
                                if (s.fontConfig.Count() == 5)
3237
                                {
3238
                                    instance.UnderLine = TextDecorations.Underline;
3239
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
3240
                                }
3241 787a4489 KangIngu
                                instance.SetArrowTextPath();
3242 e17af42b KangIngu
3243 787a4489 KangIngu
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3244
                            };
3245
                            break;
3246
                        #endregion
3247
3248
                        #region Date
3249
                        case "DateControl":
3250
                            {
3251
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
3252
                                {
3253
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3254
                                    DateControl instance = new DateControl
3255
                                    {
3256
                                        Angle = s.Angle,
3257
                                        StartPoint = s.StartPoint,
3258
                                        EndPoint = s.EndPoint,
3259
                                        LeftBottomPoint = s.LB,
3260
                                        TopRightPoint = s.TR,
3261
                                        Opacity = s.Opac,
3262
                                        FontColor = _SetColor,
3263
                                        LineSize = Convert.ToDouble(data2.First()),
3264
                                        Text = s.Text,
3265
                                        PointSet = s.PointSet,
3266
                                        UserID = s.UserID
3267
                                    };
3268
3269
                                    Layer.Children.Add(instance);
3270
                                    instance.ApplyTemplate();
3271
                                    instance.SetDate();
3272
                                }
3273
                            }
3274
                            break;
3275
                        #endregion
3276
3277
                        #region Image
3278
                        case "ImgControl":
3279
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
3280
                            {
3281
                                Image img = new Image();
3282 53880c83 ljiyeon
                                //img.Source = new BitmapImage(new Uri(s.ImagePath));
3283
                                if (s.ImagePath.Contains(".svg"))
3284
                                {
3285
                                    byte[] imageData = null;
3286
                                    DrawingImage image = null;
3287
                                    using (System.Net.WebClient web = new System.Net.WebClient())
3288
                                    {
3289
                                        imageData = web.DownloadData(new Uri(s.ImagePath));
3290
                                        System.IO.Stream stream = new System.IO.MemoryStream(imageData);
3291
                                        image = SvgReader.Load(stream);
3292
                                    }
3293
                                    img.Source = image;
3294
                                }
3295
                                else
3296
                                {
3297
                                    img.Source = new BitmapImage(new Uri(s.ImagePath));
3298
                                }
3299 787a4489 KangIngu
3300
                                ImgControl instance = new ImgControl
3301
                                {
3302
                                    Angle = s.Angle,
3303
                                    StartPoint = s.StartPoint,
3304
                                    TopRightPoint = s.TR,
3305
                                    EndPoint = s.EndPoint,
3306
                                    LeftBottomPoint = s.LB,
3307
                                    PointSet = s.PointSet,
3308
                                    Opacity = s.Opac,
3309
                                    FilePath = s.ImagePath,
3310
                                    UserID = s.UserID,
3311
                                    ImageData = img.Source
3312
                                };
3313
                                Layer.Children.Add(instance);
3314
                                instance.ApplyTemplate();
3315 53880c83 ljiyeon
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3316
                                instance.ImageData = img.Source;
3317 787a4489 KangIngu
                                instance.SetImage();
3318
                            }
3319
                            break;
3320
                        #endregion
3321
3322
                        #region Symbol
3323
                        case "SymControl":
3324
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
3325
                            {
3326
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3327
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
3328
                                SymControl instance = new SymControl()
3329
                                {
3330
                                    LineSize = Convert.ToDouble(data2.First()),
3331
                                    PointSet = s.PointSet,
3332
                                    Paint = s.PaintState,
3333
                                    StartPoint = s.StartPoint,
3334
                                    StrokeColor = _SetColor,
3335
                                    EndPoint = s.EndPoint,
3336
                                    Angle = s.Angle,
3337
                                    LeftBottomPoint = s.LB,
3338
                                    TopRightPoint = s.TR,
3339
                                    PathData = sm.Convert(s.PathInfo.ToString()),
3340
                                    Opacity = s.Opac,
3341
                                };
3342
                                instance.Memo = s.Memo;
3343
                                Layer.Children.Add(instance);
3344
                                instance.ApplyTemplate();
3345
                                instance.SetSymPath();
3346
                            }
3347
                            break;
3348
                        #endregion
3349
3350
                        #region SymbolN
3351
                        case "SymControlN":
3352
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
3353
                            {
3354
                                SymControlN instance = new SymControlN()
3355
                                {
3356
                                    PointSet = s.PointSet,
3357
                                    StartPoint = s.StartPoint,
3358
                                    EndPoint = s.EndPoint,
3359
                                    Angle = s.Angle,
3360
                                    LeftBottomPoint = s.LB,
3361
                                    TopRightPoint = s.TR,
3362
                                    Opacity = s.Opac,
3363
                                    PathXathData = s.DBData,
3364
                                };
3365
3366
                                instance.Memo = s.Memo;
3367
                                Layer.Children.Add(instance);
3368
                                instance.ApplyTemplate();
3369
3370
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3371
                                //instance.PathXathData = s.DBData;
3372
3373 b200de5a KangIngu
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
3374
                                //xamlData = xamlData.Replace("daelim", "DAELIM");
3375
                                //System.IO.MemoryStream stream = new System.IO.MemoryStream();
3376
                                //System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
3377
                                //writer.Write(xamlData);
3378
                                //writer.Flush();
3379
                                //stream.Position = 0;
3380
3381
                                //object obj = XamlReader.Load(stream);
3382
                                //instance.Base_ViewBox.Child = obj as UIElement;
3383
                                //instance.PathXathData = appovalData;
3384
                                //instance.SetViewBox();
3385 787a4489 KangIngu
                            }
3386
                            break;
3387
                        #endregion
3388
3389
                        #region Sign
3390
                        case "SignControl":
3391
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
3392
                            {
3393
                                SignControl instance = new SignControl
3394
                                {
3395
                                    Angle = s.Angle,
3396
                                    StartPoint = s.StartPoint,
3397
                                    TopRightPoint = s.TR,
3398
                                    EndPoint = s.EndPoint,
3399
                                    LeftBottomPoint = s.LB,
3400
                                    PointSet = s.PointSet,
3401
                                    Opacity = s.Opac,
3402
                                    SignImage = null,
3403
                                    UserID = s.UserID,
3404
                                };
3405
                                instance.ApplyTemplate();
3406
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3407
3408
                                if (s.UserNumber != null)
3409
                                {
3410
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
3411
                                    if (_sign != null)
3412
                                    {
3413
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
3414
3415
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
3416
                                        stream.Write(imageBytes, 0, imageBytes.Length);
3417
                                        stream.Position = 0;
3418
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
3419
                                        BitmapImage returnImage = new BitmapImage();
3420
                                        returnImage.BeginInit();
3421
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
3422
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
3423
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
3424
                                        returnImage.StreamSource = ms;
3425
                                        returnImage.EndInit();
3426
                                        stream.Close();
3427
                                        instance.SignImage = returnImage;
3428
                                    }
3429
                                }
3430
3431
3432
                                instance.Memo = s.Memo;
3433
                                Layer.Children.Add(instance);
3434
                                instance.ApplyTemplate();
3435
                                instance.SetImage();
3436
                            }
3437
                            break;
3438
                        #endregion
3439
3440
3441
3442
                        default:
3443
                            break;
3444
                    };
3445
                }
3446
            }
3447
        }
3448
3449
        /// <summary>
3450
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
3451
        /// </summary>
3452
        /// <param name="MarkupString"></param>
3453
        public void markupParse(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID)
3454
        {
3455
            if (MarkupString != "False")
3456
            {
3457
                //GetUserSign getUser = new GetUserSign();
3458
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
3459
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
3460
                string[] delimiterChars = { "|DZ|" };
3461
                string[] delimiterChars2 = { "|" };
3462
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
3463
                List<string> dataSet = new List<string>();
3464
3465
                foreach (var dataPease in data)
3466
                {
3467
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
3468
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
3469
                    switch (unkownControl.Name)
3470
                    {
3471
                        #region ArrowText
3472
                        case "ArrowTextControl":
3473
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
3474
                            {
3475 f8769f8a ljiyeon
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3476 787a4489 KangIngu
                                ArrowTextControl instance = new ArrowTextControl();
3477
                                instance.MarkupInfoID = markupInfoID;
3478
                                //Layer.Children.Add(instance);
3479
                                baseLayer.Add(instance);
3480 f8769f8a ljiyeon
                                instance.LineSize = Convert.ToDouble(data2.First());
3481 787a4489 KangIngu
                                instance.PointSet = s.PointSet;
3482
                                instance.StartPoint = s.StartPoint;
3483
                                instance.EndPoint = s.EndPoint;
3484
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
3485
                                //instance.DashSize = s.DashSize;
3486
                                instance.ArrowTextStyle = s.ArrowStyle;
3487
                                instance.isHighLight = s.isHighLight;
3488
                                instance.ArrowText = s.ArrowText;
3489
                                instance.Opacity = s.Opac;
3490
                                instance.BorderSize = s.BorderSize;
3491
                                instance.BoxWidth = s.BoxWidth;
3492
                                instance.BoxHeight = s.BoxHeight;
3493
                                instance.isFixed = s.isFixed;
3494
                                instance.Angle = s.Angle;
3495
                                instance.UserID = s.UserID;
3496
                                instance.StrokeColor = _SetColor;
3497
                                instance.isTrans = s.isTrans;
3498
                                instance.MidPoint = s.MidPoint;
3499
                                instance.Memo = s.Memo;
3500
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
3501
                                {
3502
                                    s.fontConfig = new List<string>();
3503
3504
                                    s.fontConfig.Add("Arial");
3505
                                    s.fontConfig.Add("Normal");
3506
                                    s.fontConfig.Add("Normal");
3507
                                    s.fontConfig.Add("30");
3508
                                }
3509
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
3510 d4b0c723 KangIngu
                                //인구 추가(2018.04.17)
3511
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
3512
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
3513 787a4489 KangIngu
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
3514
                                instance.ApplyTemplate();
3515 e17af42b KangIngu
3516
                                if (s.fontConfig.Count() == 5)
3517
                                {
3518
                                    instance.UnderLine = TextDecorations.Underline;
3519
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
3520
                                }
3521 787a4489 KangIngu
                                instance.SetArrowTextPath();
3522
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3523
                            };
3524
                            break;
3525
                        #endregion
3526
                        #region Arrow_Multi
3527
                        case "ArrowControl_Multi":
3528
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
3529
                            {
3530
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3531
                                ArrowControl_Multi instance = new ArrowControl_Multi
3532
                                {
3533
                                    LineSize = Convert.ToDouble(data2.First()),
3534
                                    StartPoint = s.StartPoint,
3535
                                    MiddlePoint = s.MidPoint,
3536
                                    DashSize = s.DashSize,
3537
                                    EndPoint = s.EndPoint,
3538
                                    PointSet = s.PointSet,
3539
                                    Opacity = s.Opac,
3540
                                    StrokeColor = _SetColor,
3541
                                    UserID = s.UserID
3542
                                };
3543
3544
                                //Layer.Children.Add(instance);
3545
                                instance.MarkupInfoID = markupInfoID;
3546
                                baseLayer.Add(instance);
3547
                                instance.ApplyTemplate();
3548
                                instance.SetArrowMultiPath();
3549
                                instance.Memo = s.Memo;
3550
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3551
3552
                            }
3553
                            break;
3554
                        #endregion
3555
                        #region Rectangle
3556
                        case "RectangleControl":
3557
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
3558
                            {
3559
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3560
                                RectangleControl instance = new RectangleControl
3561
                                {
3562
                                    LineSize = Convert.ToDouble(data2.First()),
3563
                                    Paint = s.PaintState,
3564
                                    StartPoint = s.StartPoint,
3565
                                    EndPoint = s.EndPoint,
3566
                                    Angle = s.Angle,
3567
                                    StrokeColor = _SetColor,
3568
                                    DashSize = s.DashSize,
3569
                                    Opacity = s.Opac,
3570
                                    LeftBottomPoint = s.LB,
3571
                                    TopRightPoint = s.TR,
3572
                                    PointSet = s.PointSet,
3573
                                    UserID = s.UserID
3574
                                };
3575
3576
                                instance.Memo = s.Memo;
3577
                                //Layer.Children.Add(instance);
3578
                                instance.MarkupInfoID = markupInfoID;
3579
                                baseLayer.Add(instance);
3580
                                instance.ApplyTemplate();
3581
                                instance.SetRectPath();
3582
                            }
3583
                            break;
3584
                        #endregion
3585
                        #region Triangle
3586
                        case "TriControl":
3587
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
3588
                            {
3589
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3590
                                TriControl instance = new TriControl
3591
                                {
3592
                                    LineSize = Convert.ToDouble(data2.First()),
3593
                                    MidPoint = s.MidPoint,
3594
                                    StartPoint = s.StartPoint,
3595
                                    Paint = s.Paint,
3596
                                    EndPoint = s.EndPoint,
3597
                                    Opacity = s.Opac,
3598
                                    Angle = s.Angle,
3599
                                    DashSize = s.DashSize,
3600
                                    PointSet = s.PointSet,
3601
                                    StrokeColor = _SetColor,
3602
                                    UserID = s.UserID,
3603
                                };
3604
                                instance.Memo = s.Memo;
3605
                                //Layer.Children.Add(instance);
3606
                                instance.MarkupInfoID = markupInfoID;
3607
                                baseLayer.Add(instance);
3608
                                instance.ApplyTemplate();
3609
                                instance.SetTri();
3610
                            }
3611
                            break;
3612
                        #endregion
3613
                        #region Cicle
3614
                        case "CircleControl":
3615
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
3616
                            {
3617
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3618
                                CircleControl instance = new CircleControl
3619
                                {
3620
                                    LineSize = Convert.ToDouble(data2.First()),
3621
                                    Paint = s.PaintState,
3622
                                    StartPoint = s.StartPoint,
3623
                                    EndPoint = s.EndPoint,
3624
                                    LeftBottomPoint = s.LBP,
3625
                                    TopRightPoint = s.TRP,
3626
                                    Opacity = s.Opac,
3627
                                    Angle = s.Angle,
3628
                                    DashSize = s.DashSize,
3629
                                    PointSet = s.PointSet,
3630
                                    StrokeColor = _SetColor,
3631
                                    UserID = s.UserID,
3632
                                };
3633
                                instance.Memo = s.Memo;
3634
                                //Layer.Children.Add(instance);
3635
                                instance.MarkupInfoID = markupInfoID;
3636
                                baseLayer.Add(instance);
3637
                                instance.ApplyTemplate();
3638
                                instance.SetCircle();
3639
                            }
3640
                            break;
3641
                        #endregion
3642
                        #region Poly
3643
                        case "PolygonControl":
3644
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
3645
                            {
3646
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3647
                                PolygonControl instance = new PolygonControl
3648
                                {
3649
                                    LineSize = Convert.ToDouble(data2.First()),
3650
                                    //Toler = s.Toler,
3651
                                    IsCompleted = s.IsCompleted,
3652
                                    //PointSet = new List<Point>(),
3653
                                    Opacity = s.Opac,
3654
                                    StrokeColor = _SetColor,
3655
                                    DashSize = s.DashSize,
3656
                                    StartPoint = s.StartPoint,
3657
                                    EndPoint = s.EndPoint,
3658
                                    PointSet = s.PointSet,
3659
                                    UserID = s.UserID,
3660
                                    //강인구 추가(Chain인지 Polygon인지 구분)
3661
                                    ControlType = s.Type,
3662
                                    Paint = s.PaintState,
3663
                                    //PointC = s.PointC,
3664
                                };
3665
                                //Layer.Children.Add(instance);
3666
                                instance.MarkupInfoID = markupInfoID;
3667
                                baseLayer.Add(instance);
3668
                                instance.Memo = s.Memo;
3669
                                instance.ApplyTemplate();
3670
                                instance.SetPolyPath();
3671
3672
                                //instance.PointSet = s.PointSet;
3673
                                //instance.ClosePath();
3674
                                //instance.ChangePaint(s.PaintState);
3675
                            }
3676
                            break;
3677
                        #endregion
3678
                        #region InkControl
3679
                        case "InkControl":
3680
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
3681
                            {
3682
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3683
                                InkControl instance = new InkControl
3684
                                {
3685
                                    LineSize = Convert.ToDouble(data2.First()),
3686
                                    //Toler = s.Toler,
3687
                                    IsCompleted = s.IsCompleted,
3688
                                    //PointSet = new List<Point>(),
3689
                                    Opacity = s.Opac,
3690
                                    StrokeColor = _SetColor,
3691
                                    DashSize = s.DashSize,
3692
                                    StartPoint = s.StartPoint,
3693
                                    PointSet = s.PointSet,
3694
                                    UserID = s.UserID,
3695
                                    //강인구 추가(Chain인지 Polygon인지 구분)
3696
                                    ControlType = s.Type,
3697
                                    Paint = s.PaintState,
3698
                                    EndPoint = s.EndPoint,
3699
                                    //PointC = s.PointC,
3700
                                };
3701
                                //Layer.Children.Add(instance);
3702
                                instance.MarkupInfoID = markupInfoID;
3703
                                baseLayer.Add(instance);
3704
                                instance.Memo = s.Memo;
3705
                                instance.ApplyTemplate();
3706
                                instance.SetPolyPath();
3707
3708
                                //instance.PointSet = s.PointSet;
3709
                                //instance.ClosePath();
3710
                                //instance.ChangePaint(s.PaintState);
3711
                            }
3712
                            break;
3713
                        #endregion
3714
                        #region Cloud
3715
                        case "CloudControl":
3716
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
3717
                            {
3718
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3719
                                CloudControl instance = new CloudControl
3720
                                {
3721
                                    LineSize = Convert.ToDouble(data2.First()),
3722
                                    Toler = s.Toler,
3723
                                    PointSet = new List<Point>(),
3724
                                    ArcLength = s.ArcLength,
3725
                                    Paint = s.PaintState,
3726
                                    Opacity = s.Opac,
3727
                                    StrokeColor = _SetColor,
3728
                                    isTransOn = s.IsTrans,
3729
                                    isChain = s.IsChain,
3730
                                    DashSize = s.DashSize,
3731
                                    UserID = s.UserID,
3732
                                    StartPoint = s.StartPoint,
3733
                                    EndPoint = s.EndPoint,
3734
                                    //Fill = s.CloudFill,
3735
                                };
3736
                                instance.Memo = s.Memo;
3737
                                //Layer.Children.Add(instance);
3738
                                instance.MarkupInfoID = markupInfoID;
3739
                                baseLayer.Add(instance);
3740
                                instance.PointSet = s.PointSet;
3741
                                instance.ApplyTemplate();
3742
                                instance.ClosePath();
3743
                                instance.ChangePaint(s.PaintState);
3744
                            }
3745
                            break;
3746
                        #endregion
3747
                        #region Line
3748
                        case "LineControl":
3749
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
3750
                            {
3751
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3752
                                LineControl instance = new LineControl()
3753
                                {
3754
                                    LineStyleSet = s.LineStyleSet,
3755
                                    StartPoint = s.StartPoint,
3756
                                    DimSize = s.DimSize,
3757
                                    EndPoint = s.EndPoint,
3758
                                    DashSize = s.DashSize,
3759
                                    Interval = s.Interval,
3760
                                    PointSet = s.PointSet,
3761
                                    Opacity = s.Opac,
3762
                                    StrokeColor = _SetColor,
3763
                                    UserID = s.UserID,
3764
                                    LineSize = Convert.ToDouble(data2.First()),
3765
                                };
3766
                                instance.Memo = s.Memo;
3767
                                //Layer.Children.Add(instance);
3768
                                instance.MarkupInfoID = markupInfoID;
3769
                                baseLayer.Add(instance);
3770
                                instance.ApplyTemplate();
3771
                                instance.SetLinePath();
3772
                            }
3773
                            break;
3774
                        #endregion
3775
                        #region Text
3776
                        case "TextControl":
3777
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
3778
                            {
3779
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3780
                                TextControl instance = new TextControl()
3781
                                {
3782
                                    Text = s.Text,
3783
                                    StartPoint = s.StartPoint,
3784
                                    EndPoint = s.EndPoint,
3785
                                    CanvasX = s.StartPoint.X,
3786
                                    CanvasY = s.StartPoint.Y,
3787
                                    BoxWidth = s.BoxW,
3788
                                    BoxHeight = s.BoxH,
3789
                                    ControlType_No = s.paintMethod,
3790
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
3791
                                    TextSize = Convert.ToDouble(data2[1]),
3792
                                    FontColor = _SetColor,
3793
                                    FontSize = 10,
3794
                                    UserID = s.UserID,
3795
                                    //isHighLight = s.isHighLight,
3796
                                    Angle = s.Angle,
3797
                                    PointSet = s.PointSet,
3798
                                    Opacity = s.Opac,
3799
                                    TextFamily = new FontFamily(s.fontConfig[0]),
3800 d4b0c723 KangIngu
                                    //인구 추가(2018.04.17)
3801
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
3802
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
3803 787a4489 KangIngu
                                };
3804
3805
                                if (instance.Text != null)
3806
                                {
3807
                                    //Layer.Children.Add(instance);
3808
                                    instance.MarkupInfoID = markupInfoID;
3809
                                    baseLayer.Add(instance);
3810
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
3811
                                    instance.ApplyTemplate();
3812
                                    instance.Memo = s.Memo;
3813
                                    if (s.fontConfig.Count() == 4)
3814
                                    {
3815
                                        instance.UnderLine = TextDecorations.Underline;
3816
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
3817
                                    }
3818 b200de5a KangIngu
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
3819 787a4489 KangIngu
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
3820
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
3821
                                    instance.DrawingCloud();
3822
                                    instance.SetText();
3823
                                }
3824
                            }
3825
                            break;
3826
                        #endregion
3827
                        #region Arc
3828
                        case "ArcControl":
3829
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
3830
                            {
3831
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3832
                                ArcControl instance = new ArcControl()
3833
                                {
3834
                                    StartPoint = s.StartPoint,
3835
                                    EndPoint = s.EndPoint,
3836
                                    DashSize = s.DashSize,
3837
                                    PointSet = s.PointSet,
3838
                                    isTransOn = s.IsTransOn,
3839
                                    MidPoint = s.MidPoint,
3840
                                    StrokeColor = _SetColor,
3841
                                    Clock = s.Clock,
3842
                                    Opacity = s.Opac,
3843
                                    LineSize = Convert.ToDouble(data2.First()),
3844
                                    UserID = s.UserID,
3845
                                };
3846
                                instance.Memo = s.Memo;
3847
                                //Layer.Children.Add(instance);
3848
                                instance.MarkupInfoID = markupInfoID;
3849
                                baseLayer.Add(instance);
3850
                                instance.ApplyTemplate();
3851
                                instance.SetArcPath();
3852
                            }
3853
                            break;
3854
                        #endregion
3855 40b3ce25 ljiyeon
                        #region ArrowArc
3856
                        case "ArrowArcControl":
3857
                            using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item))
3858
                            {
3859
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3860
                                ArrowArcControl instance = new ArrowArcControl()
3861
                                {
3862
                                    StartPoint = s.StartPoint,
3863
                                    EndPoint = s.EndPoint,
3864
                                    DashSize = s.DashSize,
3865
                                    PointSet = s.PointSet,
3866
                                    isTransOn = s.IsTransOn,
3867
                                    MidPoint = s.MidPoint,
3868
                                    StrokeColor = _SetColor,
3869
                                    Clock = s.Clock,
3870
                                    Opacity = s.Opac,
3871
                                    LineSize = Convert.ToDouble(data2.First()),
3872
                                    UserID = s.UserID,
3873
                                };
3874
                                instance.Memo = s.Memo;
3875
                                //Layer.Children.Add(instance);
3876
                                instance.MarkupInfoID = markupInfoID;
3877
                                baseLayer.Add(instance);
3878
                                instance.ApplyTemplate();
3879
                                instance.SetArcPath();
3880
                            }
3881
                            break;
3882
                        #endregion                        
3883 787a4489 KangIngu
                        #region RectCloud
3884
                        case "RectCloudControl":
3885
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
3886
                            {
3887
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3888
                                RectCloudControl instance = new RectCloudControl()
3889
                                {
3890
                                    StartPoint = s.StartPoint,
3891
                                    EndPoint = s.EndPoint,
3892
                                    LeftBottomPoint = s.LB,
3893
                                    Paint = s.PaintState,
3894
                                    Opacity = s.Opac,
3895
                                    DashSize = s.DashSize,
3896
                                    TopRightPoint = s.TR,
3897
                                    PointSet = s.PointSet,
3898
                                    StrokeColor = _SetColor,
3899 53393bae KangIngu
                                    ArcLength = s.ArcLength,
3900 787a4489 KangIngu
                                    LineSize = Convert.ToDouble(data2.First()),
3901
                                    UserID = s.UserID
3902
                                };
3903
                                instance.Memo = s.Memo;
3904
                                //Layer.Children.Add(instance);
3905
                                instance.MarkupInfoID = markupInfoID;
3906
                                baseLayer.Add(instance);
3907
                                instance.ApplyTemplate();
3908
                                instance.SetRectCloud();
3909
                            }
3910
                            break;
3911
                        #endregion
3912
                        #region Sign
3913
                        case "SignControl":
3914
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
3915
                            {
3916
                                SignControl instance = new SignControl
3917
                                {
3918
                                    Angle = s.Angle,
3919
                                    StartPoint = s.StartPoint,
3920
                                    TopRightPoint = s.TR,
3921
                                    EndPoint = s.EndPoint,
3922
                                    LeftBottomPoint = s.LB,
3923
                                    PointSet = s.PointSet,
3924
                                    Opacity = s.Opac,
3925
                                    SignImage = null,
3926
                                    UserID = s.UserID,
3927
                                };
3928
                                instance.ApplyTemplate();
3929
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
3930
3931
                                if (s.UserNumber != null)
3932
                                {
3933
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
3934
                                    if (_sign != null)
3935
                                    {
3936
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
3937
3938
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
3939
                                        stream.Write(imageBytes, 0, imageBytes.Length);
3940
                                        stream.Position = 0;
3941
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
3942
                                        BitmapImage returnImage = new BitmapImage();
3943
                                        returnImage.BeginInit();
3944
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
3945
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
3946
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
3947
                                        returnImage.StreamSource = ms;
3948
                                        returnImage.EndInit();
3949
                                        stream.Close();
3950
                                        instance.SignImage = returnImage;
3951
                                    }
3952
                                }
3953
3954
                                instance.Memo = s.Memo;
3955
                                //Layer.Children.Add(instance);
3956
                                instance.MarkupInfoID = markupInfoID;
3957
                                baseLayer.Add(instance);
3958
                                instance.ApplyTemplate();
3959
                                instance.SetImage();
3960
3961
                                //baseLayer.Add(instance);
3962
                                //instance.ApplyTemplate();
3963
                                //instance.SetImage();
3964
                                //return_control = instance;
3965
                            }
3966
                            break;
3967
                        #endregion
3968
                        #region Ink
3969
                        case "InkPresenter":
3970
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
3971
                            {
3972
#if SILVERLIGHT
3973
                                this._InkBoard.Strokes = s.SCC; 
3974
#endif
3975
                            }
3976
                            break;
3977
                        #endregion
3978
                        #region Date
3979
                        case "DateControl":
3980
                            {
3981
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
3982
                                {
3983
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
3984
                                    DateControl instance = new DateControl
3985
                                    {
3986
                                        Angle = s.Angle,
3987
                                        StartPoint = s.StartPoint,
3988
                                        EndPoint = s.EndPoint,
3989
                                        LeftBottomPoint = s.LB,
3990
                                        TopRightPoint = s.TR,
3991
                                        Opacity = s.Opac,
3992
                                        FontColor = _SetColor,
3993
                                        LineSize = Convert.ToDouble(data2.First()),
3994
                                        Text = s.Text,
3995
                                        PointSet = s.PointSet,
3996
                                        UserID = s.UserID
3997
                                    };
3998
                                    instance.Memo = s.Memo;
3999
                                    instance.MarkupInfoID = markupInfoID;
4000
                                    //Layer.Children.Add(instance);
4001
                                    baseLayer.Add(instance);
4002
                                    instance.ApplyTemplate();
4003
                                    instance.SetDate();
4004
                                }
4005
                            }
4006
                            break;
4007
                        #endregion
4008
                        #region Symbol
4009 edecde99 djkim
                        case "SymControl":
4010
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
4011
                            {
4012
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4013
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
4014
                                SymControl instance = new SymControl()
4015
                                {
4016
                                    LineSize = Convert.ToDouble(data2.First()),
4017
                                    PointSet = s.PointSet,
4018
                                    Paint = s.PaintState,
4019
                                    StartPoint = s.StartPoint,
4020
                                    StrokeColor = _SetColor,
4021
                                    EndPoint = s.EndPoint,
4022
                                    Angle = s.Angle,
4023
                                    LeftBottomPoint = s.LB,
4024
                                    TopRightPoint = s.TR,
4025
                                    PathData = sm.Convert(s.PathInfo.ToString()),
4026
                                    Opacity = s.Opac,
4027
                                };
4028
4029
                                instance.Memo = s.Memo;
4030 4538d5e7 ljiyeon
                                instance.MarkupInfoID = markupInfoID;
4031 edecde99 djkim
                                baseLayer.Add(instance);                                
4032
                                instance.ApplyTemplate();
4033
                                instance.SetSymPath();
4034
                            }
4035
                            break;
4036 787a4489 KangIngu
                        #endregion
4037
                        #region Image
4038
                        case "ImgControl":
4039
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
4040
                            {
4041
                                Image img = new Image();
4042 53880c83 ljiyeon
                                //img.Source = new BitmapImage(new Uri(s.ImagePath));
4043
                                if (s.ImagePath.Contains(".svg"))
4044
                                {
4045
                                    byte[] imageData = null;
4046
                                    DrawingImage image = null;
4047
                                    using (System.Net.WebClient web = new System.Net.WebClient())
4048
                                    {
4049
                                        imageData = web.DownloadData(new Uri(s.ImagePath));
4050
                                        System.IO.Stream stream = new System.IO.MemoryStream(imageData);
4051
                                        image = SvgReader.Load(stream);
4052
                                    }
4053
                                    img.Source = image;
4054
                                }
4055
                                else
4056
                                {
4057
                                    img.Source = new BitmapImage(new Uri(s.ImagePath));
4058
                                }
4059 787a4489 KangIngu
4060
                                ImgControl instance = new ImgControl
4061
                                {
4062
                                    Angle = s.Angle,
4063
                                    StartPoint = s.StartPoint,
4064
                                    TopRightPoint = s.TR,
4065
                                    EndPoint = s.EndPoint,
4066
                                    LeftBottomPoint = s.LB,
4067
                                    PointSet = s.PointSet,
4068
                                    Opacity = s.Opac,
4069
                                    FilePath = s.ImagePath,
4070
                                    UserID = s.UserID,
4071
                                    ImageData = img.Source
4072
                                };
4073
                                //Layer.Children.Add(instance);
4074
                                instance.Memo = s.Memo;
4075 4538d5e7 ljiyeon
                                
4076 787a4489 KangIngu
                                instance.MarkupInfoID = markupInfoID;
4077 4538d5e7 ljiyeon
                                baseLayer.Add(instance);
4078 787a4489 KangIngu
                                instance.ApplyTemplate();
4079 53880c83 ljiyeon
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4080
                                instance.ImageData = img.Source;
4081 787a4489 KangIngu
                                instance.SetImage();
4082
4083
                            }
4084
                            break;
4085
                        #endregion
4086
                        #region SymbolN
4087
                        case "SymControlN":
4088
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
4089
                            {
4090
                                SymControlN instance = new SymControlN()
4091
                                {
4092
                                    PointSet = s.PointSet,
4093
                                    StartPoint = s.StartPoint,
4094
                                    EndPoint = s.EndPoint,
4095
                                    Angle = s.Angle,
4096
                                    LeftBottomPoint = s.LB,
4097
                                    TopRightPoint = s.TR,
4098
                                    Opacity = s.Opac,
4099
                                    PathXathData = s.DBData,
4100
                                };
4101
                                instance.Memo = s.Memo;
4102
                                instance.MarkupInfoID = markupInfoID;
4103 a7296e35 djkim
                                baseLayer.Add(instance);                                
4104 787a4489 KangIngu
                                instance.ApplyTemplate();
4105
4106 a7296e35 djkim
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData);
4107
                                xamlData = xamlData.Replace("daelim", "DAELIM");
4108
                                xamlData = xamlData.Replace("#FFFF0000", DisplayColor);
4109
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
4110
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
4111
                                writer.Write(xamlData);
4112
                                writer.Flush();
4113
                                stream.Position = 0;
4114 b200de5a KangIngu
4115 a7296e35 djkim
                                object obj = XamlReader.Load(stream);
4116
                                instance.Base_ViewBox.Child = obj as UIElement;
4117
                                instance.SetViewBox();
4118 787a4489 KangIngu
                            }
4119
                            break;
4120
                        #endregion
4121
                        default:
4122
                            break;
4123
                    };
4124
                }
4125
            }
4126
        }
4127
4128
4129
        /// <summary>
4130
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
4131
        /// </summary>
4132
        /// <param name="MarkupString"></param>
4133
        public void markupParseEx(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId)
4134
        {
4135
            if (MarkupString != "False")
4136
            {
4137
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
4138
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
4139
                string[] delimiterChars = { "|DZ|" };
4140
                string[] delimiterChars2 = { "|" };
4141
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
4142
                List<string> dataSet = new List<string>();
4143
4144
                foreach (var dataPease in data)
4145
                {
4146
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
4147
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
4148
                    switch (unkownControl.Name)
4149
                    {
4150
                        #region ArrowText
4151
                        case "ArrowTextControl":
4152
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
4153
                            {
4154
                                ////string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4155
                                //ArrowTextControl instance = new ArrowTextControl();
4156
                                //instance.MarkupInfoID = markupInfoID;
4157
                                ////Layer.Children.Add(instance);
4158
                                //baseLayer.Add(instance);
4159
                                ////instance.LineSize = Convert.ToDouble(data2.First());
4160
                                //instance.PointSet = s.PointSet;
4161
                                //instance.StartPoint = s.StartPoint;
4162
                                //instance.EndPoint = s.EndPoint;
4163
                                //instance.StrokeColor = new SolidColorBrush(Colors.Red);
4164
                                ////instance.DashSize = s.DashSize;
4165
                                //instance.ArrowTextStyle = s.ArrowStyle;
4166
                                //instance.isHighLight = s.isHighLight;
4167
                                //instance.ArrowText = s.ArrowText;
4168
                                //instance.Opacity = s.Opac;
4169
                                //instance.BorderSize = s.BorderSize;
4170
                                //instance.BoxWidth = s.BoxWidth;
4171
                                //instance.BoxHeight = s.BoxHeight;
4172
                                //instance.isFixed = s.isFixed;
4173
                                //instance.Angle = s.Angle;
4174
                                //instance.UserID = s.UserID;
4175
                                //instance.StrokeColor = _SetColor;
4176
                                //instance.isTrans = s.isTrans;
4177
                                //instance.MidPoint = s.MidPoint;
4178
                                //instance.Memo = s.Memo;
4179
                                //if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
4180
                                //{
4181
                                //    s.fontConfig = new List<string>();
4182
4183
                                //    s.fontConfig.Add("Arial");
4184
                                //    s.fontConfig.Add("Normal");
4185
                                //    s.fontConfig.Add("Normal");
4186
                                //    s.fontConfig.Add("30");
4187
                                //}
4188
                                //instance.TextFamily = new FontFamily(s.fontConfig[0]);
4189
                                ////instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
4190
                                ////instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
4191
                                //instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
4192
                                //instance.ApplyTemplate();
4193
                                //instance.SetArrowTextPath();
4194
                                //instance.CommentID = commentId;
4195
                                ////instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
4196
4197
4198
                                #region 신규
4199 f8769f8a ljiyeon
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4200 787a4489 KangIngu
                                ArrowTextControl instance = new ArrowTextControl();
4201
                                instance.MarkupInfoID = markupInfoID;
4202
                                //Layer.Children.Add(instance);
4203
                                baseLayer.Add(instance);
4204
                                instance.ApplyTemplate();
4205 f8769f8a ljiyeon
                                instance.LineSize = Convert.ToDouble(data2.First());
4206 787a4489 KangIngu
                                instance.PointSet = s.PointSet;
4207
                                instance.StartPoint = s.StartPoint;
4208
                                instance.EndPoint = s.EndPoint;
4209
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
4210
                                //instance.DashSize = s.DashSize;
4211
                                instance.ArrowTextStyle = s.ArrowStyle;
4212
                                instance.isHighLight = s.isHighLight;
4213
                                instance.ArrowText = s.ArrowText;
4214
                                instance.Opacity = s.Opac;
4215
                                instance.BorderSize = s.BorderSize;
4216
                                instance.BoxWidth = s.BoxWidth;
4217
                                instance.BoxHeight = s.BoxHeight;
4218
                                instance.isFixed = s.isFixed;
4219
                                instance.Angle = s.Angle;
4220
                                instance.UserID = s.UserID;
4221
                                instance.StrokeColor = _SetColor;
4222
                                instance.isTrans = s.isTrans;
4223
                                instance.MidPoint = s.MidPoint;
4224
                                instance.Memo = s.Memo;
4225
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
4226
                                {
4227
                                    s.fontConfig = new List<string>();
4228
4229
                                    s.fontConfig.Add("Arial");
4230
                                    s.fontConfig.Add("Normal");
4231
                                    s.fontConfig.Add("Normal");
4232
                                    s.fontConfig.Add("30");
4233
                                }
4234
4235
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
4236 d4b0c723 KangIngu
                                //인구 추가(2018.04.17)
4237
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
4238
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
4239 787a4489 KangIngu
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
4240 b200de5a KangIngu
4241 e17af42b KangIngu
                                if (s.fontConfig.Count() == 5)
4242
                                {
4243
                                    instance.UnderLine = TextDecorations.Underline;
4244
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
4245
                                }
4246
4247 787a4489 KangIngu
                                instance.SetArrowTextPath();
4248
                                instance.Base_TextBox.IsHitTestVisible = false;
4249
                                instance.CommentID = commentId;
4250
                                #endregion
4251
4252
4253
                            };
4254
                            break;
4255
                        #endregion
4256
                        #region Arrow_Multi
4257
                        case "ArrowControl_Multi":
4258
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
4259
                            {
4260
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4261
                                ArrowControl_Multi instance = new ArrowControl_Multi
4262
                                {
4263
                                    LineSize = Convert.ToDouble(data2.First()),
4264
                                    StartPoint = s.StartPoint,
4265
                                    MiddlePoint = s.MidPoint,
4266
                                    DashSize = s.DashSize,
4267
                                    EndPoint = s.EndPoint,
4268
                                    PointSet = s.PointSet,
4269
                                    Opacity = s.Opac,
4270
                                    StrokeColor = _SetColor,
4271
                                    UserID = s.UserID
4272
                                };
4273
4274
                                //Layer.Children.Add(instance);
4275 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
4276 787a4489 KangIngu
                                instance.MarkupInfoID = markupInfoID;
4277
                                baseLayer.Add(instance);
4278
                                instance.ApplyTemplate();
4279
                                instance.SetArrowMultiPath();
4280 4538d5e7 ljiyeon
                                instance.Memo = s.Memo;                                
4281 787a4489 KangIngu
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
4282
4283
                            }
4284
                            break;
4285
                        #endregion
4286
                        #region Rectangle
4287
                        case "RectangleControl":
4288
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
4289
                            {
4290
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4291
                                RectangleControl instance = new RectangleControl
4292
                                {
4293
                                    LineSize = Convert.ToDouble(data2.First()),
4294
                                    Paint = s.PaintState,
4295
                                    StartPoint = s.StartPoint,
4296
                                    EndPoint = s.EndPoint,
4297
                                    Angle = s.Angle,
4298
                                    StrokeColor = _SetColor,
4299
                                    DashSize = s.DashSize,
4300
                                    Opacity = s.Opac,
4301
                                    LeftBottomPoint = s.LB,
4302
                                    TopRightPoint = s.TR,
4303
                                    PointSet = s.PointSet,
4304
                                    UserID = s.UserID
4305
                                };
4306
4307
                                instance.Memo = s.Memo;
4308
                                //Layer.Children.Add(instance);
4309
                                instance.CommentID = commentId;
4310
                                instance.MarkupInfoID = markupInfoID;
4311
                                baseLayer.Add(instance);
4312
                                instance.ApplyTemplate();
4313
                                instance.SetRectPath();
4314
                            }
4315
                            break;
4316
                        #endregion
4317
                        #region Triangle
4318
                        case "TriControl":
4319
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
4320
                            {
4321
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4322
                                TriControl instance = new TriControl
4323
                                {
4324
                                    LineSize = Convert.ToDouble(data2.First()),
4325
                                    MidPoint = s.MidPoint,
4326
                                    StartPoint = s.StartPoint,
4327
                                    Paint = s.Paint,
4328
                                    EndPoint = s.EndPoint,
4329
                                    Opacity = s.Opac,
4330
                                    Angle = s.Angle,
4331
                                    DashSize = s.DashSize,
4332
                                    PointSet = s.PointSet,
4333
                                    StrokeColor = _SetColor,
4334
                                    UserID = s.UserID,
4335
                                };
4336
                                instance.Memo = s.Memo;
4337
                                //Layer.Children.Add(instance);
4338
                                instance.CommentID = commentId;
4339
                                instance.MarkupInfoID = markupInfoID;
4340
                                baseLayer.Add(instance);
4341
                                instance.ApplyTemplate();
4342
                                instance.SetTri();
4343
                            }
4344
                            break;
4345
                        #endregion
4346
                        #region Cicle
4347
                        case "CircleControl":
4348
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
4349
                            {
4350
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4351
                                CircleControl instance = new CircleControl
4352
                                {
4353
                                    LineSize = Convert.ToDouble(data2.First()),
4354
                                    Paint = s.PaintState,
4355
                                    StartPoint = s.StartPoint,
4356
                                    EndPoint = s.EndPoint,
4357
                                    LeftBottomPoint = s.LBP,
4358
                                    TopRightPoint = s.TRP,
4359
                                    Opacity = s.Opac,
4360
                                    Angle = s.Angle,
4361
                                    DashSize = s.DashSize,
4362
                                    PointSet = s.PointSet,
4363
                                    StrokeColor = _SetColor,
4364
                                    UserID = s.UserID,
4365
                                };
4366
                                instance.Memo = s.Memo;
4367
                                //Layer.Children.Add(instance);
4368
                                instance.CommentID = commentId;
4369
                                instance.MarkupInfoID = markupInfoID;
4370
                                baseLayer.Add(instance);
4371
                                instance.ApplyTemplate();
4372
                                instance.SetCircle();
4373
                            }
4374
                            break;
4375
                        #endregion
4376
                        #region Poly
4377
                        case "PolygonControl":
4378
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4379
                            {
4380
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4381
                                PolygonControl instance = new PolygonControl
4382
                                {
4383
                                    LineSize = Convert.ToDouble(data2.First()),
4384
                                    //Toler = s.Toler,
4385
                                    IsCompleted = s.IsCompleted,
4386
                                    //PointSet = new List<Point>(),
4387
                                    Opacity = s.Opac,
4388
                                    StrokeColor = _SetColor,
4389
                                    StartPoint = s.StartPoint,
4390
                                    PointSet = s.PointSet,
4391
                                    EndPoint = s.EndPoint,
4392
                                    UserID = s.UserID,
4393
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4394
                                    ControlType = s.Type,
4395
                                    DashSize = s.DashSize,
4396
                                    Paint = s.PaintState,
4397
                                    //PointC = s.PointC,
4398
                                };
4399
                                //Layer.Children.Add(instance);
4400 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
4401 787a4489 KangIngu
                                instance.MarkupInfoID = markupInfoID;
4402
                                baseLayer.Add(instance);
4403 4538d5e7 ljiyeon
                                
4404 787a4489 KangIngu
                                instance.Memo = s.Memo;
4405
                                instance.ApplyTemplate();
4406
                                instance.SetPolyPath();
4407
4408
                                //instance.PointSet = s.PointSet;
4409
                                //instance.ClosePath();
4410
                                //instance.ChangePaint(s.PaintState);
4411
                            }
4412
                            break;
4413
                        #endregion
4414
                        #region InkControl
4415
                        case "InkControl":
4416
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
4417
                            {
4418
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4419
                                InkControl instance = new InkControl
4420
                                {
4421
                                    LineSize = Convert.ToDouble(data2.First()),
4422
                                    //Toler = s.Toler,
4423
                                    IsCompleted = s.IsCompleted,
4424
                                    //PointSet = new List<Point>(),
4425
                                    Opacity = s.Opac,
4426
                                    StrokeColor = _SetColor,
4427
                                    StartPoint = s.StartPoint,
4428
                                    PointSet = s.PointSet,
4429
                                    UserID = s.UserID,
4430
                                    EndPoint = s.EndPoint,
4431
                                    //강인구 추가(Chain인지 Polygon인지 구분)
4432
                                    ControlType = s.Type,
4433
                                    DashSize = s.DashSize,
4434
                                    Paint = s.PaintState,
4435
                                    //PointC = s.PointC,
4436
                                };
4437
                                //Layer.Children.Add(instance);
4438 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
4439 787a4489 KangIngu
                                instance.MarkupInfoID = markupInfoID;
4440
                                baseLayer.Add(instance);
4441 4538d5e7 ljiyeon
                                
4442 787a4489 KangIngu
                                instance.Memo = s.Memo;
4443
                                instance.ApplyTemplate();
4444
                                instance.SetPolyPath();
4445
4446
                                //instance.PointSet = s.PointSet;
4447
                                //instance.ClosePath();
4448
                                //instance.ChangePaint(s.PaintState);
4449
                            }
4450
                            break;
4451
                        #endregion
4452
                        #region Cloud
4453
                        case "CloudControl":
4454
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
4455
                            {
4456
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4457
                                CloudControl instance = new CloudControl
4458
                                {
4459
                                    LineSize = Convert.ToDouble(data2.First()),
4460
                                    Toler = s.Toler,
4461
                                    PointSet = new List<Point>(),
4462
                                    ArcLength = s.ArcLength,
4463
                                    Paint = s.PaintState,
4464
                                    Opacity = s.Opac,
4465
                                    StrokeColor = _SetColor,
4466
                                    isTransOn = s.IsTrans,
4467
                                    isChain = s.IsChain,
4468
                                    DashSize = s.DashSize,
4469
                                    UserID = s.UserID,
4470
                                    StartPoint = s.StartPoint,
4471
                                    EndPoint = s.EndPoint,
4472
                                    //Fill = s.CloudFill,
4473
                                };
4474
                                instance.Memo = s.Memo;
4475
                                //Layer.Children.Add(instance);
4476 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
4477 787a4489 KangIngu
                                instance.MarkupInfoID = markupInfoID;
4478 b200de5a KangIngu
                                baseLayer.Add(instance);
4479 4538d5e7 ljiyeon
                                
4480 787a4489 KangIngu
                                instance.PointSet = s.PointSet;
4481
                                instance.ApplyTemplate();
4482
                                instance.ClosePath();
4483
                                instance.ChangePaint(s.PaintState);
4484
                            }
4485
                            break;
4486
                        #endregion
4487
                        #region Line
4488
                        case "LineControl":
4489
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
4490
                            {
4491
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4492
                                LineControl instance = new LineControl()
4493
                                {
4494
                                    LineStyleSet = s.LineStyleSet,
4495
                                    StartPoint = s.StartPoint,
4496
                                    DimSize = s.DimSize,
4497
                                    EndPoint = s.EndPoint,
4498
                                    DashSize = s.DashSize,
4499
                                    Interval = s.Interval,
4500
                                    PointSet = s.PointSet,
4501
                                    Opacity = s.Opac,
4502
                                    StrokeColor = _SetColor,
4503
                                    UserID = s.UserID,
4504
                                    LineSize = Convert.ToDouble(data2.First()),
4505
                                };
4506
                                instance.Memo = s.Memo;
4507
                                //Layer.Children.Add(instance);
4508
                                instance.CommentID = commentId;
4509
                                instance.MarkupInfoID = markupInfoID;
4510
                                baseLayer.Add(instance);
4511
                                instance.ApplyTemplate();
4512
                                instance.SetLinePath();
4513
                            }
4514
                            break;
4515
                        #endregion
4516
                        #region Text
4517
                        case "TextControl":
4518
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
4519
                            {
4520
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4521
                                TextControl instance = new TextControl()
4522
                                {
4523
                                    Text = s.Text,
4524
                                    StartPoint = s.StartPoint,
4525
                                    EndPoint = s.EndPoint,
4526
                                    CanvasX = s.StartPoint.X,
4527
                                    CanvasY = s.StartPoint.Y,
4528
                                    BoxWidth = s.BoxW,
4529
                                    BoxHeight = s.BoxH,
4530
                                    ControlType_No = s.paintMethod,
4531
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
4532
                                    TextSize = Convert.ToDouble(data2[1]),
4533
                                    FontColor = _SetColor,
4534
                                    //FontSize = 10,
4535
                                    UserID = s.UserID,
4536
                                    //isHighLight = s.isHighLight,
4537
                                    Angle = s.Angle,
4538
                                    PointSet = s.PointSet,
4539
                                    Opacity = s.Opac,
4540
                                    TextFamily = new FontFamily(s.fontConfig[0]),
4541 d4b0c723 KangIngu
                                    //인구 추가(2018.04.17)
4542
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
4543
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
4544 787a4489 KangIngu
                                };
4545
4546
                                if (instance.Text != null)
4547
                                {
4548
                                    //Layer.Children.Add(instance);
4549 4538d5e7 ljiyeon
                                    instance.CommentID = commentId;
4550 787a4489 KangIngu
                                    instance.MarkupInfoID = markupInfoID;
4551
                                    baseLayer.Add(instance);
4552
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
4553
                                    instance.ApplyTemplate();
4554
                                    instance.Memo = s.Memo;
4555
                                    if (s.fontConfig.Count() == 4)
4556
                                    {
4557
                                        instance.UnderLine = TextDecorations.Underline;
4558
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
4559
                                    }
4560
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
4561
4562
                                    //instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
4563
4564
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
4565
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
4566
4567 4538d5e7 ljiyeon
                                    
4568 787a4489 KangIngu
                                    instance.DrawingCloud();
4569
                                    instance.SetText();
4570
                                }
4571
                            }
4572
                            break;
4573
                        #endregion
4574
                        #region Arc
4575
                        case "ArcControl":
4576
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
4577
                            {
4578
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4579
                                ArcControl instance = new ArcControl()
4580
                                {
4581
                                    StartPoint = s.StartPoint,
4582
                                    EndPoint = s.EndPoint,
4583
                                    DashSize = s.DashSize,
4584
                                    PointSet = s.PointSet,
4585
                                    isTransOn = s.IsTransOn,
4586
                                    MidPoint = s.MidPoint,
4587
                                    StrokeColor = _SetColor,
4588
                                    Clock = s.Clock,
4589
                                    Opacity = s.Opac,
4590
                                    LineSize = Convert.ToDouble(data2.First()),
4591
                                    UserID = s.UserID,
4592
                                };
4593
                                instance.Memo = s.Memo;
4594
                                //Layer.Children.Add(instance);
4595 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
4596 787a4489 KangIngu
                                instance.MarkupInfoID = markupInfoID;
4597
                                baseLayer.Add(instance);
4598 4538d5e7 ljiyeon
                                
4599 787a4489 KangIngu
                                instance.ApplyTemplate();
4600
                                instance.SetArcPath();
4601
                            }
4602
                            break;
4603
                        #endregion
4604 40b3ce25 ljiyeon
                        #region ArrowArc
4605
                        case "ArrowArcControl":
4606
                            using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item))
4607
                            {
4608
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4609
                                ArrowArcControl instance = new ArrowArcControl()
4610
                                {
4611
                                    StartPoint = s.StartPoint,
4612
                                    EndPoint = s.EndPoint,
4613
                                    DashSize = s.DashSize,
4614
                                    PointSet = s.PointSet,
4615
                                    isTransOn = s.IsTransOn,
4616
                                    MidPoint = s.MidPoint,
4617
                                    StrokeColor = _SetColor,
4618
                                    Clock = s.Clock,
4619
                                    Opacity = s.Opac,
4620
                                    LineSize = Convert.ToDouble(data2.First()),
4621
                                    UserID = s.UserID,
4622
                                };
4623
                                instance.Memo = s.Memo;
4624
                                //Layer.Children.Add(instance);
4625 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
4626 40b3ce25 ljiyeon
                                instance.MarkupInfoID = markupInfoID;
4627
                                baseLayer.Add(instance);
4628 4538d5e7 ljiyeon
                                
4629 40b3ce25 ljiyeon
                                instance.ApplyTemplate();
4630
                                instance.SetArcPath();
4631
                            }
4632
                            break;
4633
                        #endregion
4634
                        
4635 787a4489 KangIngu
                        #region RectCloud
4636
                        case "RectCloudControl":
4637
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
4638
                            {
4639
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4640
                                RectCloudControl instance = new RectCloudControl()
4641
                                {
4642
                                    StartPoint = s.StartPoint,
4643
                                    EndPoint = s.EndPoint,
4644
                                    LeftBottomPoint = s.LB,
4645
                                    Paint = s.PaintState,
4646
                                    Opacity = s.Opac,
4647
                                    DashSize = s.DashSize,
4648
                                    TopRightPoint = s.TR,
4649
                                    PointSet = s.PointSet,
4650
                                    StrokeColor = _SetColor,
4651
                                    LineSize = Convert.ToDouble(data2.First()),
4652 53393bae KangIngu
                                    UserID = s.UserID,
4653
                                    ArcLength = s.ArcLength
4654 787a4489 KangIngu
                                };
4655
                                instance.Memo = s.Memo;
4656
                                //Layer.Children.Add(instance);
4657 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
4658 787a4489 KangIngu
                                instance.MarkupInfoID = markupInfoID;
4659
                                baseLayer.Add(instance);
4660 4538d5e7 ljiyeon
                                
4661 787a4489 KangIngu
                                instance.ApplyTemplate();
4662
                                instance.SetRectCloud();
4663
                            }
4664
                            break;
4665
                        #endregion
4666
                        #region Sign
4667
                        case "SignControl":
4668
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
4669
                            {
4670
                                SignControl instance = new SignControl
4671
                                {
4672
                                    Angle = s.Angle,
4673
                                    StartPoint = s.StartPoint,
4674
                                    TopRightPoint = s.TR,
4675
                                    EndPoint = s.EndPoint,
4676
                                    LeftBottomPoint = s.LB,
4677
                                    PointSet = s.PointSet,
4678
                                    Opacity = s.Opac,
4679
                                    SignImage = null,
4680
                                    UserID = s.UserID,
4681
                                };
4682
                                instance.ApplyTemplate();
4683
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4684
4685
                                if (s.UserNumber != null)
4686
                                {
4687
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
4688
                                    if (_sign != null)
4689
                                    {
4690
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
4691
4692
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
4693
                                        stream.Write(imageBytes, 0, imageBytes.Length);
4694
                                        stream.Position = 0;
4695
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
4696
                                        BitmapImage returnImage = new BitmapImage();
4697
                                        returnImage.BeginInit();
4698
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
4699
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
4700
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
4701
                                        returnImage.StreamSource = ms;
4702
                                        returnImage.EndInit();
4703
                                        stream.Close();
4704
                                        instance.SignImage = returnImage;
4705
                                    }
4706
                                }
4707
4708
                                instance.MarkupInfoID = markupInfoID;
4709
                                instance.CommentID = commentId;
4710
                                baseLayer.Add(instance);
4711
                                instance.ApplyTemplate();
4712
                                instance.SetImage();
4713
                            }
4714
                            break;
4715
                        #endregion
4716
                        #region Ink
4717
                        case "InkPresenter":
4718
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
4719
                            {
4720
#if SILVERLIGHT
4721
                                this._InkBoard.Strokes = s.SCC; 
4722
#endif
4723
                            }
4724
                            break;
4725
                        #endregion
4726
                        #region Date
4727
                        case "DateControl":
4728
                            {
4729
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
4730
                                {
4731
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4732
                                    DateControl instance = new DateControl
4733
                                    {
4734
                                        Angle = s.Angle,
4735
                                        StartPoint = s.StartPoint,
4736
                                        EndPoint = s.EndPoint,
4737
                                        LeftBottomPoint = s.LB,
4738
                                        TopRightPoint = s.TR,
4739
                                        Opacity = s.Opac,
4740
                                        FontColor = _SetColor,
4741
                                        LineSize = Convert.ToDouble(data2.First()),
4742
                                        Text = s.Text,
4743
                                        PointSet = s.PointSet,
4744
                                        UserID = s.UserID
4745
                                    };
4746
                                    instance.Memo = s.Memo;
4747
                                    //Layer.Children.Add(instance);
4748 4538d5e7 ljiyeon
                                    instance.MarkupInfoID = markupInfoID;
4749 787a4489 KangIngu
                                    instance.CommentID = commentId;
4750 4538d5e7 ljiyeon
                                    baseLayer.Add(instance);
4751
                                    
4752 787a4489 KangIngu
                                    instance.ApplyTemplate();
4753
                                    instance.SetDate();
4754
                                }
4755
                            }
4756
                            break;
4757
                        #endregion
4758
                        #region Symbol
4759
                        case "SymControl":
4760
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
4761
                            {
4762
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4763
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
4764
                                SymControl instance = new SymControl()
4765
                                {
4766
                                    LineSize = Convert.ToDouble(data2.First()),
4767
                                    PointSet = s.PointSet,
4768
                                    Paint = s.PaintState,
4769
                                    StartPoint = s.StartPoint,
4770
                                    StrokeColor = _SetColor,
4771
                                    EndPoint = s.EndPoint,
4772
                                    Angle = s.Angle,
4773
                                    LeftBottomPoint = s.LB,
4774
                                    TopRightPoint = s.TR,
4775
                                    PathData = sm.Convert(s.PathInfo.ToString()),
4776
                                    Opacity = s.Opac,
4777
                                };
4778
4779
                                instance.Memo = s.Memo;
4780 4538d5e7 ljiyeon
                                instance.MarkupInfoID = markupInfoID;
4781 787a4489 KangIngu
                                instance.CommentID = commentId;
4782 4538d5e7 ljiyeon
                                baseLayer.Add(instance);
4783 787a4489 KangIngu
                                instance.ApplyTemplate();
4784
                                instance.SetSymPath();
4785
                            }
4786
                            break;
4787
                        #endregion
4788
                        #region Image
4789
                        case "ImgControl":
4790
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
4791
                            {
4792
                                Image img = new Image();
4793 53880c83 ljiyeon
                                //img.Source = new BitmapImage(new Uri(s.ImagePath));
4794
                                if (s.ImagePath.Contains(".svg"))
4795
                                {
4796
                                    byte[] imageData = null;
4797
                                    DrawingImage image = null;
4798
                                    using (System.Net.WebClient web = new System.Net.WebClient())
4799
                                    {
4800
                                        imageData = web.DownloadData(new Uri(s.ImagePath));
4801
                                        System.IO.Stream stream = new System.IO.MemoryStream(imageData);
4802
                                        image = SvgReader.Load(stream);
4803
                                    }
4804
                                    img.Source = image;
4805
                                }
4806
                                else
4807
                                {
4808
                                    img.Source = new BitmapImage(new Uri(s.ImagePath));
4809
                                }
4810 787a4489 KangIngu
                                ImgControl instance = new ImgControl
4811
                                {
4812
                                    Angle = s.Angle,
4813
                                    StartPoint = s.StartPoint,
4814
                                    TopRightPoint = s.TR,
4815
                                    EndPoint = s.EndPoint,
4816
                                    LeftBottomPoint = s.LB,
4817
                                    PointSet = s.PointSet,
4818
                                    Opacity = s.Opac,
4819
                                    FilePath = s.ImagePath,
4820
                                    UserID = s.UserID,
4821 4538d5e7 ljiyeon
                                  //  ImageData = img.Source
4822
                                    
4823 787a4489 KangIngu
                                };
4824
                                //Layer.Children.Add(instance);
4825
                                instance.Memo = s.Memo;
4826 4538d5e7 ljiyeon
                                
4827
                                instance.MarkupInfoID = markupInfoID;
4828 787a4489 KangIngu
                                instance.CommentID = commentId;
4829 4538d5e7 ljiyeon
                                baseLayer.Add(instance);
4830
4831 787a4489 KangIngu
                                instance.ApplyTemplate();
4832 53880c83 ljiyeon
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
4833
                                instance.ImageData = img.Source;
4834 787a4489 KangIngu
                                instance.SetImage();
4835
4836
                            }
4837
                            break;
4838
                        #endregion
4839
                        #region SymbolN
4840
                        case "SymControlN":
4841
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
4842
                            {
4843
                                SymControlN instance = new SymControlN()
4844
                                {
4845
                                    PointSet = s.PointSet,
4846
                                    StartPoint = s.StartPoint,
4847
                                    EndPoint = s.EndPoint,
4848
                                    Angle = s.Angle,
4849
                                    LeftBottomPoint = s.LB,
4850
                                    TopRightPoint = s.TR,
4851
                                    Opacity = s.Opac,
4852
                                    PathXathData = s.DBData,
4853
                                };
4854
                                instance.Memo = s.Memo;
4855 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
4856 a7296e35 djkim
                                instance.MarkupInfoID = markupInfoID;
4857 787a4489 KangIngu
                                baseLayer.Add(instance);
4858 4538d5e7 ljiyeon
                                
4859 787a4489 KangIngu
                                instance.ApplyTemplate();
4860
4861 b200de5a KangIngu
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData);
4862 787a4489 KangIngu
                                xamlData = xamlData.Replace("daelim", "DAELIM");
4863
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
4864
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
4865
                                writer.Write(xamlData);
4866
                                writer.Flush();
4867
                                stream.Position = 0;
4868
4869
                                object obj = XamlReader.Load(stream);
4870 a7296e35 djkim
                                instance.Base_ViewBox.Child = obj as UIElement;                                
4871 787a4489 KangIngu
                                instance.SetViewBox();
4872
                            }
4873
                            break;
4874
                        #endregion
4875
                        default:
4876
4877
                            break;
4878
                    };
4879
                }
4880
            }
4881
        }
4882
4883 b200de5a KangIngu
        //강인구 추가(12/12)
4884 787a4489 KangIngu
        public Control markupParse_Paste(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer)
4885
        {
4886
            //GetUserSign getUser = new GetUserSign();
4887
            Control return_control = new Control();
4888
            if (MarkupString != "False")
4889
            {
4890
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(""));
4891
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
4892
                string[] delimiterChars = { "|DZ|" };
4893
                string[] delimiterChars2 = { "|" };
4894
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
4895
                List<string> dataSet = new List<string>();
4896
4897
                foreach (var dataPease in data)
4898
                {
4899
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
4900
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
4901
                    switch (unkownControl.Name)
4902
                    {
4903
                        #region Shape
4904
                        #region Rectangle
4905
                        case "RectangleControl":
4906
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
4907
                            {
4908
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4909
                                RectangleControl instance = new RectangleControl
4910
                                {
4911
                                    LineSize = Convert.ToDouble(data2.First()),
4912
                                    Paint = s.PaintState,
4913
                                    StartPoint = s.StartPoint,
4914
                                    EndPoint = s.EndPoint,
4915
                                    Angle = s.Angle,
4916
                                    StrokeColor = _SetColor,
4917
                                    DashSize = s.DashSize,
4918
                                    Opacity = s.Opac,
4919
                                    LeftBottomPoint = s.LB,
4920
                                    TopRightPoint = s.TR,
4921
                                    PointSet = s.PointSet,
4922
                                    UserID = s.UserID
4923
                                };
4924
                                baseLayer.Add(instance);
4925
                                instance.ApplyTemplate();
4926
4927
                                return_control = instance;
4928
                            }
4929
                            break;
4930
                        #endregion
4931
                        #region Triangle
4932
                        case "TriControl":
4933
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
4934
                            {
4935
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4936
                                TriControl instance = new TriControl
4937
                                {
4938
                                    LineSize = Convert.ToDouble(data2.First()),
4939
                                    MidPoint = s.MidPoint,
4940
                                    StartPoint = s.StartPoint,
4941
                                    Paint = s.Paint,
4942
                                    EndPoint = s.EndPoint,
4943
                                    Opacity = s.Opac,
4944
                                    Angle = s.Angle,
4945
                                    DashSize = s.DashSize,
4946
                                    PointSet = s.PointSet,
4947
                                    StrokeColor = _SetColor,
4948
4949
                                    UserID = s.UserID,
4950
                                };
4951
                                baseLayer.Add(instance);
4952
                                instance.ApplyTemplate();
4953
                                return_control = instance;
4954
                            }
4955
                            break;
4956
                        #endregion
4957
                        #region Cicle
4958
                        case "CircleControl":
4959
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
4960
                            {
4961
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4962
                                CircleControl instance = new CircleControl
4963
                                {
4964
                                    LineSize = Convert.ToDouble(data2.First()),
4965
                                    Paint = s.PaintState,
4966
                                    StartPoint = s.StartPoint,
4967
                                    EndPoint = s.EndPoint,
4968
                                    LeftBottomPoint = s.LBP,
4969
                                    TopRightPoint = s.TRP,
4970
                                    Opacity = s.Opac,
4971
                                    Angle = s.Angle,
4972
                                    DashSize = s.DashSize,
4973
                                    PointSet = s.PointSet,
4974
                                    StrokeColor = _SetColor,
4975
                                    UserID = s.UserID,
4976
                                };
4977
                                baseLayer.Add(instance);
4978
                                instance.ApplyTemplate();
4979
                                return_control = instance;
4980
                            }
4981
                            break;
4982
                        #endregion
4983
                        #region RectCloud
4984
                        case "RectCloudControl":
4985
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
4986
                            {
4987
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4988
                                RectCloudControl instance = new RectCloudControl()
4989
                                {
4990
                                    StartPoint = s.StartPoint,
4991
                                    EndPoint = s.EndPoint,
4992
                                    LeftBottomPoint = s.LB,
4993
                                    Paint = s.PaintState,
4994
                                    Opacity = s.Opac,
4995
                                    DashSize = s.DashSize,
4996
                                    TopRightPoint = s.TR,
4997
                                    PointSet = s.PointSet,
4998
                                    StrokeColor = _SetColor,
4999 53393bae KangIngu
                                    ArcLength = s.ArcLength,
5000 787a4489 KangIngu
                                    LineSize = Convert.ToDouble(data2.First()),
5001
                                    UserID = s.UserID
5002
                                };
5003
                                baseLayer.Add(instance);
5004
                                instance.ApplyTemplate();
5005
                                return_control = instance;
5006
                            }
5007
                            break;
5008
                        #endregion
5009
                        #endregion
5010
5011
                        #region Polygon
5012
                        #region Poly
5013
                        case "PolygonControl":
5014
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
5015
                            {
5016
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5017
                                PolygonControl instance = new PolygonControl
5018
                                {
5019
                                    LineSize = Convert.ToDouble(data2.First()),
5020
                                    //Toler = s.Toler,
5021
                                    IsCompleted = s.IsCompleted,
5022
                                    //PointSet = new List<Point>(),
5023
                                    Opacity = s.Opac,
5024
                                    StrokeColor = _SetColor,
5025
                                    //강인구 추가(Chain인지 Polygon인지 구분)
5026
                                    ControlType = s.Type,
5027
                                    DashSize = s.DashSize,
5028
                                    StartPoint = s.StartPoint,
5029
                                    EndPoint = s.EndPoint,
5030
                                    PointSet = s.PointSet,
5031
                                    UserID = s.UserID,
5032
                                    Paint = s.PaintState,
5033
                                    //PointC = s.PointC,
5034
                                };
5035
                                baseLayer.Add(instance);
5036
                                instance.ApplyTemplate();
5037
                                return_control = instance;
5038
                            }
5039
                            break;
5040
                        #endregion
5041
                        #region InkControl
5042
                        case "InkControl":
5043
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
5044
                            {
5045
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5046
                                InkControl instance = new InkControl
5047
                                {
5048
                                    LineSize = Convert.ToDouble(data2.First()),
5049
                                    //Toler = s.Toler,
5050
                                    IsCompleted = s.IsCompleted,
5051
                                    //PointSet = new List<Point>(),
5052
                                    Opacity = s.Opac,
5053
                                    StrokeColor = _SetColor,
5054
                                    //강인구 추가(Chain인지 Polygon인지 구분)
5055
                                    ControlType = s.Type,
5056
                                    DashSize = s.DashSize,
5057
                                    StartPoint = s.StartPoint,
5058
                                    PointSet = s.PointSet,
5059
                                    UserID = s.UserID,
5060
                                    Paint = s.PaintState,
5061
                                    EndPoint = s.EndPoint,
5062
                                    //PointC = s.PointC,
5063
                                };
5064
                                baseLayer.Add(instance);
5065
                                instance.ApplyTemplate();
5066
                                return_control = instance;
5067
                            }
5068
                            break;
5069
                        #endregion
5070
                        #region Cloud
5071
                        case "CloudControl":
5072
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
5073
                            {
5074
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5075
                                CloudControl instance = new CloudControl
5076
                                {
5077
                                    LineSize = Convert.ToDouble(data2.First()),
5078
                                    Toler = s.Toler,
5079
                                    PointSet = s.PointSet,
5080
                                    ArcLength = s.ArcLength,
5081
                                    Paint = s.PaintState,
5082
                                    Opacity = s.Opac,
5083
                                    StrokeColor = _SetColor,
5084
5085
                                    isTransOn = s.IsTrans,
5086
                                    isChain = s.IsChain,
5087
                                    DashSize = s.DashSize,
5088
                                    UserID = s.UserID,
5089
5090
                                    StartPoint = s.StartPoint,
5091
                                    EndPoint = s.EndPoint,
5092
5093
                                    //Fill = s.CloudFill,
5094
                                };
5095
                                //instance.PointSet = s.PointSet;
5096
                                //instance.ClosePath();
5097
                                //instance.ChangePaint(s.PaintState);
5098
                                baseLayer.Add(instance);
5099
                                instance.ApplyTemplate();
5100
                                instance.SetCloud();
5101
                                //instance.ClosePath();
5102
                                //instance.ChangePaint(s.PaintState);
5103
                                return_control = instance;
5104
                            }
5105
                            break;
5106
                        #endregion
5107
                        #endregion
5108
5109
                        #region Line
5110
                        #region Line
5111
                        case "LineControl":
5112
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
5113
                            {
5114
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5115
                                LineControl instance = new LineControl()
5116
                                {
5117
                                    LineStyleSet = s.LineStyleSet,
5118
                                    StartPoint = s.StartPoint,
5119
                                    DimSize = s.DimSize,
5120
                                    EndPoint = s.EndPoint,
5121
                                    DashSize = s.DashSize,
5122
                                    Interval = s.Interval,
5123
                                    PointSet = s.PointSet,
5124
                                    Opacity = s.Opac,
5125
                                    StrokeColor = _SetColor,
5126
                                    UserID = s.UserID,
5127
                                    LineSize = Convert.ToDouble(data2.First()),
5128
                                };
5129
5130
                                baseLayer.Add(instance);
5131
                                instance.ApplyTemplate();
5132
                                instance.SetLinePath();
5133
                                return_control = instance;
5134
                            }
5135
                            break;
5136
                        #endregion
5137
                        #region Arrow_Multi
5138
                        case "ArrowControl_Multi":
5139
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
5140
                            {
5141
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5142
                                ArrowControl_Multi instance = new ArrowControl_Multi
5143
                                {
5144
                                    LineSize = Convert.ToDouble(data2.First()),
5145
                                    StartPoint = s.StartPoint,
5146
                                    MiddlePoint = s.MidPoint,
5147
                                    DashSize = s.DashSize,
5148
                                    EndPoint = s.EndPoint,
5149
                                    PointSet = s.PointSet,
5150
                                    Opacity = s.Opac,
5151
                                    StrokeColor = _SetColor,
5152
5153
                                    UserID = s.UserID
5154
                                };
5155
                                baseLayer.Add(instance);
5156
                                instance.ApplyTemplate();
5157
                                instance.SetArrowMultiPath();
5158
                                return_control = instance;
5159
                            }
5160
                            break;
5161
                        #endregion
5162
                        #region Arc
5163
                        case "ArcControl":
5164
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
5165
                            {
5166
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5167
                                ArcControl instance = new ArcControl()
5168
                                {
5169
                                    StartPoint = s.StartPoint,
5170
                                    EndPoint = s.EndPoint,
5171
                                    DashSize = s.DashSize,
5172
                                    PointSet = s.PointSet,
5173
                                    isTransOn = s.IsTransOn,
5174
                                    MidPoint = s.MidPoint,
5175
                                    StrokeColor = _SetColor,
5176
                                    Opacity = s.Opac,
5177
5178
                                    Clock = s.Clock,
5179
                                    LineSize = Convert.ToDouble(data2.First()),
5180
                                    UserID = s.UserID,
5181
                                };
5182
                                baseLayer.Add(instance);
5183
                                instance.ApplyTemplate();
5184
                                instance.OnApplyTemplate();
5185
                                instance.SetArcPath();
5186
                                return_control = instance;
5187
                            }
5188
                            break;
5189
                        #endregion
5190 40b3ce25 ljiyeon
                        #region ArrowArc
5191
                        case "ArrowArcControl":
5192
                            using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item))
5193
                            {
5194
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5195
                                ArrowArcControl instance = new ArrowArcControl()
5196
                                {
5197
                                    StartPoint = s.StartPoint,
5198
                                    EndPoint = s.EndPoint,
5199
                                    DashSize = s.DashSize,
5200
                                    PointSet = s.PointSet,
5201
                                    isTransOn = s.IsTransOn,
5202
                                    MidPoint = s.MidPoint,
5203
                                    StrokeColor = _SetColor,
5204
                                    Opacity = s.Opac,
5205 787a4489 KangIngu
5206 40b3ce25 ljiyeon
                                    Clock = s.Clock,
5207
                                    LineSize = Convert.ToDouble(data2.First()),
5208
                                    UserID = s.UserID,
5209
                                };
5210
                                baseLayer.Add(instance);
5211
                                instance.ApplyTemplate();
5212
                                instance.OnApplyTemplate();
5213
                                instance.SetArcPath();
5214
                                return_control = instance;
5215
                            }
5216
                            break;
5217
                        #endregion
5218
                        #endregion
5219 787a4489 KangIngu
                        #region Text
5220
                        case "TextControl":
5221
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
5222
                            {
5223
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5224
                                TextControl instance = new TextControl()
5225
                                {
5226
                                    Text = s.Text,
5227
                                    StartPoint = s.StartPoint,
5228
                                    EndPoint = s.EndPoint,
5229
                                    CanvasX = s.StartPoint.X,
5230
                                    CanvasY = s.StartPoint.Y,
5231
                                    BoxWidth = s.BoxW,
5232
                                    BoxHeight = s.BoxH,
5233
                                    ControlType_No = s.paintMethod,
5234
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
5235
                                    TextSize = Convert.ToDouble(data2[1]),
5236
                                    FontColor = _SetColor,
5237
                                    FontSize = 10,
5238
                                    UserID = s.UserID,
5239
                                    //isHighLight = s.isHighLight,
5240
                                    Angle = s.Angle,
5241
                                    PointSet = s.PointSet,
5242
                                    Opacity = s.Opac,
5243
                                    TextFamily = new FontFamily(s.fontConfig[0]),
5244 d4b0c723 KangIngu
                                    //인구 추가(2018.04.17)
5245
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
5246
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
5247 787a4489 KangIngu
                                };
5248
5249
                                if (instance.Text != null)
5250
                                {
5251
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
5252
                                    instance.ApplyTemplate();
5253
                                    if (s.fontConfig.Count() == 4)
5254
                                    {
5255
                                        instance.UnderLine = TextDecorations.Underline;
5256
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
5257
                                    }
5258
                                }
5259
                                baseLayer.Add(instance);
5260
                                instance.ApplyTemplate();
5261
5262
                                instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
5263
5264
                                instance.Base_TextBox.Visibility = Visibility.Collapsed;
5265
                                instance.Base_TextBlock.Visibility = Visibility.Visible;
5266 b200de5a KangIngu
5267 787a4489 KangIngu
                                return_control = instance;
5268
                            }
5269
                            break;
5270
                        #endregion
5271
5272
                        #region ArrowText
5273
                        case "ArrowTextControl":
5274
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
5275
                            {
5276 f8769f8a ljiyeon
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5277 787a4489 KangIngu
                                ArrowTextControl instance = new ArrowTextControl();
5278 f8769f8a ljiyeon
                                instance.LineSize = Convert.ToDouble(data2.First());
5279 787a4489 KangIngu
                                instance.PointSet = s.PointSet;
5280
                                instance.StartPoint = s.StartPoint;
5281
                                instance.EndPoint = s.EndPoint;
5282
                                instance.StrokeColor = _SetColor;
5283
                                //instance.DashSize = s.DashSize;
5284
                                instance.ArrowTextStyle = s.ArrowStyle;
5285
                                instance.isHighLight = s.isHighLight;
5286
                                instance.ArrowText = s.ArrowText;
5287
                                instance.Opacity = s.Opac;
5288
                                instance.BorderSize = s.BorderSize;
5289
                                instance.BoxWidth = s.BoxWidth;
5290
                                instance.BoxHeight = s.BoxHeight;
5291
                                instance.isFixed = s.isFixed;
5292
                                instance.Angle = s.Angle;
5293
                                instance.UserID = s.UserID;
5294
                                instance.isTrans = s.isTrans;
5295
                                instance.MidPoint = s.MidPoint;
5296
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
5297
                                {
5298
                                    s.fontConfig = new List<string>();
5299
5300
                                    s.fontConfig.Add("Arial");
5301
                                    s.fontConfig.Add("Normal");
5302
                                    s.fontConfig.Add("Normal");
5303
                                    s.fontConfig.Add("30");
5304
                                }
5305
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
5306 d4b0c723 KangIngu
                                //인구 추가(2018.04.17)
5307
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
5308
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
5309 787a4489 KangIngu
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
5310 e17af42b KangIngu
5311 787a4489 KangIngu
                                baseLayer.Add(instance);
5312
                                instance.ApplyTemplate();
5313 e17af42b KangIngu
5314
                                if (s.fontConfig.Count() == 5)
5315
                                {
5316
                                    instance.UnderLine = TextDecorations.Underline;
5317
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
5318
                                }
5319 787a4489 KangIngu
                                instance.SetArrowTextPath();
5320
                                return_control = instance;
5321
                            };
5322
                            break;
5323
                        #endregion
5324
5325
                        #region ETC
5326
                        #region Ink
5327
                        case "InkPresenter":
5328
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
5329
                            {
5330
5331
                            }
5332
                            break;
5333
                        #endregion
5334
                        #region Date
5335
                        case "DateControl":
5336
                            {
5337
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
5338
                                {
5339
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5340
                                    DateControl instance = new DateControl
5341
                                    {
5342
                                        Angle = s.Angle,
5343
                                        StartPoint = s.StartPoint,
5344
                                        EndPoint = s.EndPoint,
5345
                                        LeftBottomPoint = s.LB,
5346
                                        TopRightPoint = s.TR,
5347
                                        Opacity = s.Opac,
5348
                                        FontColor = _SetColor,
5349
                                        LineSize = Convert.ToDouble(data2.First()),
5350
                                        Text = s.Text,
5351
                                        PointSet = s.PointSet,
5352
                                        UserID = s.UserID
5353
                                    };
5354
                                    baseLayer.Add(instance);
5355
                                    instance.ApplyTemplate();
5356
                                    return_control = instance;
5357
                                }
5358
                            }
5359
                            break;
5360
                        #endregion
5361
                        #region Image
5362
                        case "ImgControl":
5363
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
5364
                            {
5365
                                Image img = new Image();
5366 53880c83 ljiyeon
                                //img.Source = new BitmapImage(new Uri(s.ImagePath));
5367
                                if (s.ImagePath.Contains(".svg"))
5368
                                {
5369
                                    byte[] imageData = null;
5370
                                    DrawingImage image = null;
5371
                                    using (System.Net.WebClient web = new System.Net.WebClient())
5372
                                    {
5373
                                        imageData = web.DownloadData(new Uri(s.ImagePath));
5374
                                        System.IO.Stream stream = new System.IO.MemoryStream(imageData);
5375
                                        image = SvgReader.Load(stream);
5376
                                    }
5377
                                    img.Source = image;
5378
                                }
5379
                                else
5380
                                {
5381
                                    img.Source = new BitmapImage(new Uri(s.ImagePath));
5382
                                }
5383 787a4489 KangIngu
                                ImgControl instance = new ImgControl
5384
                                {
5385
                                    Angle = s.Angle,
5386
                                    StartPoint = s.StartPoint,
5387
                                    TopRightPoint = s.TR,
5388
                                    EndPoint = s.EndPoint,
5389
                                    LeftBottomPoint = s.LB,
5390
                                    PointSet = s.PointSet,
5391
                                    Opacity = s.Opac,
5392
                                    FilePath = s.ImagePath,
5393
                                    UserID = s.UserID,
5394
                                    ImageData = img.Source
5395
                                };
5396
5397
                                instance.ApplyTemplate();
5398
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5399 53880c83 ljiyeon
                                instance.ImageData = img.Source;
5400 787a4489 KangIngu
                                baseLayer.Add(instance);
5401
                                instance.ApplyTemplate();
5402
                                instance.SetImage();
5403
                                return_control = instance;
5404
                            }
5405
                            break;
5406
                        #endregion
5407
                        #region Sign
5408
                        case "SignControl":
5409
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
5410
                            {
5411
                                SignControl instance = new SignControl
5412
                                {
5413
                                    Angle = s.Angle,
5414
                                    StartPoint = s.StartPoint,
5415
                                    TopRightPoint = s.TR,
5416
                                    EndPoint = s.EndPoint,
5417
                                    LeftBottomPoint = s.LB,
5418
                                    PointSet = s.PointSet,
5419
                                    Opacity = s.Opac,
5420
                                    SignImage = null,
5421
                                    UserID = s.UserID,
5422
                                };
5423
                                instance.ApplyTemplate();
5424
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5425
5426
                                if (s.UserNumber != null)
5427
                                {
5428
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
5429
                                    if (_sign != null)
5430
                                    {
5431
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
5432
5433
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
5434
                                        stream.Write(imageBytes, 0, imageBytes.Length);
5435
                                        stream.Position = 0;
5436
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
5437
                                        BitmapImage returnImage = new BitmapImage();
5438
                                        returnImage.BeginInit();
5439
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
5440
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
5441
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
5442
                                        returnImage.StreamSource = ms;
5443
                                        returnImage.EndInit();
5444
                                        stream.Close();
5445
                                        instance.SignImage = returnImage;
5446
                                    }
5447
                                }
5448
5449
                                baseLayer.Add(instance);
5450
                                instance.ApplyTemplate();
5451
                                instance.SetImage();
5452
                                return_control = instance;
5453
                            }
5454
                            break;
5455
                        #endregion
5456
                        #region Symbol
5457
                        case "SymControl":
5458
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
5459
                            {
5460
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5461
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
5462
                                SymControl instance = new SymControl
5463
                                {
5464
                                    //Angle = s.Angle,
5465
                                    //StartPoint = s.StartPoint,
5466
                                    //TopRightPoint = s.TR,
5467
                                    //EndPoint = s.EndPoint,
5468
                                    //LeftBottomPoint = s.LB,
5469
                                    //PointSet = s.PointSet,
5470
                                    //Opacity = s.Opac,
5471
                                    //FilePath = s.ImagePath,
5472
                                    //UserID = s.UserID,
5473
                                    //ImageData = s.ImageData
5474
                                    LineSize = Convert.ToDouble(data2.First()),
5475
                                    PointSet = s.PointSet,
5476
                                    Paint = s.PaintState,
5477
                                    StartPoint = s.StartPoint,
5478
                                    StrokeColor = _SetColor,
5479
                                    EndPoint = s.EndPoint,
5480
                                    Angle = s.Angle,
5481
                                    UserID = s.UserID,
5482
                                    LeftBottomPoint = s.LB,
5483
                                    TopRightPoint = s.TR,
5484
                                    PathData = sm.Convert(s.PathInfo.ToString()),
5485
                                    Opacity = s.Opac,
5486
                                };
5487
5488
                                baseLayer.Add(instance);
5489
                                //instance.OnApplyTemplate();
5490
                                instance.ApplyTemplate();
5491
                                instance.SetSymPath();
5492
                                return_control = instance;
5493
                            }
5494
                            break;
5495
                        #endregion
5496 b200de5a KangIngu
5497 787a4489 KangIngu
                        #region SymbolN
5498
                        case "SymControlN":
5499
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
5500
                            {
5501
                                SymControlN instance = new SymControlN()
5502
                                {
5503
                                    PointSet = s.PointSet,
5504
                                    StartPoint = s.StartPoint,
5505
                                    EndPoint = s.EndPoint,
5506
                                    Angle = s.Angle,
5507
                                    LeftBottomPoint = s.LB,
5508
                                    TopRightPoint = s.TR,
5509
                                    Opacity = s.Opac,
5510
                                    PathXathData = s.DBData,
5511
                                };
5512
                                instance.Memo = s.Memo;
5513
                                baseLayer.Add(instance);
5514
                                instance.ApplyTemplate();
5515
5516
                                return_control = instance;
5517
5518
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
5519
                                //instance.PathXathData = s.DBData;
5520
5521
                                //var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData);
5522
                                //xamlData = xamlData.Replace("daelim", "DAELIM");
5523
                                //System.IO.MemoryStream stream = new System.IO.MemoryStream();
5524
                                //System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
5525
                                //writer.Write(xamlData);
5526
                                //writer.Flush();
5527
                                //stream.Position = 0;
5528
5529
                                //object obj = XamlReader.Load(stream);
5530
                                //instance.Base_ViewBox.Child = obj as UIElement;
5531
                                //instance.PathXathData = appovalData;
5532
                                //instance.SetViewBox();
5533
                            }
5534
                            break;
5535
                        #endregion
5536
                        #endregion 
5537
                        default:
5538
                            break;
5539
                    };
5540
                }
5541
            }
5542
            return return_control;
5543
        }
5544
5545
        public S_BaseControl markupParse_GetBaseControl(string MarkupString)
5546
        {
5547
            var item = JsonSerializerHelper.UnCompressString(MarkupString); //언패킹작업
5548
            var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
5549
            return unknownData;
5550
        }
5551 1a503498 ljiyeon
        
5552
        //Temp
5553
        public Control TempMarkupParseEx(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId)
5554
        {
5555
            Control return_control = new Control();
5556
            if (MarkupString != "False")
5557
            {   
5558
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
5559
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
5560
                string[] delimiterChars = { "|DZ|" };
5561
                string[] delimiterChars2 = { "|" };
5562
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
5563
                List<string> dataSet = new List<string>();
5564
5565
                foreach (var dataPease in data)
5566
                {
5567
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
5568
                    var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
5569
                    switch (unkownControl.Name)
5570
                    {
5571
                        #region ArrowText
5572
                        case "ArrowTextControl":
5573
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
5574
                            {
5575
                                #region 신규
5576 f8769f8a ljiyeon
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5577 1a503498 ljiyeon
                                ArrowTextControl instance = new ArrowTextControl();
5578
                                instance.MarkupInfoID = markupInfoID;
5579
                                //Layer.Children.Add(instance);
5580
                                baseLayer.Add(instance);
5581
                                instance.ApplyTemplate();
5582 f8769f8a ljiyeon
                                instance.LineSize = Convert.ToDouble(data2.First());
5583 1a503498 ljiyeon
                                instance.PointSet = s.PointSet;
5584
                                instance.StartPoint = s.StartPoint;
5585
                                instance.EndPoint = s.EndPoint;
5586
                                instance.StrokeColor = new SolidColorBrush(Colors.Red);
5587
                                //instance.DashSize = s.DashSize;
5588
                                instance.ArrowTextStyle = s.ArrowStyle;
5589
                                instance.isHighLight = s.isHighLight;
5590
                                instance.ArrowText = s.ArrowText;
5591
                                instance.Opacity = s.Opac;
5592
                                instance.BorderSize = s.BorderSize;
5593
                                instance.BoxWidth = s.BoxWidth;
5594
                                instance.BoxHeight = s.BoxHeight;
5595
                                instance.isFixed = s.isFixed;
5596
                                instance.Angle = s.Angle;
5597
                                instance.UserID = s.UserID;
5598
                                instance.StrokeColor = _SetColor;
5599
                                instance.isTrans = s.isTrans;
5600
                                instance.MidPoint = s.MidPoint;
5601
                                instance.Memo = s.Memo;
5602
                                if (s.fontConfig == null || s.fontConfig.ToList().Count == 0)
5603
                                {
5604
                                    s.fontConfig = new List<string>();
5605
5606
                                    s.fontConfig.Add("Arial");
5607
                                    s.fontConfig.Add("Normal");
5608
                                    s.fontConfig.Add("Normal");
5609
                                    s.fontConfig.Add("30");
5610
                                }
5611
5612
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
5613
                                //인구 추가(2018.04.17)
5614
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
5615
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
5616
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
5617
5618
                                if (s.fontConfig.Count() == 5)
5619
                                {
5620
                                    instance.UnderLine = TextDecorations.Underline;
5621
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
5622
                                }
5623
5624
                                instance.SetArrowTextPath();
5625
                                instance.Base_TextBox.IsHitTestVisible = false;
5626
                                instance.CommentID = commentId;
5627
                                #endregion
5628
5629
5630
                                return_control = instance;
5631
5632
                            };
5633
                            break;
5634
                        #endregion
5635
                        #region Arrow_Multi
5636
                        case "ArrowControl_Multi":
5637
                            using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item))
5638
                            {
5639
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5640
                                ArrowControl_Multi instance = new ArrowControl_Multi
5641
                                {
5642
                                    LineSize = Convert.ToDouble(data2.First()),
5643
                                    StartPoint = s.StartPoint,
5644
                                    MiddlePoint = s.MidPoint,
5645
                                    DashSize = s.DashSize,
5646
                                    EndPoint = s.EndPoint,
5647
                                    PointSet = s.PointSet,
5648
                                    Opacity = s.Opac,
5649
                                    StrokeColor = _SetColor,
5650
                                    UserID = s.UserID
5651
                                };
5652
5653
                                //Layer.Children.Add(instance);
5654 4538d5e7 ljiyeon
                                instance.Memo = s.Memo;
5655
                                instance.CommentID = commentId;
5656 1a503498 ljiyeon
                                instance.MarkupInfoID = markupInfoID;
5657
                                baseLayer.Add(instance);
5658
                                instance.ApplyTemplate();
5659 4538d5e7 ljiyeon
                                instance.SetArrowMultiPath();                                
5660 1a503498 ljiyeon
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
5661
                                
5662
                                return_control = instance;
5663
                            }
5664
                            break;
5665
                        #endregion
5666
                        #region Rectangle
5667
                        case "RectangleControl":
5668
                            using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item))
5669
                            {
5670
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5671
                                RectangleControl instance = new RectangleControl
5672
                                {
5673
                                    LineSize = Convert.ToDouble(data2.First()),
5674
                                    Paint = s.PaintState,
5675
                                    StartPoint = s.StartPoint,
5676
                                    EndPoint = s.EndPoint,
5677
                                    Angle = s.Angle,
5678
                                    StrokeColor = _SetColor,
5679
                                    DashSize = s.DashSize,
5680
                                    Opacity = s.Opac,
5681
                                    LeftBottomPoint = s.LB,
5682
                                    TopRightPoint = s.TR,
5683
                                    PointSet = s.PointSet,
5684
                                    UserID = s.UserID
5685
                                };
5686
5687
                                instance.Memo = s.Memo;
5688
                                //Layer.Children.Add(instance);
5689
                                instance.CommentID = commentId;
5690
                                instance.MarkupInfoID = markupInfoID;
5691
                                baseLayer.Add(instance);
5692
                                instance.ApplyTemplate();
5693
                                instance.SetRectPath();
5694
5695
                                return_control = instance;
5696
                            }
5697
                            break;
5698
                        #endregion
5699
                        #region Triangle
5700
                        case "TriControl":
5701
                            using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item))
5702
                            {
5703
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5704
                                TriControl instance = new TriControl
5705
                                {
5706
                                    LineSize = Convert.ToDouble(data2.First()),
5707
                                    MidPoint = s.MidPoint,
5708
                                    StartPoint = s.StartPoint,
5709
                                    Paint = s.Paint,
5710
                                    EndPoint = s.EndPoint,
5711
                                    Opacity = s.Opac,
5712
                                    Angle = s.Angle,
5713
                                    DashSize = s.DashSize,
5714
                                    PointSet = s.PointSet,
5715
                                    StrokeColor = _SetColor,
5716
                                    UserID = s.UserID,
5717
                                };
5718
                                instance.Memo = s.Memo;
5719
                                //Layer.Children.Add(instance);
5720
                                instance.CommentID = commentId;
5721
                                instance.MarkupInfoID = markupInfoID;
5722
                                baseLayer.Add(instance);
5723
                                instance.ApplyTemplate();
5724
                                instance.SetTri();
5725
                                return_control = instance;
5726
                            }
5727
                            break;
5728
                        #endregion
5729
                        #region Cicle
5730
                        case "CircleControl":
5731
                            using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item))
5732
                            {
5733
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5734
                                CircleControl instance = new CircleControl
5735
                                {
5736
                                    LineSize = Convert.ToDouble(data2.First()),
5737
                                    Paint = s.PaintState,
5738
                                    StartPoint = s.StartPoint,
5739
                                    EndPoint = s.EndPoint,
5740
                                    LeftBottomPoint = s.LBP,
5741
                                    TopRightPoint = s.TRP,
5742
                                    Opacity = s.Opac,
5743
                                    Angle = s.Angle,
5744
                                    DashSize = s.DashSize,
5745
                                    PointSet = s.PointSet,
5746
                                    StrokeColor = _SetColor,
5747
                                    UserID = s.UserID,
5748
                                };
5749
                                instance.Memo = s.Memo;
5750
                                //Layer.Children.Add(instance);
5751
                                instance.CommentID = commentId;
5752
                                instance.MarkupInfoID = markupInfoID;
5753
                                baseLayer.Add(instance);
5754
                                instance.ApplyTemplate();
5755
                                instance.SetCircle();
5756
                                return_control = instance;
5757
                            }
5758
                            break;
5759
                        #endregion
5760
                        #region Poly
5761
                        case "PolygonControl":
5762
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
5763
                            {
5764
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5765
                                PolygonControl instance = new PolygonControl
5766
                                {
5767
                                    LineSize = Convert.ToDouble(data2.First()),
5768
                                    //Toler = s.Toler,
5769
                                    IsCompleted = s.IsCompleted,
5770
                                    //PointSet = new List<Point>(),
5771
                                    Opacity = s.Opac,
5772
                                    StrokeColor = _SetColor,
5773
                                    StartPoint = s.StartPoint,
5774
                                    PointSet = s.PointSet,
5775
                                    EndPoint = s.EndPoint,
5776
                                    UserID = s.UserID,
5777
                                    //강인구 추가(Chain인지 Polygon인지 구분)
5778
                                    ControlType = s.Type,
5779
                                    DashSize = s.DashSize,
5780
                                    Paint = s.PaintState,
5781
                                    //PointC = s.PointC,
5782
                                };
5783
                                //Layer.Children.Add(instance);
5784 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
5785 1a503498 ljiyeon
                                instance.MarkupInfoID = markupInfoID;
5786
                                baseLayer.Add(instance);
5787 4538d5e7 ljiyeon
                                
5788 1a503498 ljiyeon
                                instance.Memo = s.Memo;
5789
                                instance.ApplyTemplate();
5790
                                instance.SetPolyPath();
5791
                                return_control = instance;
5792
                                //instance.PointSet = s.PointSet;
5793
                                //instance.ClosePath();
5794
                                //instance.ChangePaint(s.PaintState);
5795
                            }
5796
                            break;
5797
                        #endregion
5798
                        #region InkControl
5799
                        case "InkControl":
5800
                            using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item))
5801
                            {
5802
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5803
                                InkControl instance = new InkControl
5804
                                {
5805
                                    LineSize = Convert.ToDouble(data2.First()),
5806
                                    //Toler = s.Toler,
5807
                                    IsCompleted = s.IsCompleted,
5808
                                    //PointSet = new List<Point>(),
5809
                                    Opacity = s.Opac,
5810
                                    StrokeColor = _SetColor,
5811
                                    StartPoint = s.StartPoint,
5812
                                    PointSet = s.PointSet,
5813
                                    UserID = s.UserID,
5814
                                    EndPoint = s.EndPoint,
5815
                                    //강인구 추가(Chain인지 Polygon인지 구분)
5816
                                    ControlType = s.Type,
5817
                                    DashSize = s.DashSize,
5818
                                    Paint = s.PaintState,
5819
                                    //PointC = s.PointC,
5820
                                };
5821
                                //Layer.Children.Add(instance);
5822 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
5823 1a503498 ljiyeon
                                instance.MarkupInfoID = markupInfoID;
5824
                                baseLayer.Add(instance);
5825 4538d5e7 ljiyeon
                                
5826 1a503498 ljiyeon
                                instance.Memo = s.Memo;
5827
                                instance.ApplyTemplate();
5828
                                instance.SetPolyPath();
5829
                                return_control = instance;
5830
                                //instance.PointSet = s.PointSet;
5831
                                //instance.ClosePath();
5832
                                //instance.ChangePaint(s.PaintState);
5833
                            }
5834
                            break;
5835
                        #endregion
5836
                        #region Cloud
5837
                        case "CloudControl":
5838
                            using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item))
5839
                            {
5840
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5841
                                CloudControl instance = new CloudControl
5842
                                {
5843
                                    LineSize = Convert.ToDouble(data2.First()),
5844
                                    Toler = s.Toler,
5845
                                    PointSet = new List<Point>(),
5846
                                    ArcLength = s.ArcLength,
5847
                                    Paint = s.PaintState,
5848
                                    Opacity = s.Opac,
5849
                                    StrokeColor = _SetColor,
5850
                                    isTransOn = s.IsTrans,
5851
                                    isChain = s.IsChain,
5852
                                    DashSize = s.DashSize,
5853
                                    UserID = s.UserID,
5854
                                    StartPoint = s.StartPoint,
5855
                                    EndPoint = s.EndPoint,
5856
                                    //Fill = s.CloudFill,
5857
                                };
5858
                                instance.Memo = s.Memo;
5859
                                //Layer.Children.Add(instance);
5860 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
5861 1a503498 ljiyeon
                                instance.MarkupInfoID = markupInfoID;
5862
                                baseLayer.Add(instance);
5863 4538d5e7 ljiyeon
                                
5864 1a503498 ljiyeon
                                instance.PointSet = s.PointSet;
5865
                                instance.ApplyTemplate();
5866
                                instance.ClosePath();
5867
                                instance.ChangePaint(s.PaintState);
5868
                                return_control = instance;
5869
                            }
5870
                            break;
5871
                        #endregion
5872
                        #region Line
5873
                        case "LineControl":
5874
                            using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
5875
                            {
5876
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5877
                                LineControl instance = new LineControl()
5878
                                {
5879
                                    LineStyleSet = s.LineStyleSet,
5880
                                    StartPoint = s.StartPoint,
5881
                                    DimSize = s.DimSize,
5882
                                    EndPoint = s.EndPoint,
5883
                                    DashSize = s.DashSize,
5884
                                    Interval = s.Interval,
5885
                                    PointSet = s.PointSet,
5886
                                    Opacity = s.Opac,
5887
                                    StrokeColor = _SetColor,
5888
                                    UserID = s.UserID,
5889
                                    LineSize = Convert.ToDouble(data2.First()),
5890
                                };
5891
                                instance.Memo = s.Memo;
5892
                                //Layer.Children.Add(instance);
5893
                                instance.CommentID = commentId;
5894
                                instance.MarkupInfoID = markupInfoID;
5895
                                baseLayer.Add(instance);
5896
                                instance.ApplyTemplate();
5897
                                instance.SetLinePath();
5898
                                return_control = instance;
5899
                            }
5900
                            break;
5901
                        #endregion
5902
                        #region Text
5903
                        case "TextControl":
5904
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
5905
                            {
5906
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5907
                                TextControl instance = new TextControl()
5908
                                {
5909
                                    Text = s.Text,
5910
                                    StartPoint = s.StartPoint,
5911
                                    EndPoint = s.EndPoint,
5912
                                    CanvasX = s.StartPoint.X,
5913
                                    CanvasY = s.StartPoint.Y,
5914
                                    BoxWidth = s.BoxW,
5915
                                    BoxHeight = s.BoxH,
5916
                                    ControlType_No = s.paintMethod,
5917
                                    LineSize = new Thickness(Convert.ToDouble(data2.First())),
5918
                                    TextSize = Convert.ToDouble(data2[1]),
5919
                                    FontColor = _SetColor,
5920
                                    //FontSize = 10,
5921
                                    UserID = s.UserID,
5922
                                    //isHighLight = s.isHighLight,
5923
                                    Angle = s.Angle,
5924
                                    PointSet = s.PointSet,
5925
                                    Opacity = s.Opac,
5926
                                    TextFamily = new FontFamily(s.fontConfig[0]),
5927
                                    //인구 추가(2018.04.17)
5928
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
5929
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
5930
                                };
5931
5932
                                if (instance.Text != null)
5933
                                {
5934
                                    //Layer.Children.Add(instance);
5935
                                    instance.MarkupInfoID = markupInfoID;
5936
                                    baseLayer.Add(instance);
5937
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
5938
                                    instance.ApplyTemplate();
5939
                                    instance.Memo = s.Memo;
5940
                                    if (s.fontConfig.Count() == 4)
5941
                                    {
5942
                                        instance.UnderLine = TextDecorations.Underline;
5943
                                        instance.Base_TextBlock.TextDecorations = instance.UnderLine;
5944
                                    }
5945
                                    instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
5946
5947
                                    //instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4);
5948
5949
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
5950
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
5951
5952
                                    instance.CommentID = commentId;
5953
                                    instance.DrawingCloud();
5954
                                    instance.SetText();
5955
                                    return_control = instance;
5956
                                }
5957
                            }
5958
                            break;
5959
                        #endregion
5960
                        #region Arc
5961
                        case "ArcControl":
5962
                            using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item))
5963
                            {
5964
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5965
                                ArcControl instance = new ArcControl()
5966
                                {
5967
                                    StartPoint = s.StartPoint,
5968
                                    EndPoint = s.EndPoint,
5969
                                    DashSize = s.DashSize,
5970
                                    PointSet = s.PointSet,
5971
                                    isTransOn = s.IsTransOn,
5972
                                    MidPoint = s.MidPoint,
5973
                                    StrokeColor = _SetColor,
5974
                                    Clock = s.Clock,
5975
                                    Opacity = s.Opac,
5976
                                    LineSize = Convert.ToDouble(data2.First()),
5977
                                    UserID = s.UserID,
5978
                                };
5979 40b3ce25 ljiyeon
                                instance.Memo = s.Memo;
5980
                                //Layer.Children.Add(instance);
5981
                                instance.MarkupInfoID = markupInfoID;
5982
                                instance.CommentID = commentId;
5983 4538d5e7 ljiyeon
                                baseLayer.Add(instance);
5984
                                
5985 40b3ce25 ljiyeon
                                instance.ApplyTemplate();
5986
                                instance.SetArcPath();
5987
                                return_control = instance;
5988
                            }
5989
                            break;
5990
                        #endregion
5991
                        #region Arc
5992
                        case "ArrowArcControl":
5993
                            using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item))
5994
                            {
5995
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5996
                                ArrowArcControl instance = new ArrowArcControl()
5997
                                {
5998
                                    StartPoint = s.StartPoint,
5999
                                    EndPoint = s.EndPoint,
6000
                                    DashSize = s.DashSize,
6001
                                    PointSet = s.PointSet,
6002
                                    isTransOn = s.IsTransOn,
6003
                                    MidPoint = s.MidPoint,
6004
                                    StrokeColor = _SetColor,
6005
                                    Clock = s.Clock,
6006
                                    Opacity = s.Opac,
6007
                                    LineSize = Convert.ToDouble(data2.First()),
6008
                                    UserID = s.UserID,
6009
                                };
6010 1a503498 ljiyeon
                                instance.Memo = s.Memo;
6011
                                //Layer.Children.Add(instance);
6012
                                instance.MarkupInfoID = markupInfoID;
6013
                                instance.CommentID = commentId;
6014 4538d5e7 ljiyeon
                                baseLayer.Add(instance);
6015
                                
6016 1a503498 ljiyeon
                                instance.ApplyTemplate();
6017
                                instance.SetArcPath();
6018
                                return_control = instance;
6019
                            }
6020
                            break;
6021
                        #endregion
6022
                        #region RectCloud
6023
                        case "RectCloudControl":
6024
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
6025
                            {
6026
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
6027
                                RectCloudControl instance = new RectCloudControl()
6028
                                {
6029
                                    StartPoint = s.StartPoint,
6030
                                    EndPoint = s.EndPoint,
6031
                                    LeftBottomPoint = s.LB,
6032
                                    Paint = s.PaintState,
6033
                                    Opacity = s.Opac,
6034
                                    DashSize = s.DashSize,
6035
                                    TopRightPoint = s.TR,
6036
                                    PointSet = s.PointSet,
6037
                                    StrokeColor = _SetColor,
6038
                                    LineSize = Convert.ToDouble(data2.First()),
6039
                                    UserID = s.UserID,
6040
                                    ArcLength = s.ArcLength
6041
                                };
6042
                                instance.Memo = s.Memo;
6043
                                //Layer.Children.Add(instance);
6044
                                instance.MarkupInfoID = markupInfoID;
6045
                                instance.CommentID = commentId;
6046 4538d5e7 ljiyeon
                                baseLayer.Add(instance);
6047
                                
6048 1a503498 ljiyeon
                                instance.ApplyTemplate();
6049
                                instance.SetRectCloud();
6050
                                return_control = instance;
6051
                            }
6052
                            break;
6053
                        #endregion
6054
                        #region Sign
6055
                        case "SignControl":
6056
                            using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item))
6057
                            {
6058
                                SignControl instance = new SignControl
6059
                                {
6060
                                    Angle = s.Angle,
6061
                                    StartPoint = s.StartPoint,
6062
                                    TopRightPoint = s.TR,
6063
                                    EndPoint = s.EndPoint,
6064
                                    LeftBottomPoint = s.LB,
6065
                                    PointSet = s.PointSet,
6066
                                    Opacity = s.Opac,
6067
                                    SignImage = null,
6068
                                    UserID = s.UserID,
6069
                                };
6070
                                instance.ApplyTemplate();
6071
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
6072
6073
                                if (s.UserNumber != null)
6074
                                {
6075
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
6076
                                    if (_sign != null)
6077
                                    {
6078
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
6079
6080
                                        System.IO.MemoryStream stream = new System.IO.MemoryStream();
6081
                                        stream.Write(imageBytes, 0, imageBytes.Length);
6082
                                        stream.Position = 0;
6083
                                        System.Drawing.Image img = System.Drawing.Image.FromStream(stream);
6084
                                        BitmapImage returnImage = new BitmapImage();
6085
                                        returnImage.BeginInit();
6086
                                        System.IO.MemoryStream ms = new System.IO.MemoryStream();
6087
                                        img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
6088
                                        ms.Seek(0, System.IO.SeekOrigin.Begin);
6089
                                        returnImage.StreamSource = ms;
6090
                                        returnImage.EndInit();
6091
                                        stream.Close();
6092
                                        instance.SignImage = returnImage;
6093
                                    }
6094
                                }
6095
6096
                                instance.MarkupInfoID = markupInfoID;
6097
                                instance.CommentID = commentId;
6098
                                baseLayer.Add(instance);
6099
                                instance.ApplyTemplate();
6100
                                instance.SetImage();
6101
                                return_control = instance;
6102
                            }
6103
                            break;
6104
                        #endregion
6105
                        #region Ink
6106
                        case "InkPresenter":
6107
                            using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
6108
                            {
6109
#if SILVERLIGHT
6110
                                this._InkBoard.Strokes = s.SCC; 
6111
#endif
6112
                            }
6113
                            break;
6114
                        #endregion
6115
                        #region Date
6116
                        case "DateControl":
6117
                            {
6118
                                using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item))
6119
                                {
6120
                                    string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
6121
                                    DateControl instance = new DateControl
6122
                                    {
6123
                                        Angle = s.Angle,
6124
                                        StartPoint = s.StartPoint,
6125
                                        EndPoint = s.EndPoint,
6126
                                        LeftBottomPoint = s.LB,
6127
                                        TopRightPoint = s.TR,
6128
                                        Opacity = s.Opac,
6129
                                        FontColor = _SetColor,
6130
                                        LineSize = Convert.ToDouble(data2.First()),
6131
                                        Text = s.Text,
6132
                                        PointSet = s.PointSet,
6133
                                        UserID = s.UserID
6134
                                    };
6135
                                    instance.Memo = s.Memo;
6136
                                    //Layer.Children.Add(instance);
6137
                                    instance.CommentID = commentId;
6138 4538d5e7 ljiyeon
                                    instance.MarkupInfoID = markupInfoID;
6139
                                    baseLayer.Add(instance);
6140
                                    
6141 1a503498 ljiyeon
                                    instance.ApplyTemplate();
6142
                                    instance.SetDate();
6143
                                    return_control = instance;
6144
                                }
6145
                            }
6146
                            break;
6147
                        #endregion
6148
                        #region Symbol
6149
                        case "SymControl":
6150
                            using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item))
6151
                            {
6152
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
6153
                                Common.StringToPathConverter sm = new Common.StringToPathConverter();
6154
                                SymControl instance = new SymControl()
6155
                                {
6156
                                    LineSize = Convert.ToDouble(data2.First()),
6157
                                    PointSet = s.PointSet,
6158
                                    Paint = s.PaintState,
6159
                                    StartPoint = s.StartPoint,
6160
                                    StrokeColor = _SetColor,
6161
                                    EndPoint = s.EndPoint,
6162
                                    Angle = s.Angle,
6163
                                    LeftBottomPoint = s.LB,
6164
                                    TopRightPoint = s.TR,
6165
                                    PathData = sm.Convert(s.PathInfo.ToString()),
6166
                                    Opacity = s.Opac,
6167
                                };
6168
6169
                                instance.Memo = s.Memo;
6170 4538d5e7 ljiyeon
                                
6171 1a503498 ljiyeon
                                instance.CommentID = commentId;
6172 4538d5e7 ljiyeon
                                instance.MarkupInfoID = markupInfoID;
6173
                                baseLayer.Add(instance);
6174 1a503498 ljiyeon
                                instance.ApplyTemplate();
6175
                                instance.SetSymPath();
6176
                                return_control = instance;
6177
                            }
6178
                            break;
6179
                        #endregion
6180
                        #region Image
6181
                        case "ImgControl":
6182
                            using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item))
6183
                            {
6184
                                Image img = new Image();
6185 53880c83 ljiyeon
                                //img.Source = new BitmapImage(new Uri(s.ImagePath));
6186
                                if (s.ImagePath.Contains(".svg"))
6187
                                {
6188
                                    byte[] imageData = null;
6189
                                    DrawingImage image = null;
6190
                                    using (System.Net.WebClient web = new System.Net.WebClient())
6191
                                    {
6192
                                        imageData = web.DownloadData(new Uri(s.ImagePath));
6193
                                        System.IO.Stream stream = new System.IO.MemoryStream(imageData);
6194
                                        image = SvgReader.Load(stream);
6195
                                    }
6196
                                    img.Source = image;
6197
                                }
6198
                                else
6199
                                {
6200
                                    img.Source = new BitmapImage(new Uri(s.ImagePath));
6201
                                }
6202 1a503498 ljiyeon
                                ImgControl instance = new ImgControl
6203
                                {
6204
                                    Angle = s.Angle,
6205
                                    StartPoint = s.StartPoint,
6206
                                    TopRightPoint = s.TR,
6207
                                    EndPoint = s.EndPoint,
6208
                                    LeftBottomPoint = s.LB,
6209
                                    PointSet = s.PointSet,
6210
                                    Opacity = s.Opac,
6211
                                    FilePath = s.ImagePath,
6212
                                    UserID = s.UserID,
6213
                                    ImageData = img.Source
6214
                                };
6215
                                //Layer.Children.Add(instance);
6216
                                instance.Memo = s.Memo;
6217 4538d5e7 ljiyeon
                                
6218 1a503498 ljiyeon
                                instance.CommentID = commentId;
6219 4538d5e7 ljiyeon
                                instance.MarkupInfoID = markupInfoID;
6220
                                baseLayer.Add(instance);
6221 1a503498 ljiyeon
                                instance.ApplyTemplate();
6222 53880c83 ljiyeon
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
6223
                                instance.ImageData = img.Source;
6224 1a503498 ljiyeon
                                instance.SetImage();
6225
                                return_control = instance;
6226
                            }
6227
                            break;
6228
                        #endregion
6229
                        #region SymbolN
6230
                        case "SymControlN":
6231
                            using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item))
6232
                            {
6233
                                SymControlN instance = new SymControlN()
6234
                                {
6235
                                    PointSet = s.PointSet,
6236
                                    StartPoint = s.StartPoint,
6237
                                    EndPoint = s.EndPoint,
6238
                                    Angle = s.Angle,
6239
                                    LeftBottomPoint = s.LB,
6240
                                    TopRightPoint = s.TR,
6241
                                    Opacity = s.Opac,
6242
                                    PathXathData = s.DBData,
6243
                                };
6244
                                instance.Memo = s.Memo;
6245 4538d5e7 ljiyeon
                                instance.CommentID = commentId;
6246 1a503498 ljiyeon
                                instance.MarkupInfoID = markupInfoID;
6247
                                baseLayer.Add(instance);
6248 4538d5e7 ljiyeon
                                
6249 1a503498 ljiyeon
                                instance.ApplyTemplate();
6250
6251
                                var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData);
6252
                                xamlData = xamlData.Replace("daelim", "DAELIM");
6253
                                System.IO.MemoryStream stream = new System.IO.MemoryStream();
6254
                                System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
6255
                                writer.Write(xamlData);
6256
                                writer.Flush();
6257
                                stream.Position = 0;
6258
6259
                                object obj = XamlReader.Load(stream);
6260
                                instance.Base_ViewBox.Child = obj as UIElement;
6261
                                instance.SetViewBox();
6262
                                return_control = instance;
6263
                            }
6264
                            break;
6265
                        #endregion
6266
                        default:
6267
6268
                            break;
6269
                    };
6270
                }
6271
            }
6272
            return return_control;
6273
        }
6274
6275 787a4489 KangIngu
    }
6276
}
클립보드 이미지 추가 (최대 크기: 500 MB)