프로젝트

일반

사용자정보

개정판 661b7416

ID661b7416598de29c8ba957a702c8b0b2135eda3f
상위 8c66babd
하위 5529d2a2

백흠경이(가) 5년 이상 전에 추가함

issue #999: Add FromString to all of controls

Change-Id: I64093e34a5f9e8d367cbed769ff4db8d7472cb7a

차이점 보기:

MarkupToPDF/Controls/Parsing/MarkupParse.cs
59 59
            return Data;
60 60
        }
61 61

  
62
        /// <summary>
63
        /// create a commentuserinfo from given string
64
        /// </summary>
65
        /// <param name="str"></param>
66
        /// <returns></returns>
67
        public static CommentUserInfo FromString(string item, SolidColorBrush brush, string sProjectNo)
68
        {
69
            CommentUserInfo instance = null;
70
            var unkown= JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
71
            switch (unkown.Name)
72
            {
73
                #region Shape
74
                #region Rectangle
75
                case "RectangleControl":
76
                    instance = RectangleControl.FromString(item, brush, sProjectNo);
77
                    break;
78
                #endregion
79
                #region Triangle
80
                case "TriControl":
81
                    instance = TriControl.FromString(item, brush, sProjectNo);
82
                    break;
83
                #endregion
84
                #region Cicle
85
                case "CircleControl":
86
                    instance = CircleControl.FromString(item, brush, sProjectNo);
87
                    break;
88
                #endregion
89
                #region RectCloud
90
                case "RectCloudControl":
91
                    instance = RectCloudControl.FromString(item, brush, sProjectNo);
92
                    break;
93
                #endregion
94
                #endregion
95

  
96
                #region Polygon
97
                #region Poly
98
                case "PolygonControl":
99
                    instance = PolygonControl.FromString(item, brush, sProjectNo);
100
                    break;
101
                #endregion
102
                #region InkControl
103
                case "InkControl":
104
                    instance = InkControl.FromString(item, brush, sProjectNo);
105
                    break;
106
                #endregion
107
                #region Cloud
108
                case "CloudControl":
109
                    instance = CloudControl.FromString(item, brush, sProjectNo);
110
                    break;
111
                #endregion
112
                #endregion
113

  
114
                #region Line
115
                #region Line
116
                case "LineControl":
117
                    instance = LineControl.FromString(item, brush, sProjectNo);
118
                    break;
119
                #endregion
120
                #region Arrow_Multi
121
                case "ArrowControl_Multi":
122
                    instance = ArrowControl_Multi.FromString(item, brush, sProjectNo);
123
                    break;
124
                #endregion
125
                #region Arc
126
                case "ArcControl":
127
                    instance = ArcControl.FromString(item, brush, sProjectNo);
128
                    break;
129
                #endregion
130
                #region ArrowArc
131
                case "ArrowArcControl":
132
                    instance = ArrowArcControl.FromString(item, brush, sProjectNo);
133
                    break;
134
                #endregion
135
                #endregion
136
                #region Text
137
                case "TextControl":
138
                    instance = TextControl.FromString(item, brush, sProjectNo);
139
                    break;
140
                #endregion
141

  
142
                #region ArrowText
143
                case "ArrowTextControl":
144
                    instance = ArrowTextControl.FromString(item, brush, sProjectNo);
145
                    break;
146
                #endregion
147

  
148
                #region ETC
149
                #region Ink
150
                case "InkPresenter":
151
                    using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item))
152
                    {
153

  
154
                    }
155
                    break;
156
                #endregion
157
                #region Date
158
                case "DateControl":
159
                    instance = DateControl.FromString(item, brush, sProjectNo);
160
                    break;
161
                #endregion
162
                #region Image
163
                case "ImgControl":
164
                    instance = ImgControl.FromString(item, brush, sProjectNo);
165
                    break;
166
                #endregion
167
                #region Sign
168
                case "SignControl":
169
                    instance = SignControl.FromString(item, brush, sProjectNo);
170
                    break;
171
                #endregion
172
                #region Symbol
