프로젝트

일반

사용자정보

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

markus / MarkupToPDF / Controls / Parsing / MarkupParse.cs @ 036650a0

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