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