173
                case "SymControl":
174
                    instance = SymControl.FromString(item, brush, sProjectNo);
175
                    break;
176
                #endregion
177

  
178
                #region SymbolN
179
                case "SymControlN":
180
                    instance = SymControlN.FromString(item, brush, sProjectNo);
181
                    break;
182
                #endregion
183
                #endregion
184

  
185
                #region Cad
186
                case "InsideWhiteControl":
187
                    instance = InsideWhiteControl.FromString(item, brush, sProjectNo);
188
                    break;
189
                case "OverlapWhiteControl":
190
                    instance = OverlapWhiteControl.FromString(item, brush, sProjectNo);
191
                    break;
192
                case "ClipWhiteControl":
193
                    instance = ClipWhiteControl.FromString(item, brush, sProjectNo);
194
                    break;
195
                case "CoordinateControl":
196
                    instance = CoordinateControl.FromString(item, brush, sProjectNo);
197
                    break;
198
                #endregion
199
                default:
200
                    break;
201
            }
202

  
203
            return instance;
204
        }
205

  
206
        /// <summary>
207
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
208
        /// </summary>
209
        /// <param name="MarkupString"></param>
210
        public static Control ParseEx(string sProjectNo, string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId=null)
211
        {
212
            Control res = null;
213

  
214
            if (MarkupString != "False")
215
            {
216
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
217
                string[] delimiterChars = { "|DZ|" };
218
                string[] delimiterChars2 = { "|" };
219
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
220

  
221
                foreach (var dataPease in data)
222
                {
223
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
224
                    CommentUserInfo control = MarkupParser.FromString(item, _SetColor, sProjectNo);
225
                    res = control as Control;
226
                    if (control != null)
227
                    {
228
                        if(!string.IsNullOrEmpty(commentId)) control.CommentID = commentId;
229
                        control.MarkupInfoID = markupInfoID;
230
                        baseLayer.Add(control);
231
                        control.ApplyTemplate();
232
                        control.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
233

  
234
                        if (control is ArrowTextControl)
235
                        {
236
                            ArrowTextControl _instance = control as ArrowTextControl;
237
                            if (_instance.UnderLine == TextDecorations.Underline)
238
                            {
239
                                _instance.Base_TextBox.TextDecorations = _instance.UnderLine;
240
                            }
241
                            _instance.Base_TextBox.IsHitTestVisible = false;
242
                        }
243
                        else if (control is TextControl)
244
                        {
245
                            TextControl text = control as TextControl;
246
                            text.Base_TextBlock.TextDecorations = text.UnderLine;
247
                            text.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0);
248
                            text.Base_TextBox.Visibility = Visibility.Collapsed;
249
                            text.Base_TextBlock.Visibility = Visibility.Visible;
250
                        }
251
                        else if (control is SymControlN)
252
                        {
253
                            SymControlN _instance = control as SymControlN;
254

  
255
                            var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(_instance.PathXathData);
256
                            xamlData = xamlData.Replace("daelim", "DAELIM");
257
                            System.IO.MemoryStream stream = new System.IO.MemoryStream();
258
                            System.IO.StreamWriter writer = new System.IO.StreamWriter(stream);
259
                            writer.Write(xamlData);
260
                            writer.Flush();
261
                            stream.Position = 0;
262

  
263
                            object obj = XamlReader.Load(stream);
264
                            _instance.Base_ViewBox.Child = obj as UIElement;
265
                            _instance.SetViewBox();
266
                        }
267
                    }
268
                }
269
            }
270

  
271
            return res;
272
        }
273

  
62 274
        //GUID생성(최민수 사원 수정)
63 275
        private static string shortGuid()
64 276
        {
......
2894 3106

  
2895 3107
                                Layer.Children.Add(instance);
2896 3108
                                instance.ApplyTemplate();
2897
                                instance.SetRectPath();
2898 3109
                            }
2899 3110
                            break;
2900 3111
                        #endregion
......
2920 3131

  
2921 3132
                                Layer.Children.Add(instance);
2922 3133
                                instance.ApplyTemplate();
2923
                                instance.SetTri();
2924 3134
                            }
2925 3135
                            break;
2926 3136
                        #endregion
......
2947 3157

  
2948 3158
                                Layer.Children.Add(instance);
2949 3159
                                instance.ApplyTemplate();
2950
                                instance.SetCircle();
2951 3160
                            }
2952 3161
                            break;
2953 3162
                        #endregion
......
2974 3183

  
2975 3184
                                Layer.Children.Add(instance);
2976 3185
                                instance.ApplyTemplate();
2977
                                instance.SetRectCloud();
2978 3186
                            }
2979 3187
                            break;
2980 3188
                        #endregion
......
3007 3215
                                Layer.Children.Add(instance);
3008 3216

  
3009 3217
                                instance.ApplyTemplate();
3010
                                instance.SetPolyPath();
3011 3218

  
3012 3219
                                //instance.PointSet = s.PointSet;
3013 3220
                                //instance.ClosePath();
......
3041 3248
                                Layer.Children.Add(instance);
3042 3249

  
3043 3250
                                instance.ApplyTemplate();
3044
                                instance.SetPolyPath();
3045 3251

  
3046 3252
                                //instance.PointSet = s.PointSet;
3047 3253
                                //instance.ClosePath();
......
3104 3310
                                };
3105 3311
                                Layer.Children.Add(instance);
3106 3312
                                instance.ApplyTemplate();
3107
                                instance.SetLinePath();
3108 3313
                            }
3109 3314
                            break;
3110 3315
                        #endregion
......
3156 3361

  
3157 3362
                                Layer.Children.Add(instance);
3158 3363
                                instance.ApplyTemplate();
3159
                                instance.SetArcPath();
3160 3364
                            }
3161 3365
                            break;
3162 3366
                        #endregion
......
3284 3488
                                    instance.UnderLine = TextDecorations.Underline;
3285 3489
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
3286 3490
                                }
3287
                                instance.SetArrowTextPath();
3288 3491

  
3289 3492
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3290 3493
                            };
......
3314 3517

  
3315 3518
                                    Layer.Children.Add(instance);
3316 3519
                                    instance.ApplyTemplate();
3317
                                    instance.SetDate();
3318 3520
                                }
3319 3521
                            }
3320 3522
                            break;
......
3388 3590
                                instance.Memo = s.Memo;
3389 3591
                                Layer.Children.Add(instance);
3390 3592
                                instance.ApplyTemplate();
3391
                                instance.SetSymPath();
3392 3593
                            }
3393 3594
                            break;
3394 3595
                        #endregion
......
3453 3654

  
3454 3655
                                if (s.UserNumber != null)
3455 3656
                                {
3456
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
3657
                                    var _sign = GetUserSign.GetSign(s.UserNumber, ProjectNo);
3457 3658
                                    if (_sign != null)
3458 3659
                                    {
3459 3660
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
......
3478 3679
                                instance.Memo = s.Memo;
3479 3680
                                Layer.Children.Add(instance);
3480 3681
                                instance.ApplyTemplate();
3481
                                instance.SetImage();
3482 3682
                            }
3483 3683
                            break;
3484 3684
                        #endregion
......
3597 3797
            }
3598 3798
        }
3599 3799

  
3800
        /*
3600 3801
        /// <summary>
3601 3802
        /// 데이터베이스의 마크업데이터를 컨트롤로 변환한다.
3602 3803
        /// </summary>
......
3669 3870
                                    instance.UnderLine = TextDecorations.Underline;
3670 3871
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
3671 3872
                                }
3672
                                instance.SetArrowTextPath();
3673 3873
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
3674 3874
                            };
3675 3875
                            break;
......
3729 3929
                                instance.MarkupInfoID = markupInfoID;
3730 3930
                                baseLayer.Add(instance);
3731 3931
                                instance.ApplyTemplate();
3732
                                instance.SetRectPath();
3733 3932
                            }
3734 3933
                            break;
3735 3934
                        #endregion
......
3757 3956
                                instance.MarkupInfoID = markupInfoID;
3758 3957
                                baseLayer.Add(instance);
3759 3958
                                instance.ApplyTemplate();
3760
                                instance.SetTri();
3761 3959
                            }
3762 3960
                            break;
3763 3961
                        #endregion
......
3786 3984
                                instance.MarkupInfoID = markupInfoID;
3787 3985
                                baseLayer.Add(instance);
3788 3986
                                instance.ApplyTemplate();
3789
                                instance.SetCircle();
3790 3987
                            }
3791 3988
                            break;
3792 3989
                        #endregion
......
3818 4015
                                baseLayer.Add(instance);
3819 4016
                                instance.Memo = s.Memo;
3820 4017
                                instance.ApplyTemplate();
3821
                                instance.SetPolyPath();
3822 4018

  
3823 4019
                                //instance.PointSet = s.PointSet;
3824 4020
                                //instance.ClosePath();
......
3854 4050
                                baseLayer.Add(instance);
3855 4051
                                instance.Memo = s.Memo;
3856 4052
                                instance.ApplyTemplate();
3857
                                instance.SetPolyPath();
3858 4053

  
3859 4054
                                //instance.PointSet = s.PointSet;
3860 4055
                                //instance.ClosePath();
......
3919 4114
                                instance.MarkupInfoID = markupInfoID;
3920 4115
                                baseLayer.Add(instance);
3921 4116
                                instance.ApplyTemplate();
3922
                                instance.SetLinePath();
3923 4117
                            }
3924 4118
                            break;
3925 4119
                        #endregion
......
3999 4193
                                instance.MarkupInfoID = markupInfoID;
4000 4194
                                baseLayer.Add(instance);
4001 4195
                                instance.ApplyTemplate();
4002
                                instance.SetArcPath();
4003 4196
                            }
4004 4197
                            break;
4005 4198
                        #endregion
......
4056 4249
                                instance.MarkupInfoID = markupInfoID;
4057 4250
                                baseLayer.Add(instance);
4058 4251
                                instance.ApplyTemplate();
4059
                                instance.SetRectCloud();
4060 4252
                            }
4061 4253
                            break;
4062 4254
                        #endregion
......
4081 4273

  
4082 4274
                                if (s.UserNumber != null)
4083 4275
                                {
4084
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
4276
                                    var _sign = GetUserSign.GetSign(s.UserNumber, ProjectNo);
4085 4277
                                    if (_sign != null)
4086 4278
                                    {
4087 4279
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
......
4107 4299
                                instance.MarkupInfoID = markupInfoID;
4108 4300
                                baseLayer.Add(instance);
4109 4301
                                instance.ApplyTemplate();
4110
                                instance.SetImage();
4111 4302

  
4112 4303
                                //baseLayer.Add(instance);
4113 4304
                                //instance.ApplyTemplate();
......
4151 4342
                                    //Layer.Children.Add(instance);
4152 4343
                                    baseLayer.Add(instance);
4153 4344
                                    instance.ApplyTemplate();
4154
                                    instance.SetDate();
4155 4345
                                }
4156 4346
                            }
4157 4347
                            break;
......
4181 4371
                                instance.MarkupInfoID = markupInfoID;
4182 4372
                                baseLayer.Add(instance);                                
4183 4373
                                instance.ApplyTemplate();
4184
                                instance.SetSymPath();
4185 4374
                            }
4186 4375
                            break;
4187 4376
                        #endregion
......
4393 4582
                }
4394 4583
            }
4395 4584
        }
4585
        */
4396 4586

  
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)
4587
        //강인구 추가(12/12)
4588
        public Control markupParse_Paste(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer)
4403 4589
        {
4590
            CommentUserInfo instance = null;
4404 4591
            if (MarkupString != "False")
4405 4592
            {
4593
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(""));
4594
                string[] delimiterChars = { "|DZ|" };
4595
                string[] delimiterChars2 = { "|" };
4596
                string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
4597

  
4598
                foreach (var dataPease in data)
4599
                {
4600
                    var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업
4601
                    instance = MarkupParser.FromString(item, _SetColor, this.ProjectNo);
4602
                    if (instance != null)
4603
                    {
4604
                        baseLayer.Add(instance);
4605
                        instance.ApplyTemplate();
4606
                    }
4607
                }
4608
            }
4609

  
4610
            return instance;
4611
        }
4612

  
4613
        public S_BaseControl markupParse_GetBaseControl(string MarkupString)
4614
        {
4615
            var item = JsonSerializerHelper.UnCompressString(MarkupString); //언패킹작업
4616
            var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업
4617
            return unknownData;
4618
        }
4619
        
4620
        /*
4621
        //Temp
4622
        public Control TempMarkupParseEx(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId)
4623
        {
4624
            Control return_control = new Control();
4625
            if (MarkupString != "False")
4626
            {   
4406 4627
                SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor));
4407 4628
                //SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red);
4408 4629
                string[] delimiterChars = { "|DZ|" };
......
4420 4641
                        case "ArrowTextControl":
4421 4642
                            using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item))
4422 4643
                            {
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 4644
                                #region 신규
4468 4645
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
4469 4646
                                ArrowTextControl instance = new ArrowTextControl();
......
4513 4690
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
4514 4691
                                }
4515 4692

  
4516
                                instance.SetArrowTextPath();
4517 4693
                                instance.Base_TextBox.IsHitTestVisible = false;
4518 4694
                                instance.CommentID = commentId;
4519 4695
                                #endregion
4520 4696

  
4521 4697

  
4698
                                return_control = instance;
4699

  
4522 4700
                            };
4523 4701
                            break;
4524 4702
                        #endregion
......
4541 4719
                                };
4542 4720

  
4543 4721
                                //Layer.Children.Add(instance);
4722
                                instance.Memo = s.Memo;
4544 4723
                                instance.CommentID = commentId;
4545 4724
                                instance.MarkupInfoID = markupInfoID;
4546 4725
                                baseLayer.Add(instance);
4547 4726
                                instance.ApplyTemplate();
4548
                                instance.SetArrowMultiPath();
4549
                                instance.Memo = s.Memo;                                
4727
                                instance.SetArrowMultiPath();                                
4550 4728
                                instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage);
4551

  
4729
                                
4730
                                return_control = instance;
4552 4731
                            }
4553 4732
                            break;
4554 4733
                        #endregion
......
4579 4758
                                instance.MarkupInfoID = markupInfoID;
4580 4759
                                baseLayer.Add(instance);
4581 4760
                                instance.ApplyTemplate();
4582
                                instance.SetRectPath();
4761

  
4762
                                return_control = instance;
4583 4763
                            }
4584 4764
                            break;
4585 4765
                        #endregion
......
4608 4788
                                instance.MarkupInfoID = markupInfoID;
4609 4789
                                baseLayer.Add(instance);
4610 4790
                                instance.ApplyTemplate();
4611
                                instance.SetTri();
4791
                                return_control = instance;
4612 4792
                            }
4613 4793
                            break;
4614 4794
                        #endregion
......
4638 4818
                                instance.MarkupInfoID = markupInfoID;
4639 4819
                                baseLayer.Add(instance);
4640 4820
                                instance.ApplyTemplate();
4641
                                instance.SetCircle();
4821
                                return_control = instance;
4642 4822
                            }
4643 4823
                            break;
4644 4824
                        #endregion
......
4672 4852
                                
4673 4853
                                instance.Memo = s.Memo;
4674 4854
                                instance.ApplyTemplate();
4675
                                instance.SetPolyPath();
4676

  
4855
                                return_control = instance;
4677 4856
                                //instance.PointSet = s.PointSet;
4678 4857
                                //instance.ClosePath();
4679 4858
                                //instance.ChangePaint(s.PaintState);
......
4710 4889
                                
4711 4890
                                instance.Memo = s.Memo;
4712 4891
                                instance.ApplyTemplate();
4713
                                instance.SetPolyPath();
4714

  
4892
                                return_control = instance;
4715 4893
                                //instance.PointSet = s.PointSet;
4716 4894
                                //instance.ClosePath();
4717 4895
                                //instance.ChangePaint(s.PaintState);
......
4750 4928
                                instance.ApplyTemplate();
4751 4929
                                instance.ClosePath();
4752 4930
                                instance.ChangePaint(s.PaintState);
4931
                                return_control = instance;
4753 4932
                            }
4754 4933
                            break;
4755 4934
                        #endregion
......
4778 4957
                                instance.MarkupInfoID = markupInfoID;
4779 4958
                                baseLayer.Add(instance);
4780 4959
                                instance.ApplyTemplate();
4781
                                instance.SetLinePath();
4960
                                return_control = instance;
4782 4961
                            }
4783 4962
                            break;
4784 4963
                        #endregion
......
4787 4966
                            using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item))
4788 4967
                            {
4789 4968
                                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
                                    IsHighLight = s.isHighLight,
4806
                                    Angle = s.Angle,
4807
                                    PointSet = s.PointSet,
4808
                                    Opacity = s.Opac,
4809
                                    TextFamily = new FontFamily(s.fontConfig[0]),
4810
                                    //인구 추가(2018.04.17)
4811
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
4812
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
4813
                                };
4969
                                TextControl instance = new TextControl();
4970

  
4971
                                instance.Text = s.Text;
4972
                                instance.StartPoint = s.StartPoint;
4973
                                instance.EndPoint = s.EndPoint;
4974
                                instance.CanvasX = s.StartPoint.X;
4975
                                instance.CanvasY = s.StartPoint.Y;
4976
                                instance.BoxWidth = s.BoxW;
4977
                                instance.BoxHeight = s.BoxH;
4978
                                instance.ControlType_No = s.paintMethod;
4979
                                instance.LineSize = new Thickness(Convert.ToDouble(data2.First()));
4980
                                instance.TextSize = Convert.ToDouble(data2[1]);
4981
                                instance.FontColor = _SetColor;
4982
                                //FontSize = 10,
4983
                                instance.UserID = s.UserID;
4984
                                instance.IsHighLight = s.isHighLight;
4985
                                instance.Angle = s.Angle;
4986
                                instance.PointSet = s.PointSet;
4987
                                instance.Opacity = s.Opac;
4988
                                instance.TextFamily = new FontFamily(s.fontConfig[0]);
4989
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
4990
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);                                
4814 4991

  
4815 4992
                                if (instance.Text != null)
4816 4993
                                {
4817 4994
                                    //Layer.Children.Add(instance);
4818 4995
                                    instance.MarkupInfoID = markupInfoID;
4819
                                    instance.CommentID = commentId;
4820
                                    instance.Memo = s.Memo;
4821
                                    baseLayer.Add(instance);                                    
4996
                                    baseLayer.Add(instance);
4997
                                    System.Diagnostics.Debug.WriteLine(instance.Angle);
4822 4998
                                    instance.ApplyTemplate();
4823
                                    
4999
                                    instance.Memo = s.Memo;
4824 5000
                                    if (s.fontConfig.Count() == 4)
4825 5001
                                    {
4826 5002
                                        instance.UnderLine = TextDecorations.Underline;
......
4833 5009
                                    instance.Base_TextBox.Visibility = Visibility.Collapsed;
4834 5010
                                    instance.Base_TextBlock.Visibility = Visibility.Visible;
4835 5011

  
5012
                                    instance.CommentID = commentId;
4836 5013
                                    //instance.DrawingCloud();
4837
                                    
5014
                                    //instance.SetText();
5015
                                    return_control = instance;
4838 5016
                                }
4839 5017
                            }
4840 5018
                            break;
......
4860 5038
                                };
4861 5039
                                instance.Memo = s.Memo;
4862 5040
                                //Layer.Children.Add(instance);
4863
                                instance.CommentID = commentId;
4864 5041
                                instance.MarkupInfoID = markupInfoID;
5042
                                instance.CommentID = commentId;
4865 5043
                                baseLayer.Add(instance);
4866 5044
                                
4867 5045
                                instance.ApplyTemplate();
4868
                                instance.SetArcPath();
5046
                                return_control = instance;
4869 5047
                            }
4870 5048
                            break;
4871 5049
                        #endregion
4872
                        #region ArrowArc
5050
                        #region Arc
4873 5051
                        case "ArrowArcControl":
4874 5052
                            using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item))
4875 5053
                            {
......
4890 5068
                                };
4891 5069
                                instance.Memo = s.Memo;
4892 5070
                                //Layer.Children.Add(instance);
4893
                                instance.CommentID = commentId;
4894 5071
                                instance.MarkupInfoID = markupInfoID;
5072
                                instance.CommentID = commentId;
4895 5073
                                baseLayer.Add(instance);
4896 5074
                                
4897 5075
                                instance.ApplyTemplate();
4898 5076
                                instance.SetArcPath();
5077
                                return_control = instance;
4899 5078
                            }
4900 5079
                            break;
4901 5080
                        #endregion
4902
                        
4903 5081
                        #region RectCloud
4904 5082
                        case "RectCloudControl":
4905 5083
                            using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item))
......
4922 5100
                                };
4923 5101
                                instance.Memo = s.Memo;
4924 5102
                                //Layer.Children.Add(instance);
4925
                                instance.CommentID = commentId;
4926 5103
                                instance.MarkupInfoID = markupInfoID;
5104
                                instance.CommentID = commentId;
4927 5105
                                baseLayer.Add(instance);
4928 5106
                                
4929 5107
                                instance.ApplyTemplate();
4930
                                instance.SetRectCloud();
5108
                                return_control = instance;
4931 5109
                            }
4932 5110
                            break;
4933 5111
                        #endregion
......
4952 5130

  
4953 5131
                                if (s.UserNumber != null)
4954 5132
                                {
4955
                                    var _sign = getUser.GetSign(s.UserNumber, ProjectNo);
5133
                                    var _sign = GetUserSign.GetSign(s.UserNumber, ProjectNo);
4956 5134
                                    if (_sign != null)
4957 5135
                                    {
4958 5136
                                        byte[] imageBytes = System.Convert.FromBase64String(_sign);
......
4977 5155
                                instance.CommentID = commentId;
4978 5156
                                baseLayer.Add(instance);
4979 5157
                                instance.ApplyTemplate();
4980
                                instance.SetImage();
5158
                                return_control = instance;
4981 5159
                            }
4982 5160
                            break;
4983 5161
                        #endregion
......
5013 5191
                                    };
5014 5192
                                    instance.Memo = s.Memo;
5015 5193
                                    //Layer.Children.Add(instance);
5016
                                    instance.MarkupInfoID = markupInfoID;
5017 5194
                                    instance.CommentID = commentId;
5195
                                    instance.MarkupInfoID = markupInfoID;
5018 5196
                                    baseLayer.Add(instance);
5019 5197
                                    
5020 5198
                                    instance.ApplyTemplate();
5021
                                    instance.SetDate();
5199
                                    return_control = instance;
5022 5200
                                }
5023 5201
                            }
5024 5202
                            break;
......
5045 5223
                                };
5046 5224

  
5047 5225
                                instance.Memo = s.Memo;
5048
                                instance.MarkupInfoID = markupInfoID;
5226
                                
5049 5227
                                instance.CommentID = commentId;
5228
                                instance.MarkupInfoID = markupInfoID;
5050 5229
                                baseLayer.Add(instance);
5051 5230
                                instance.ApplyTemplate();
5052
                                instance.SetSymPath();
5231
                                return_control = instance;
5053 5232
                            }
5054 5233
                            break;
5055 5234
                        #endregion
......
5086 5265
                                    Opacity = s.Opac,
5087 5266
                                    FilePath = s.ImagePath,
5088 5267
                                    UserID = s.UserID,
5089
                                  //  ImageData = img.Source
5090
                                    
5268
                                    ImageData = img.Source
5091 5269
                                };
5092 5270
                                //Layer.Children.Add(instance);
5093 5271
                                instance.Memo = s.Memo;
5094 5272
                                
5095
                                instance.MarkupInfoID = markupInfoID;
5096 5273
                                instance.CommentID = commentId;
5274
                                instance.MarkupInfoID = markupInfoID;
5097 5275
                                baseLayer.Add(instance);
5098

  
5099 5276
                                instance.ApplyTemplate();
5100 5277
                                //instance.ImageData = new BitmapImage(new Uri(s.ImagePath));
5101 5278
                                instance.ImageData = img.Source;
5102 5279
                                instance.SetImage();
5103

  
5280
                                return_control = instance;
5104 5281
                            }
5105 5282
                            break;
5106 5283
                        #endregion
......
5135 5312
                                stream.Position = 0;
5136 5313

  
5137 5314
                                object obj = XamlReader.Load(stream);
5138
                                instance.Base_ViewBox.Child = obj as UIElement;                                
5315
                                instance.Base_ViewBox.Child = obj as UIElement;
5139 5316
                                instance.SetViewBox();
5317
                                return_control = instance;
5140 5318
                            }
5141 5319
                            break;
5142 5320
                        #endregion
......
5170 5348
                                baseLayer.Add(instance);
5171 5349
                                instance.ApplyTemplate();
5172 5350
                                instance.SetRectPath();
5351

  
5352
                                return_control = instance;
5173 5353
                            }
5174 5354
                            break;
5175 5355
                        case "OverlapWhiteControl":
......
5200 5380
                                baseLayer.Add(instance);
5201 5381
                                instance.ApplyTemplate();
5202 5382
                                instance.SetRectPath();
5383

  
5384
                                return_control = instance;
5203 5385
                            }
5204 5386
                            break;
5205 5387
                        case "ClipWhiteControl":
......
5230 5412
                                baseLayer.Add(instance);
5231 5413
                                instance.ApplyTemplate();
5232 5414
                                instance.SetRectPath();
5415

  
5416
                                return_control = instance;
5233 5417
                            }
5234 5418
                            break;
5235 5419
                        case "CoordinateControl":
......
5260 5444
                                baseLayer.Add(instance);
5261 5445
                                instance.ApplyTemplate();
5262 5446
                                instance.SetRectPath();
5447

  
5448
                                return_control = instance;
5263 5449
                            }
5264 5450
                            break;
5265 5451
                        #endregion
......
5269 5455
                    };
5270 5456
                }
5271 5457
            }
5458
            return return_control;
5272 5459
        }
5273

  
5274
        //강인구 추가(12/12)
5275
        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
                                    ArcLength = s.ArcLength,
5391
                                    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
                        #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

  
5597
                                    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
                        #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
                                    IsHighLight = s.isHighLight,
5631
                                    Angle = s.Angle,
5632
                                    PointSet = s.PointSet,
5633
                                    Opacity = s.Opac,
5634
                                    TextFamily = new FontFamily(s.fontConfig[0]),
5635
                                    //인구 추가(2018.04.17)
5636
                                    TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]),
5637
                                    TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]),
5638
                                };                              
5639

  
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

  
5658
                                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
                                string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries);
5668
                                ArrowTextControl instance = new ArrowTextControl();
5669
                                instance.LineSize = Convert.ToDouble(data2.First());
5670
                                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
                                //인구 추가(2018.04.17)
5698
                                instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]);
5699
                                instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]);
5700
                                instance.TextSize = Convert.ToDouble(s.fontConfig[3]);
5701

  
5702
                                baseLayer.Add(instance);
5703
                                instance.ApplyTemplate();
5704

  
5705
                                if (s.fontConfig.Count() == 5)
5706
                                {
5707
                                    instance.UnderLine = TextDecorations.Underline;
5708
                                    instance.Base_TextBox.TextDecorations = instance.UnderLine;
5709
                                }
5710
                                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
                                //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
                                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
                                instance.ImageData = img.Source;
5791
                                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,
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

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