markus / MarkupToPDF / Controls / Parsing / MarkupParse.cs @ 684ef11c
이력 | 보기 | 이력해설 | 다운로드 (407 KB)
1 |
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 |
using Svg2Xaml; |
30 |
using MarkupToPDF.Controls.Cad; |
31 |
|
32 |
namespace MarkupToPDF.Controls.Parsing |
33 |
{ |
34 |
public partial class LayerControl : Control |
35 |
{ |
36 |
public GetUserSign getUser = new GetUserSign(); |
37 |
//public string appovalData = "eJyycS/KTFHwS8xNtVVKBAMlhYrcnLxiW6WMkpICK3394uSM1NzEYr3czOSi/OL8tBK95Pxc/fLMvLQKfSMDAzP9isTcHP2CotTi1LySxJLM/DwlOxuQqXpOicnZ6UX5pXkpdjbB+TmZKc75OflFTkWlxRkKYKatkrIbFCgp+BckJmeWVNoqGegZKino29noYxgSlJpckpiXnpOqEFxSlFqSnGGr5JaZk6ME4uZnp0KNMwACmFBIRmZydl5qMdA7pjAxn8y8VK/8zDxbpSCQsUpQ38MNV1IIz0wpAZptZADU45GamZ5RYqtkYamk4JyYVwYMCZ/UNKCArpGeKVwoJL8AJqIP8T00DILyy11S0zLzMkEBUwz0AjIfbrgWWBt2OWM9U3zSBviljfBJaiGFM7pDQ1IrSpxy8pOzFUAsWyXHgIAg/zBXFyUFt/y8knCoCa4VJUWJTvk5KRDh4MwqYEgaG4B4RamQaEOJFY/8oswqoMLEHMeczPS8XGCSsVVyBpKpRUoKYalFJZnJWKVgTrRVgqQNdNc5VSqkJKbmZOYS4TwjWjrPGBGkMAoAAAD//w=="; |
38 |
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 |
|
2809 |
//프린트 |
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 |
ArcLength = s.ArcLength, |
2926 |
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 |
instance.PointSet = s.PointSet; |
3031 |
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 |
#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 |
|
3137 |
Layer.Children.Add(instance); |
3138 |
instance.ApplyTemplate(); |
3139 |
instance.SetArcPath(); |
3140 |
} |
3141 |
break; |
3142 |
#endregion |
3143 |
#endregion |
3144 |
#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 |
//인구 추가(2018.04.17) |
3170 |
TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]), |
3171 |
TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]), |
3172 |
}; |
3173 |
|
3174 |
if (instance.Text != null) |
3175 |
{ |
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 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
3200 |
ArrowTextControl instance = new ArrowTextControl(); |
3201 |
Layer.Children.Add(instance); |
3202 |
instance.LineSize = Convert.ToDouble(data2.First()); |
3203 |
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 |
//인구 추가(2018.04.17) |
3231 |
instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]); |
3232 |
instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]); |
3233 |
instance.TextSize = Convert.ToDouble(s.fontConfig[3]); |
3234 |
|
3235 |
instance.ApplyTemplate(); |
3236 |
|
3237 |
if (s.fontConfig.Count() == 5) |
3238 |
{ |
3239 |
instance.UnderLine = TextDecorations.Underline; |
3240 |
instance.Base_TextBox.TextDecorations = instance.UnderLine; |
3241 |
} |
3242 |
instance.SetArrowTextPath(); |
3243 |
|
3244 |
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 |
//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 |
|
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 |
//instance.ImageData = new BitmapImage(new Uri(s.ImagePath)); |
3317 |
instance.ImageData = img.Source; |
3318 |
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 |
//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 |
} |
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 |
#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 |
|
3541 |
Layer.Children.Add(instance); |
3542 |
instance.ApplyTemplate(); |
3543 |
instance.SetRectPath(); |
3544 |
} |
3545 |
break; |
3546 |
#endregion |
3547 |
|
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 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
3582 |
ArrowTextControl instance = new ArrowTextControl(); |
3583 |
instance.MarkupInfoID = markupInfoID; |
3584 |
//Layer.Children.Add(instance); |
3585 |
baseLayer.Add(instance); |
3586 |
instance.LineSize = Convert.ToDouble(data2.First()); |
3587 |
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 |
//인구 추가(2018.04.17) |
3617 |
instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]); |
3618 |
instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]); |
3619 |
instance.TextSize = Convert.ToDouble(s.fontConfig[3]); |
3620 |
instance.ApplyTemplate(); |
3621 |
|
3622 |
if (s.fontConfig.Count() == 5) |
3623 |
{ |
3624 |
instance.UnderLine = TextDecorations.Underline; |
3625 |
instance.Base_TextBox.TextDecorations = instance.UnderLine; |
3626 |
} |
3627 |
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 |
//인구 추가(2018.04.17) |
3907 |
TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]), |
3908 |
TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]), |
3909 |
}; |
3910 |
|
3911 |
if (instance.Text != null) |
3912 |
{ |
3913 |
//Layer.Children.Add(instance); |
3914 |
instance.MarkupInfoID = markupInfoID; |
3915 |
baseLayer.Add(instance); |
3916 |
System.Diagnostics.Debug.WriteLine(instance.Angle); |
3917 |
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 |
instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0); |
3925 |
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 |
#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 |
#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 |
ArcLength = s.ArcLength, |
4006 |
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 |
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 |
instance.MarkupInfoID = markupInfoID; |
4137 |
baseLayer.Add(instance); |
4138 |
instance.ApplyTemplate(); |
4139 |
instance.SetSymPath(); |
4140 |
} |
4141 |
break; |
4142 |
#endregion |
4143 |
#region Image |
4144 |
case "ImgControl": |
4145 |
using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item)) |
4146 |
{ |
4147 |
Image img = new Image(); |
4148 |
//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 |
|
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 |
|
4182 |
instance.MarkupInfoID = markupInfoID; |
4183 |
baseLayer.Add(instance); |
4184 |
instance.ApplyTemplate(); |
4185 |
//instance.ImageData = new BitmapImage(new Uri(s.ImagePath)); |
4186 |
instance.ImageData = img.Source; |
4187 |
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 |
baseLayer.Add(instance); |
4210 |
instance.ApplyTemplate(); |
4211 |
|
4212 |
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 |
|
4221 |
object obj = XamlReader.Load(stream); |
4222 |
instance.Base_ViewBox.Child = obj as UIElement; |
4223 |
instance.SetViewBox(); |
4224 |
} |
4225 |
break; |
4226 |
#endregion |
4227 |
#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 |
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 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
4424 |
ArrowTextControl instance = new ArrowTextControl(); |
4425 |
instance.MarkupInfoID = markupInfoID; |
4426 |
//Layer.Children.Add(instance); |
4427 |
baseLayer.Add(instance); |
4428 |
instance.ApplyTemplate(); |
4429 |
instance.LineSize = Convert.ToDouble(data2.First()); |
4430 |
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 |
//인구 추가(2018.04.17) |
4461 |
instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]); |
4462 |
instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]); |
4463 |
instance.TextSize = Convert.ToDouble(s.fontConfig[3]); |
4464 |
|
4465 |
if (s.fontConfig.Count() == 5) |
4466 |
{ |
4467 |
instance.UnderLine = TextDecorations.Underline; |
4468 |
instance.Base_TextBox.TextDecorations = instance.UnderLine; |
4469 |
} |
4470 |
|
4471 |
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 |
instance.CommentID = commentId; |
4500 |
instance.MarkupInfoID = markupInfoID; |
4501 |
baseLayer.Add(instance); |
4502 |
instance.ApplyTemplate(); |
4503 |
instance.SetArrowMultiPath(); |
4504 |
instance.Memo = s.Memo; |
4505 |
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 |
instance.CommentID = commentId; |
4625 |
instance.MarkupInfoID = markupInfoID; |
4626 |
baseLayer.Add(instance); |
4627 |
|
4628 |
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 |
instance.CommentID = commentId; |
4663 |
instance.MarkupInfoID = markupInfoID; |
4664 |
baseLayer.Add(instance); |
4665 |
|
4666 |
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 |
instance.CommentID = commentId; |
4701 |
instance.MarkupInfoID = markupInfoID; |
4702 |
baseLayer.Add(instance); |
4703 |
|
4704 |
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 |
//인구 추가(2018.04.17) |
4766 |
TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]), |
4767 |
TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]), |
4768 |
}; |
4769 |
|
4770 |
if (instance.Text != null) |
4771 |
{ |
4772 |
//Layer.Children.Add(instance); |
4773 |
instance.CommentID = commentId; |
4774 |
instance.MarkupInfoID = markupInfoID; |
4775 |
baseLayer.Add(instance); |
4776 |
System.Diagnostics.Debug.WriteLine(instance.Angle); |
4777 |
instance.ApplyTemplate(); |
4778 |
instance.Memo = s.Memo; |
4779 |
if (s.fontConfig.Count() == 4) |
4780 |
{ |
4781 |
instance.UnderLine = TextDecorations.Underline; |
4782 |
instance.Base_TextBlock.TextDecorations = instance.UnderLine; |
4783 |
} |
4784 |
instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0); |
4785 |
|
4786 |
//instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4); |
4787 |
|
4788 |
instance.Base_TextBox.Visibility = Visibility.Collapsed; |
4789 |
instance.Base_TextBlock.Visibility = Visibility.Visible; |
4790 |
|
4791 |
|
4792 |
instance.DrawingCloud(); |
4793 |
instance.SetText(); |
4794 |
} |
4795 |
} |
4796 |
break; |
4797 |
#endregion |
4798 |
#region Arc |
4799 |
case "ArcControl": |
4800 |
using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item)) |
4801 |
{ |
4802 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
4803 |
ArcControl instance = new ArcControl() |
4804 |
{ |
4805 |
StartPoint = s.StartPoint, |
4806 |
EndPoint = s.EndPoint, |
4807 |
DashSize = s.DashSize, |
4808 |
PointSet = s.PointSet, |
4809 |
isTransOn = s.IsTransOn, |
4810 |
MidPoint = s.MidPoint, |
4811 |
StrokeColor = _SetColor, |
4812 |
Clock = s.Clock, |
4813 |
Opacity = s.Opac, |
4814 |
LineSize = Convert.ToDouble(data2.First()), |
4815 |
UserID = s.UserID, |
4816 |
}; |
4817 |
instance.Memo = s.Memo; |
4818 |
//Layer.Children.Add(instance); |
4819 |
instance.CommentID = commentId; |
4820 |
instance.MarkupInfoID = markupInfoID; |
4821 |
baseLayer.Add(instance); |
4822 |
|
4823 |
instance.ApplyTemplate(); |
4824 |
instance.SetArcPath(); |
4825 |
} |
4826 |
break; |
4827 |
#endregion |
4828 |
#region ArrowArc |
4829 |
case "ArrowArcControl": |
4830 |
using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item)) |
4831 |
{ |
4832 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
4833 |
ArrowArcControl instance = new ArrowArcControl() |
4834 |
{ |
4835 |
StartPoint = s.StartPoint, |
4836 |
EndPoint = s.EndPoint, |
4837 |
DashSize = s.DashSize, |
4838 |
PointSet = s.PointSet, |
4839 |
isTransOn = s.IsTransOn, |
4840 |
MidPoint = s.MidPoint, |
4841 |
StrokeColor = _SetColor, |
4842 |
Clock = s.Clock, |
4843 |
Opacity = s.Opac, |
4844 |
LineSize = Convert.ToDouble(data2.First()), |
4845 |
UserID = s.UserID, |
4846 |
}; |
4847 |
instance.Memo = s.Memo; |
4848 |
//Layer.Children.Add(instance); |
4849 |
instance.CommentID = commentId; |
4850 |
instance.MarkupInfoID = markupInfoID; |
4851 |
baseLayer.Add(instance); |
4852 |
|
4853 |
instance.ApplyTemplate(); |
4854 |
instance.SetArcPath(); |
4855 |
} |
4856 |
break; |
4857 |
#endregion |
4858 |
|
4859 |
#region RectCloud |
4860 |
case "RectCloudControl": |
4861 |
using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item)) |
4862 |
{ |
4863 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
4864 |
RectCloudControl instance = new RectCloudControl() |
4865 |
{ |
4866 |
StartPoint = s.StartPoint, |
4867 |
EndPoint = s.EndPoint, |
4868 |
LeftBottomPoint = s.LB, |
4869 |
Paint = s.PaintState, |
4870 |
Opacity = s.Opac, |
4871 |
DashSize = s.DashSize, |
4872 |
TopRightPoint = s.TR, |
4873 |
PointSet = s.PointSet, |
4874 |
StrokeColor = _SetColor, |
4875 |
LineSize = Convert.ToDouble(data2.First()), |
4876 |
UserID = s.UserID, |
4877 |
ArcLength = s.ArcLength |
4878 |
}; |
4879 |
instance.Memo = s.Memo; |
4880 |
//Layer.Children.Add(instance); |
4881 |
instance.CommentID = commentId; |
4882 |
instance.MarkupInfoID = markupInfoID; |
4883 |
baseLayer.Add(instance); |
4884 |
|
4885 |
instance.ApplyTemplate(); |
4886 |
instance.SetRectCloud(); |
4887 |
} |
4888 |
break; |
4889 |
#endregion |
4890 |
#region Sign |
4891 |
case "SignControl": |
4892 |
using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item)) |
4893 |
{ |
4894 |
SignControl instance = new SignControl |
4895 |
{ |
4896 |
Angle = s.Angle, |
4897 |
StartPoint = s.StartPoint, |
4898 |
TopRightPoint = s.TR, |
4899 |
EndPoint = s.EndPoint, |
4900 |
LeftBottomPoint = s.LB, |
4901 |
PointSet = s.PointSet, |
4902 |
Opacity = s.Opac, |
4903 |
SignImage = null, |
4904 |
UserID = s.UserID, |
4905 |
}; |
4906 |
instance.ApplyTemplate(); |
4907 |
//instance.ImageData = new BitmapImage(new Uri(s.ImagePath)); |
4908 |
|
4909 |
if (s.UserNumber != null) |
4910 |
{ |
4911 |
var _sign = getUser.GetSign(s.UserNumber, ProjectNo); |
4912 |
if (_sign != null) |
4913 |
{ |
4914 |
byte[] imageBytes = System.Convert.FromBase64String(_sign); |
4915 |
|
4916 |
System.IO.MemoryStream stream = new System.IO.MemoryStream(); |
4917 |
stream.Write(imageBytes, 0, imageBytes.Length); |
4918 |
stream.Position = 0; |
4919 |
System.Drawing.Image img = System.Drawing.Image.FromStream(stream); |
4920 |
BitmapImage returnImage = new BitmapImage(); |
4921 |
returnImage.BeginInit(); |
4922 |
System.IO.MemoryStream ms = new System.IO.MemoryStream(); |
4923 |
img.Save(ms, System.Drawing.Imaging.ImageFormat.Png); |
4924 |
ms.Seek(0, System.IO.SeekOrigin.Begin); |
4925 |
returnImage.StreamSource = ms; |
4926 |
returnImage.EndInit(); |
4927 |
stream.Close(); |
4928 |
instance.SignImage = returnImage; |
4929 |
} |
4930 |
} |
4931 |
|
4932 |
instance.MarkupInfoID = markupInfoID; |
4933 |
instance.CommentID = commentId; |
4934 |
baseLayer.Add(instance); |
4935 |
instance.ApplyTemplate(); |
4936 |
instance.SetImage(); |
4937 |
} |
4938 |
break; |
4939 |
#endregion |
4940 |
#region Ink |
4941 |
case "InkPresenter": |
4942 |
using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item)) |
4943 |
{ |
4944 |
#if SILVERLIGHT |
4945 |
this._InkBoard.Strokes = s.SCC; |
4946 |
#endif |
4947 |
} |
4948 |
break; |
4949 |
#endregion |
4950 |
#region Date |
4951 |
case "DateControl": |
4952 |
{ |
4953 |
using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item)) |
4954 |
{ |
4955 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
4956 |
DateControl instance = new DateControl |
4957 |
{ |
4958 |
Angle = s.Angle, |
4959 |
StartPoint = s.StartPoint, |
4960 |
EndPoint = s.EndPoint, |
4961 |
LeftBottomPoint = s.LB, |
4962 |
TopRightPoint = s.TR, |
4963 |
Opacity = s.Opac, |
4964 |
FontColor = _SetColor, |
4965 |
LineSize = Convert.ToDouble(data2.First()), |
4966 |
Text = s.Text, |
4967 |
PointSet = s.PointSet, |
4968 |
UserID = s.UserID |
4969 |
}; |
4970 |
instance.Memo = s.Memo; |
4971 |
//Layer.Children.Add(instance); |
4972 |
instance.MarkupInfoID = markupInfoID; |
4973 |
instance.CommentID = commentId; |
4974 |
baseLayer.Add(instance); |
4975 |
|
4976 |
instance.ApplyTemplate(); |
4977 |
instance.SetDate(); |
4978 |
} |
4979 |
} |
4980 |
break; |
4981 |
#endregion |
4982 |
#region Symbol |
4983 |
case "SymControl": |
4984 |
using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item)) |
4985 |
{ |
4986 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
4987 |
Common.StringToPathConverter sm = new Common.StringToPathConverter(); |
4988 |
SymControl instance = new SymControl() |
4989 |
{ |
4990 |
LineSize = Convert.ToDouble(data2.First()), |
4991 |
PointSet = s.PointSet, |
4992 |
Paint = s.PaintState, |
4993 |
StartPoint = s.StartPoint, |
4994 |
StrokeColor = _SetColor, |
4995 |
EndPoint = s.EndPoint, |
4996 |
Angle = s.Angle, |
4997 |
LeftBottomPoint = s.LB, |
4998 |
TopRightPoint = s.TR, |
4999 |
PathData = sm.Convert(s.PathInfo.ToString()), |
5000 |
Opacity = s.Opac, |
5001 |
}; |
5002 |
|
5003 |
instance.Memo = s.Memo; |
5004 |
instance.MarkupInfoID = markupInfoID; |
5005 |
instance.CommentID = commentId; |
5006 |
baseLayer.Add(instance); |
5007 |
instance.ApplyTemplate(); |
5008 |
instance.SetSymPath(); |
5009 |
} |
5010 |
break; |
5011 |
#endregion |
5012 |
#region Image |
5013 |
case "ImgControl": |
5014 |
using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item)) |
5015 |
{ |
5016 |
Image img = new Image(); |
5017 |
//img.Source = new BitmapImage(new Uri(s.ImagePath)); |
5018 |
if (s.ImagePath.Contains(".svg")) |
5019 |
{ |
5020 |
byte[] imageData = null; |
5021 |
DrawingImage image = null; |
5022 |
using (System.Net.WebClient web = new System.Net.WebClient()) |
5023 |
{ |
5024 |
imageData = web.DownloadData(new Uri(s.ImagePath)); |
5025 |
System.IO.Stream stream = new System.IO.MemoryStream(imageData); |
5026 |
image = SvgReader.Load(stream); |
5027 |
} |
5028 |
img.Source = image; |
5029 |
} |
5030 |
else |
5031 |
{ |
5032 |
img.Source = new BitmapImage(new Uri(s.ImagePath)); |
5033 |
} |
5034 |
ImgControl instance = new ImgControl |
5035 |
{ |
5036 |
Angle = s.Angle, |
5037 |
StartPoint = s.StartPoint, |
5038 |
TopRightPoint = s.TR, |
5039 |
EndPoint = s.EndPoint, |
5040 |
LeftBottomPoint = s.LB, |
5041 |
PointSet = s.PointSet, |
5042 |
Opacity = s.Opac, |
5043 |
FilePath = s.ImagePath, |
5044 |
UserID = s.UserID, |
5045 |
// ImageData = img.Source |
5046 |
|
5047 |
}; |
5048 |
//Layer.Children.Add(instance); |
5049 |
instance.Memo = s.Memo; |
5050 |
|
5051 |
instance.MarkupInfoID = markupInfoID; |
5052 |
instance.CommentID = commentId; |
5053 |
baseLayer.Add(instance); |
5054 |
|
5055 |
instance.ApplyTemplate(); |
5056 |
//instance.ImageData = new BitmapImage(new Uri(s.ImagePath)); |
5057 |
instance.ImageData = img.Source; |
5058 |
instance.SetImage(); |
5059 |
|
5060 |
} |
5061 |
break; |
5062 |
#endregion |
5063 |
#region SymbolN |
5064 |
case "SymControlN": |
5065 |
using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item)) |
5066 |
{ |
5067 |
SymControlN instance = new SymControlN() |
5068 |
{ |
5069 |
PointSet = s.PointSet, |
5070 |
StartPoint = s.StartPoint, |
5071 |
EndPoint = s.EndPoint, |
5072 |
Angle = s.Angle, |
5073 |
LeftBottomPoint = s.LB, |
5074 |
TopRightPoint = s.TR, |
5075 |
Opacity = s.Opac, |
5076 |
PathXathData = s.DBData, |
5077 |
}; |
5078 |
instance.Memo = s.Memo; |
5079 |
instance.CommentID = commentId; |
5080 |
instance.MarkupInfoID = markupInfoID; |
5081 |
baseLayer.Add(instance); |
5082 |
|
5083 |
instance.ApplyTemplate(); |
5084 |
|
5085 |
var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData); |
5086 |
xamlData = xamlData.Replace("daelim", "DAELIM"); |
5087 |
System.IO.MemoryStream stream = new System.IO.MemoryStream(); |
5088 |
System.IO.StreamWriter writer = new System.IO.StreamWriter(stream); |
5089 |
writer.Write(xamlData); |
5090 |
writer.Flush(); |
5091 |
stream.Position = 0; |
5092 |
|
5093 |
object obj = XamlReader.Load(stream); |
5094 |
instance.Base_ViewBox.Child = obj as UIElement; |
5095 |
instance.SetViewBox(); |
5096 |
} |
5097 |
break; |
5098 |
#endregion |
5099 |
|
5100 |
#region Cad |
5101 |
case "InsideWhiteControl": |
5102 |
using (S_InsideWhiteControl s = JsonSerializerHelper.JsonDeserialize<S_InsideWhiteControl>(item)) |
5103 |
{ |
5104 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5105 |
InsideWhiteControl instance = new InsideWhiteControl |
5106 |
{ |
5107 |
LineSize = Convert.ToDouble(data2.First()), |
5108 |
Paint = s.PaintState, |
5109 |
StartPoint = s.StartPoint, |
5110 |
EndPoint = s.EndPoint, |
5111 |
Angle = s.Angle, |
5112 |
StrokeColor = Brushes.White, |
5113 |
DashSize = s.DashSize, |
5114 |
Opacity = s.Opac, |
5115 |
LeftBottomPoint = s.LB, |
5116 |
TopRightPoint = s.TR, |
5117 |
PointSet = s.PointSet, |
5118 |
UserID = s.UserID, |
5119 |
FillColor = Brushes.White, |
5120 |
}; |
5121 |
|
5122 |
instance.Memo = s.Memo; |
5123 |
//Layer.Children.Add(instance); |
5124 |
instance.CommentID = commentId; |
5125 |
instance.MarkupInfoID = markupInfoID; |
5126 |
baseLayer.Add(instance); |
5127 |
instance.ApplyTemplate(); |
5128 |
instance.SetRectPath(); |
5129 |
} |
5130 |
break; |
5131 |
case "OverlapWhiteControl": |
5132 |
using (S_OverlapWhiteControl s = JsonSerializerHelper.JsonDeserialize<S_OverlapWhiteControl>(item)) |
5133 |
{ |
5134 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5135 |
OverlapWhiteControl instance = new OverlapWhiteControl |
5136 |
{ |
5137 |
LineSize = Convert.ToDouble(data2.First()), |
5138 |
Paint = s.PaintState, |
5139 |
StartPoint = s.StartPoint, |
5140 |
EndPoint = s.EndPoint, |
5141 |
Angle = s.Angle, |
5142 |
StrokeColor = Brushes.White, |
5143 |
DashSize = s.DashSize, |
5144 |
Opacity = s.Opac, |
5145 |
LeftBottomPoint = s.LB, |
5146 |
TopRightPoint = s.TR, |
5147 |
PointSet = s.PointSet, |
5148 |
UserID = s.UserID, |
5149 |
FillColor = Brushes.White, |
5150 |
}; |
5151 |
|
5152 |
instance.Memo = s.Memo; |
5153 |
//Layer.Children.Add(instance); |
5154 |
instance.CommentID = commentId; |
5155 |
instance.MarkupInfoID = markupInfoID; |
5156 |
baseLayer.Add(instance); |
5157 |
instance.ApplyTemplate(); |
5158 |
instance.SetRectPath(); |
5159 |
} |
5160 |
break; |
5161 |
case "ClipWhiteControl": |
5162 |
using (S_ClipWhiteControl s = JsonSerializerHelper.JsonDeserialize<S_ClipWhiteControl>(item)) |
5163 |
{ |
5164 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5165 |
ClipWhiteControl instance = new ClipWhiteControl |
5166 |
{ |
5167 |
LineSize = Convert.ToDouble(data2.First()), |
5168 |
Paint = s.PaintState, |
5169 |
StartPoint = s.StartPoint, |
5170 |
EndPoint = s.EndPoint, |
5171 |
Angle = s.Angle, |
5172 |
StrokeColor = Brushes.White, |
5173 |
DashSize = s.DashSize, |
5174 |
Opacity = s.Opac, |
5175 |
LeftBottomPoint = s.LB, |
5176 |
TopRightPoint = s.TR, |
5177 |
PointSet = s.PointSet, |
5178 |
UserID = s.UserID, |
5179 |
FillColor = Brushes.White, |
5180 |
}; |
5181 |
|
5182 |
instance.Memo = s.Memo; |
5183 |
//Layer.Children.Add(instance); |
5184 |
instance.CommentID = commentId; |
5185 |
instance.MarkupInfoID = markupInfoID; |
5186 |
baseLayer.Add(instance); |
5187 |
instance.ApplyTemplate(); |
5188 |
instance.SetRectPath(); |
5189 |
} |
5190 |
break; |
5191 |
case "CoordinateControl": |
5192 |
using (S_CoordinateControl s = JsonSerializerHelper.JsonDeserialize<S_CoordinateControl>(item)) |
5193 |
{ |
5194 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5195 |
CoordinateControl instance = new CoordinateControl |
5196 |
{ |
5197 |
LineSize = Convert.ToDouble(data2.First()), |
5198 |
Paint = s.PaintState, |
5199 |
StartPoint = s.StartPoint, |
5200 |
EndPoint = s.EndPoint, |
5201 |
Angle = s.Angle, |
5202 |
StrokeColor = Brushes.Yellow, |
5203 |
DashSize = s.DashSize, |
5204 |
Opacity = s.Opac, |
5205 |
LeftBottomPoint = s.LB, |
5206 |
TopRightPoint = s.TR, |
5207 |
PointSet = s.PointSet, |
5208 |
UserID = s.UserID, |
5209 |
// FillColor = Brushes.Yellow, |
5210 |
}; |
5211 |
|
5212 |
instance.Memo = s.Memo; |
5213 |
//Layer.Children.Add(instance); |
5214 |
instance.CommentID = commentId; |
5215 |
instance.MarkupInfoID = markupInfoID; |
5216 |
baseLayer.Add(instance); |
5217 |
instance.ApplyTemplate(); |
5218 |
instance.SetRectPath(); |
5219 |
} |
5220 |
break; |
5221 |
#endregion |
5222 |
default: |
5223 |
|
5224 |
break; |
5225 |
}; |
5226 |
} |
5227 |
} |
5228 |
} |
5229 |
|
5230 |
//강인구 추가(12/12) |
5231 |
public Control markupParse_Paste(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer) |
5232 |
{ |
5233 |
//GetUserSign getUser = new GetUserSign(); |
5234 |
Control return_control = new Control(); |
5235 |
if (MarkupString != "False") |
5236 |
{ |
5237 |
SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse("")); |
5238 |
//SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red); |
5239 |
string[] delimiterChars = { "|DZ|" }; |
5240 |
string[] delimiterChars2 = { "|" }; |
5241 |
string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries); |
5242 |
List<string> dataSet = new List<string>(); |
5243 |
|
5244 |
foreach (var dataPease in data) |
5245 |
{ |
5246 |
var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업 |
5247 |
var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업 |
5248 |
switch (unkownControl.Name) |
5249 |
{ |
5250 |
#region Shape |
5251 |
#region Rectangle |
5252 |
case "RectangleControl": |
5253 |
using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item)) |
5254 |
{ |
5255 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5256 |
RectangleControl instance = new RectangleControl |
5257 |
{ |
5258 |
LineSize = Convert.ToDouble(data2.First()), |
5259 |
Paint = s.PaintState, |
5260 |
StartPoint = s.StartPoint, |
5261 |
EndPoint = s.EndPoint, |
5262 |
Angle = s.Angle, |
5263 |
StrokeColor = _SetColor, |
5264 |
DashSize = s.DashSize, |
5265 |
Opacity = s.Opac, |
5266 |
LeftBottomPoint = s.LB, |
5267 |
TopRightPoint = s.TR, |
5268 |
PointSet = s.PointSet, |
5269 |
UserID = s.UserID |
5270 |
}; |
5271 |
baseLayer.Add(instance); |
5272 |
instance.ApplyTemplate(); |
5273 |
|
5274 |
return_control = instance; |
5275 |
} |
5276 |
break; |
5277 |
#endregion |
5278 |
#region Triangle |
5279 |
case "TriControl": |
5280 |
using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item)) |
5281 |
{ |
5282 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5283 |
TriControl instance = new TriControl |
5284 |
{ |
5285 |
LineSize = Convert.ToDouble(data2.First()), |
5286 |
MidPoint = s.MidPoint, |
5287 |
StartPoint = s.StartPoint, |
5288 |
Paint = s.Paint, |
5289 |
EndPoint = s.EndPoint, |
5290 |
Opacity = s.Opac, |
5291 |
Angle = s.Angle, |
5292 |
DashSize = s.DashSize, |
5293 |
PointSet = s.PointSet, |
5294 |
StrokeColor = _SetColor, |
5295 |
|
5296 |
UserID = s.UserID, |
5297 |
}; |
5298 |
baseLayer.Add(instance); |
5299 |
instance.ApplyTemplate(); |
5300 |
return_control = instance; |
5301 |
} |
5302 |
break; |
5303 |
#endregion |
5304 |
#region Cicle |
5305 |
case "CircleControl": |
5306 |
using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item)) |
5307 |
{ |
5308 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5309 |
CircleControl instance = new CircleControl |
5310 |
{ |
5311 |
LineSize = Convert.ToDouble(data2.First()), |
5312 |
Paint = s.PaintState, |
5313 |
StartPoint = s.StartPoint, |
5314 |
EndPoint = s.EndPoint, |
5315 |
LeftBottomPoint = s.LBP, |
5316 |
TopRightPoint = s.TRP, |
5317 |
Opacity = s.Opac, |
5318 |
Angle = s.Angle, |
5319 |
DashSize = s.DashSize, |
5320 |
PointSet = s.PointSet, |
5321 |
StrokeColor = _SetColor, |
5322 |
UserID = s.UserID, |
5323 |
}; |
5324 |
baseLayer.Add(instance); |
5325 |
instance.ApplyTemplate(); |
5326 |
return_control = instance; |
5327 |
} |
5328 |
break; |
5329 |
#endregion |
5330 |
#region RectCloud |
5331 |
case "RectCloudControl": |
5332 |
using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item)) |
5333 |
{ |
5334 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5335 |
RectCloudControl instance = new RectCloudControl() |
5336 |
{ |
5337 |
StartPoint = s.StartPoint, |
5338 |
EndPoint = s.EndPoint, |
5339 |
LeftBottomPoint = s.LB, |
5340 |
Paint = s.PaintState, |
5341 |
Opacity = s.Opac, |
5342 |
DashSize = s.DashSize, |
5343 |
TopRightPoint = s.TR, |
5344 |
PointSet = s.PointSet, |
5345 |
StrokeColor = _SetColor, |
5346 |
ArcLength = s.ArcLength, |
5347 |
LineSize = Convert.ToDouble(data2.First()), |
5348 |
UserID = s.UserID |
5349 |
}; |
5350 |
baseLayer.Add(instance); |
5351 |
instance.ApplyTemplate(); |
5352 |
return_control = instance; |
5353 |
} |
5354 |
break; |
5355 |
#endregion |
5356 |
#endregion |
5357 |
|
5358 |
#region Polygon |
5359 |
#region Poly |
5360 |
case "PolygonControl": |
5361 |
using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item)) |
5362 |
{ |
5363 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5364 |
PolygonControl instance = new PolygonControl |
5365 |
{ |
5366 |
LineSize = Convert.ToDouble(data2.First()), |
5367 |
//Toler = s.Toler, |
5368 |
IsCompleted = s.IsCompleted, |
5369 |
//PointSet = new List<Point>(), |
5370 |
Opacity = s.Opac, |
5371 |
StrokeColor = _SetColor, |
5372 |
//강인구 추가(Chain인지 Polygon인지 구분) |
5373 |
ControlType = s.Type, |
5374 |
DashSize = s.DashSize, |
5375 |
StartPoint = s.StartPoint, |
5376 |
EndPoint = s.EndPoint, |
5377 |
PointSet = s.PointSet, |
5378 |
UserID = s.UserID, |
5379 |
Paint = s.PaintState, |
5380 |
//PointC = s.PointC, |
5381 |
}; |
5382 |
baseLayer.Add(instance); |
5383 |
instance.ApplyTemplate(); |
5384 |
return_control = instance; |
5385 |
} |
5386 |
break; |
5387 |
#endregion |
5388 |
#region InkControl |
5389 |
case "InkControl": |
5390 |
using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item)) |
5391 |
{ |
5392 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5393 |
InkControl instance = new InkControl |
5394 |
{ |
5395 |
LineSize = Convert.ToDouble(data2.First()), |
5396 |
//Toler = s.Toler, |
5397 |
IsCompleted = s.IsCompleted, |
5398 |
//PointSet = new List<Point>(), |
5399 |
Opacity = s.Opac, |
5400 |
StrokeColor = _SetColor, |
5401 |
//강인구 추가(Chain인지 Polygon인지 구분) |
5402 |
ControlType = s.Type, |
5403 |
DashSize = s.DashSize, |
5404 |
StartPoint = s.StartPoint, |
5405 |
PointSet = s.PointSet, |
5406 |
UserID = s.UserID, |
5407 |
Paint = s.PaintState, |
5408 |
EndPoint = s.EndPoint, |
5409 |
//PointC = s.PointC, |
5410 |
}; |
5411 |
baseLayer.Add(instance); |
5412 |
instance.ApplyTemplate(); |
5413 |
return_control = instance; |
5414 |
} |
5415 |
break; |
5416 |
#endregion |
5417 |
#region Cloud |
5418 |
case "CloudControl": |
5419 |
using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item)) |
5420 |
{ |
5421 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5422 |
CloudControl instance = new CloudControl |
5423 |
{ |
5424 |
LineSize = Convert.ToDouble(data2.First()), |
5425 |
Toler = s.Toler, |
5426 |
PointSet = s.PointSet, |
5427 |
ArcLength = s.ArcLength, |
5428 |
Paint = s.PaintState, |
5429 |
Opacity = s.Opac, |
5430 |
StrokeColor = _SetColor, |
5431 |
|
5432 |
isTransOn = s.IsTrans, |
5433 |
isChain = s.IsChain, |
5434 |
DashSize = s.DashSize, |
5435 |
UserID = s.UserID, |
5436 |
|
5437 |
StartPoint = s.StartPoint, |
5438 |
EndPoint = s.EndPoint, |
5439 |
|
5440 |
//Fill = s.CloudFill, |
5441 |
}; |
5442 |
//instance.PointSet = s.PointSet; |
5443 |
//instance.ClosePath(); |
5444 |
//instance.ChangePaint(s.PaintState); |
5445 |
baseLayer.Add(instance); |
5446 |
instance.ApplyTemplate(); |
5447 |
instance.SetCloud(); |
5448 |
//instance.ClosePath(); |
5449 |
//instance.ChangePaint(s.PaintState); |
5450 |
return_control = instance; |
5451 |
} |
5452 |
break; |
5453 |
#endregion |
5454 |
#endregion |
5455 |
|
5456 |
#region Line |
5457 |
#region Line |
5458 |
case "LineControl": |
5459 |
using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item)) |
5460 |
{ |
5461 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5462 |
LineControl instance = new LineControl() |
5463 |
{ |
5464 |
LineStyleSet = s.LineStyleSet, |
5465 |
StartPoint = s.StartPoint, |
5466 |
DimSize = s.DimSize, |
5467 |
EndPoint = s.EndPoint, |
5468 |
DashSize = s.DashSize, |
5469 |
Interval = s.Interval, |
5470 |
PointSet = s.PointSet, |
5471 |
Opacity = s.Opac, |
5472 |
StrokeColor = _SetColor, |
5473 |
UserID = s.UserID, |
5474 |
LineSize = Convert.ToDouble(data2.First()), |
5475 |
}; |
5476 |
|
5477 |
baseLayer.Add(instance); |
5478 |
instance.ApplyTemplate(); |
5479 |
instance.SetLinePath(); |
5480 |
return_control = instance; |
5481 |
} |
5482 |
break; |
5483 |
#endregion |
5484 |
#region Arrow_Multi |
5485 |
case "ArrowControl_Multi": |
5486 |
using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item)) |
5487 |
{ |
5488 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5489 |
ArrowControl_Multi instance = new ArrowControl_Multi |
5490 |
{ |
5491 |
LineSize = Convert.ToDouble(data2.First()), |
5492 |
StartPoint = s.StartPoint, |
5493 |
MiddlePoint = s.MidPoint, |
5494 |
DashSize = s.DashSize, |
5495 |
EndPoint = s.EndPoint, |
5496 |
PointSet = s.PointSet, |
5497 |
Opacity = s.Opac, |
5498 |
StrokeColor = _SetColor, |
5499 |
|
5500 |
UserID = s.UserID |
5501 |
}; |
5502 |
baseLayer.Add(instance); |
5503 |
instance.ApplyTemplate(); |
5504 |
instance.SetArrowMultiPath(); |
5505 |
return_control = instance; |
5506 |
} |
5507 |
break; |
5508 |
#endregion |
5509 |
#region Arc |
5510 |
case "ArcControl": |
5511 |
using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item)) |
5512 |
{ |
5513 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5514 |
ArcControl instance = new ArcControl() |
5515 |
{ |
5516 |
StartPoint = s.StartPoint, |
5517 |
EndPoint = s.EndPoint, |
5518 |
DashSize = s.DashSize, |
5519 |
PointSet = s.PointSet, |
5520 |
isTransOn = s.IsTransOn, |
5521 |
MidPoint = s.MidPoint, |
5522 |
StrokeColor = _SetColor, |
5523 |
Opacity = s.Opac, |
5524 |
|
5525 |
Clock = s.Clock, |
5526 |
LineSize = Convert.ToDouble(data2.First()), |
5527 |
UserID = s.UserID, |
5528 |
}; |
5529 |
baseLayer.Add(instance); |
5530 |
instance.ApplyTemplate(); |
5531 |
instance.OnApplyTemplate(); |
5532 |
instance.SetArcPath(); |
5533 |
return_control = instance; |
5534 |
} |
5535 |
break; |
5536 |
#endregion |
5537 |
#region ArrowArc |
5538 |
case "ArrowArcControl": |
5539 |
using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item)) |
5540 |
{ |
5541 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5542 |
ArrowArcControl instance = new ArrowArcControl() |
5543 |
{ |
5544 |
StartPoint = s.StartPoint, |
5545 |
EndPoint = s.EndPoint, |
5546 |
DashSize = s.DashSize, |
5547 |
PointSet = s.PointSet, |
5548 |
isTransOn = s.IsTransOn, |
5549 |
MidPoint = s.MidPoint, |
5550 |
StrokeColor = _SetColor, |
5551 |
Opacity = s.Opac, |
5552 |
|
5553 |
Clock = s.Clock, |
5554 |
LineSize = Convert.ToDouble(data2.First()), |
5555 |
UserID = s.UserID, |
5556 |
}; |
5557 |
baseLayer.Add(instance); |
5558 |
instance.ApplyTemplate(); |
5559 |
instance.OnApplyTemplate(); |
5560 |
instance.SetArcPath(); |
5561 |
return_control = instance; |
5562 |
} |
5563 |
break; |
5564 |
#endregion |
5565 |
#endregion |
5566 |
#region Text |
5567 |
case "TextControl": |
5568 |
using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item)) |
5569 |
{ |
5570 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5571 |
TextControl instance = new TextControl() |
5572 |
{ |
5573 |
Text = s.Text, |
5574 |
StartPoint = s.StartPoint, |
5575 |
EndPoint = s.EndPoint, |
5576 |
CanvasX = s.StartPoint.X, |
5577 |
CanvasY = s.StartPoint.Y, |
5578 |
BoxWidth = s.BoxW, |
5579 |
BoxHeight = s.BoxH, |
5580 |
ControlType_No = s.paintMethod, |
5581 |
LineSize = new Thickness(Convert.ToDouble(data2.First())), |
5582 |
TextSize = Convert.ToDouble(data2[1]), |
5583 |
FontColor = _SetColor, |
5584 |
FontSize = 10, |
5585 |
UserID = s.UserID, |
5586 |
//isHighLight = s.isHighLight, |
5587 |
Angle = s.Angle, |
5588 |
PointSet = s.PointSet, |
5589 |
Opacity = s.Opac, |
5590 |
TextFamily = new FontFamily(s.fontConfig[0]), |
5591 |
//인구 추가(2018.04.17) |
5592 |
TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]), |
5593 |
TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]), |
5594 |
}; |
5595 |
|
5596 |
if (instance.Text != null) |
5597 |
{ |
5598 |
System.Diagnostics.Debug.WriteLine(instance.Angle); |
5599 |
instance.ApplyTemplate(); |
5600 |
if (s.fontConfig.Count() == 4) |
5601 |
{ |
5602 |
instance.UnderLine = TextDecorations.Underline; |
5603 |
instance.Base_TextBlock.TextDecorations = instance.UnderLine; |
5604 |
} |
5605 |
} |
5606 |
baseLayer.Add(instance); |
5607 |
instance.ApplyTemplate(); |
5608 |
|
5609 |
instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0); |
5610 |
|
5611 |
instance.Base_TextBox.Visibility = Visibility.Collapsed; |
5612 |
instance.Base_TextBlock.Visibility = Visibility.Visible; |
5613 |
|
5614 |
return_control = instance; |
5615 |
} |
5616 |
break; |
5617 |
#endregion |
5618 |
|
5619 |
#region ArrowText |
5620 |
case "ArrowTextControl": |
5621 |
using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item)) |
5622 |
{ |
5623 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5624 |
ArrowTextControl instance = new ArrowTextControl(); |
5625 |
instance.LineSize = Convert.ToDouble(data2.First()); |
5626 |
instance.PointSet = s.PointSet; |
5627 |
instance.StartPoint = s.StartPoint; |
5628 |
instance.EndPoint = s.EndPoint; |
5629 |
instance.StrokeColor = _SetColor; |
5630 |
//instance.DashSize = s.DashSize; |
5631 |
instance.ArrowTextStyle = s.ArrowStyle; |
5632 |
instance.isHighLight = s.isHighLight; |
5633 |
instance.ArrowText = s.ArrowText; |
5634 |
instance.Opacity = s.Opac; |
5635 |
instance.BorderSize = s.BorderSize; |
5636 |
instance.BoxWidth = s.BoxWidth; |
5637 |
instance.BoxHeight = s.BoxHeight; |
5638 |
instance.isFixed = s.isFixed; |
5639 |
instance.Angle = s.Angle; |
5640 |
instance.UserID = s.UserID; |
5641 |
instance.isTrans = s.isTrans; |
5642 |
instance.MidPoint = s.MidPoint; |
5643 |
if (s.fontConfig == null || s.fontConfig.ToList().Count == 0) |
5644 |
{ |
5645 |
s.fontConfig = new List<string>(); |
5646 |
|
5647 |
s.fontConfig.Add("Arial"); |
5648 |
s.fontConfig.Add("Normal"); |
5649 |
s.fontConfig.Add("Normal"); |
5650 |
s.fontConfig.Add("30"); |
5651 |
} |
5652 |
instance.TextFamily = new FontFamily(s.fontConfig[0]); |
5653 |
//인구 추가(2018.04.17) |
5654 |
instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]); |
5655 |
instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]); |
5656 |
instance.TextSize = Convert.ToDouble(s.fontConfig[3]); |
5657 |
|
5658 |
baseLayer.Add(instance); |
5659 |
instance.ApplyTemplate(); |
5660 |
|
5661 |
if (s.fontConfig.Count() == 5) |
5662 |
{ |
5663 |
instance.UnderLine = TextDecorations.Underline; |
5664 |
instance.Base_TextBox.TextDecorations = instance.UnderLine; |
5665 |
} |
5666 |
instance.SetArrowTextPath(); |
5667 |
return_control = instance; |
5668 |
}; |
5669 |
break; |
5670 |
#endregion |
5671 |
|
5672 |
#region ETC |
5673 |
#region Ink |
5674 |
case "InkPresenter": |
5675 |
using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item)) |
5676 |
{ |
5677 |
|
5678 |
} |
5679 |
break; |
5680 |
#endregion |
5681 |
#region Date |
5682 |
case "DateControl": |
5683 |
{ |
5684 |
using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item)) |
5685 |
{ |
5686 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5687 |
DateControl instance = new DateControl |
5688 |
{ |
5689 |
Angle = s.Angle, |
5690 |
StartPoint = s.StartPoint, |
5691 |
EndPoint = s.EndPoint, |
5692 |
LeftBottomPoint = s.LB, |
5693 |
TopRightPoint = s.TR, |
5694 |
Opacity = s.Opac, |
5695 |
FontColor = _SetColor, |
5696 |
LineSize = Convert.ToDouble(data2.First()), |
5697 |
Text = s.Text, |
5698 |
PointSet = s.PointSet, |
5699 |
UserID = s.UserID |
5700 |
}; |
5701 |
baseLayer.Add(instance); |
5702 |
instance.ApplyTemplate(); |
5703 |
return_control = instance; |
5704 |
} |
5705 |
} |
5706 |
break; |
5707 |
#endregion |
5708 |
#region Image |
5709 |
case "ImgControl": |
5710 |
using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item)) |
5711 |
{ |
5712 |
Image img = new Image(); |
5713 |
//img.Source = new BitmapImage(new Uri(s.ImagePath)); |
5714 |
if (s.ImagePath.Contains(".svg")) |
5715 |
{ |
5716 |
byte[] imageData = null; |
5717 |
DrawingImage image = null; |
5718 |
using (System.Net.WebClient web = new System.Net.WebClient()) |
5719 |
{ |
5720 |
imageData = web.DownloadData(new Uri(s.ImagePath)); |
5721 |
System.IO.Stream stream = new System.IO.MemoryStream(imageData); |
5722 |
image = SvgReader.Load(stream); |
5723 |
} |
5724 |
img.Source = image; |
5725 |
} |
5726 |
else |
5727 |
{ |
5728 |
img.Source = new BitmapImage(new Uri(s.ImagePath)); |
5729 |
} |
5730 |
ImgControl instance = new ImgControl |
5731 |
{ |
5732 |
Angle = s.Angle, |
5733 |
StartPoint = s.StartPoint, |
5734 |
TopRightPoint = s.TR, |
5735 |
EndPoint = s.EndPoint, |
5736 |
LeftBottomPoint = s.LB, |
5737 |
PointSet = s.PointSet, |
5738 |
Opacity = s.Opac, |
5739 |
FilePath = s.ImagePath, |
5740 |
UserID = s.UserID, |
5741 |
ImageData = img.Source |
5742 |
}; |
5743 |
|
5744 |
instance.ApplyTemplate(); |
5745 |
//instance.ImageData = new BitmapImage(new Uri(s.ImagePath)); |
5746 |
instance.ImageData = img.Source; |
5747 |
baseLayer.Add(instance); |
5748 |
instance.ApplyTemplate(); |
5749 |
instance.SetImage(); |
5750 |
return_control = instance; |
5751 |
} |
5752 |
break; |
5753 |
#endregion |
5754 |
#region Sign |
5755 |
case "SignControl": |
5756 |
using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item)) |
5757 |
{ |
5758 |
SignControl instance = new SignControl |
5759 |
{ |
5760 |
Angle = s.Angle, |
5761 |
StartPoint = s.StartPoint, |
5762 |
TopRightPoint = s.TR, |
5763 |
EndPoint = s.EndPoint, |
5764 |
LeftBottomPoint = s.LB, |
5765 |
PointSet = s.PointSet, |
5766 |
Opacity = s.Opac, |
5767 |
SignImage = null, |
5768 |
UserID = s.UserID, |
5769 |
}; |
5770 |
instance.ApplyTemplate(); |
5771 |
//instance.ImageData = new BitmapImage(new Uri(s.ImagePath)); |
5772 |
|
5773 |
if (s.UserNumber != null) |
5774 |
{ |
5775 |
var _sign = getUser.GetSign(s.UserNumber, ProjectNo); |
5776 |
if (_sign != null) |
5777 |
{ |
5778 |
byte[] imageBytes = System.Convert.FromBase64String(_sign); |
5779 |
|
5780 |
System.IO.MemoryStream stream = new System.IO.MemoryStream(); |
5781 |
stream.Write(imageBytes, 0, imageBytes.Length); |
5782 |
stream.Position = 0; |
5783 |
System.Drawing.Image img = System.Drawing.Image.FromStream(stream); |
5784 |
BitmapImage returnImage = new BitmapImage(); |
5785 |
returnImage.BeginInit(); |
5786 |
System.IO.MemoryStream ms = new System.IO.MemoryStream(); |
5787 |
img.Save(ms, System.Drawing.Imaging.ImageFormat.Png); |
5788 |
ms.Seek(0, System.IO.SeekOrigin.Begin); |
5789 |
returnImage.StreamSource = ms; |
5790 |
returnImage.EndInit(); |
5791 |
stream.Close(); |
5792 |
instance.SignImage = returnImage; |
5793 |
} |
5794 |
} |
5795 |
|
5796 |
baseLayer.Add(instance); |
5797 |
instance.ApplyTemplate(); |
5798 |
instance.SetImage(); |
5799 |
return_control = instance; |
5800 |
} |
5801 |
break; |
5802 |
#endregion |
5803 |
#region Symbol |
5804 |
case "SymControl": |
5805 |
using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item)) |
5806 |
{ |
5807 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5808 |
Common.StringToPathConverter sm = new Common.StringToPathConverter(); |
5809 |
SymControl instance = new SymControl |
5810 |
{ |
5811 |
//Angle = s.Angle, |
5812 |
//StartPoint = s.StartPoint, |
5813 |
//TopRightPoint = s.TR, |
5814 |
//EndPoint = s.EndPoint, |
5815 |
//LeftBottomPoint = s.LB, |
5816 |
//PointSet = s.PointSet, |
5817 |
//Opacity = s.Opac, |
5818 |
//FilePath = s.ImagePath, |
5819 |
//UserID = s.UserID, |
5820 |
//ImageData = s.ImageData |
5821 |
LineSize = Convert.ToDouble(data2.First()), |
5822 |
PointSet = s.PointSet, |
5823 |
Paint = s.PaintState, |
5824 |
StartPoint = s.StartPoint, |
5825 |
StrokeColor = _SetColor, |
5826 |
EndPoint = s.EndPoint, |
5827 |
Angle = s.Angle, |
5828 |
UserID = s.UserID, |
5829 |
LeftBottomPoint = s.LB, |
5830 |
TopRightPoint = s.TR, |
5831 |
PathData = sm.Convert(s.PathInfo.ToString()), |
5832 |
Opacity = s.Opac, |
5833 |
}; |
5834 |
|
5835 |
baseLayer.Add(instance); |
5836 |
//instance.OnApplyTemplate(); |
5837 |
instance.ApplyTemplate(); |
5838 |
instance.SetSymPath(); |
5839 |
return_control = instance; |
5840 |
} |
5841 |
break; |
5842 |
#endregion |
5843 |
|
5844 |
#region SymbolN |
5845 |
case "SymControlN": |
5846 |
using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item)) |
5847 |
{ |
5848 |
SymControlN instance = new SymControlN() |
5849 |
{ |
5850 |
PointSet = s.PointSet, |
5851 |
StartPoint = s.StartPoint, |
5852 |
EndPoint = s.EndPoint, |
5853 |
Angle = s.Angle, |
5854 |
LeftBottomPoint = s.LB, |
5855 |
TopRightPoint = s.TR, |
5856 |
Opacity = s.Opac, |
5857 |
PathXathData = s.DBData, |
5858 |
}; |
5859 |
instance.Memo = s.Memo; |
5860 |
baseLayer.Add(instance); |
5861 |
instance.ApplyTemplate(); |
5862 |
|
5863 |
return_control = instance; |
5864 |
|
5865 |
//var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData); |
5866 |
//instance.PathXathData = s.DBData; |
5867 |
|
5868 |
//var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(appovalData); |
5869 |
//xamlData = xamlData.Replace("daelim", "DAELIM"); |
5870 |
//System.IO.MemoryStream stream = new System.IO.MemoryStream(); |
5871 |
//System.IO.StreamWriter writer = new System.IO.StreamWriter(stream); |
5872 |
//writer.Write(xamlData); |
5873 |
//writer.Flush(); |
5874 |
//stream.Position = 0; |
5875 |
|
5876 |
//object obj = XamlReader.Load(stream); |
5877 |
//instance.Base_ViewBox.Child = obj as UIElement; |
5878 |
//instance.PathXathData = appovalData; |
5879 |
//instance.SetViewBox(); |
5880 |
} |
5881 |
break; |
5882 |
#endregion |
5883 |
#endregion |
5884 |
|
5885 |
#region Cad |
5886 |
case "InsideWhiteControl": |
5887 |
using (S_InsideWhiteControl s = JsonSerializerHelper.JsonDeserialize<S_InsideWhiteControl>(item)) |
5888 |
{ |
5889 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5890 |
InsideWhiteControl instance = new InsideWhiteControl |
5891 |
{ |
5892 |
LineSize = Convert.ToDouble(data2.First()), |
5893 |
Paint = s.PaintState, |
5894 |
StartPoint = s.StartPoint, |
5895 |
EndPoint = s.EndPoint, |
5896 |
Angle = s.Angle, |
5897 |
StrokeColor = Brushes.White, |
5898 |
DashSize = s.DashSize, |
5899 |
Opacity = s.Opac, |
5900 |
LeftBottomPoint = s.LB, |
5901 |
TopRightPoint = s.TR, |
5902 |
PointSet = s.PointSet, |
5903 |
UserID = s.UserID, |
5904 |
FillColor = Brushes.White, |
5905 |
}; |
5906 |
baseLayer.Add(instance); |
5907 |
instance.ApplyTemplate(); |
5908 |
|
5909 |
return_control = instance; |
5910 |
} |
5911 |
break; |
5912 |
case "OverlapWhiteControl": |
5913 |
using (S_OverlapWhiteControl s = JsonSerializerHelper.JsonDeserialize<S_OverlapWhiteControl>(item)) |
5914 |
{ |
5915 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5916 |
OverlapWhiteControl instance = new OverlapWhiteControl |
5917 |
{ |
5918 |
LineSize = Convert.ToDouble(data2.First()), |
5919 |
Paint = s.PaintState, |
5920 |
StartPoint = s.StartPoint, |
5921 |
EndPoint = s.EndPoint, |
5922 |
Angle = s.Angle, |
5923 |
StrokeColor = Brushes.White, |
5924 |
DashSize = s.DashSize, |
5925 |
Opacity = s.Opac, |
5926 |
LeftBottomPoint = s.LB, |
5927 |
TopRightPoint = s.TR, |
5928 |
PointSet = s.PointSet, |
5929 |
UserID = s.UserID, |
5930 |
FillColor = Brushes.White, |
5931 |
}; |
5932 |
baseLayer.Add(instance); |
5933 |
instance.ApplyTemplate(); |
5934 |
|
5935 |
return_control = instance; |
5936 |
} |
5937 |
break; |
5938 |
case "ClipWhiteControl": |
5939 |
using (S_ClipWhiteControl s = JsonSerializerHelper.JsonDeserialize<S_ClipWhiteControl>(item)) |
5940 |
{ |
5941 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5942 |
ClipWhiteControl instance = new ClipWhiteControl |
5943 |
{ |
5944 |
LineSize = Convert.ToDouble(data2.First()), |
5945 |
Paint = s.PaintState, |
5946 |
StartPoint = s.StartPoint, |
5947 |
EndPoint = s.EndPoint, |
5948 |
Angle = s.Angle, |
5949 |
StrokeColor = Brushes.White, |
5950 |
DashSize = s.DashSize, |
5951 |
Opacity = s.Opac, |
5952 |
LeftBottomPoint = s.LB, |
5953 |
TopRightPoint = s.TR, |
5954 |
PointSet = s.PointSet, |
5955 |
UserID = s.UserID, |
5956 |
FillColor = Brushes.White, |
5957 |
}; |
5958 |
baseLayer.Add(instance); |
5959 |
instance.ApplyTemplate(); |
5960 |
|
5961 |
return_control = instance; |
5962 |
} |
5963 |
break; |
5964 |
case "CoordinateControl": |
5965 |
using (S_CoordinateControl s = JsonSerializerHelper.JsonDeserialize<S_CoordinateControl>(item)) |
5966 |
{ |
5967 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
5968 |
CoordinateControl instance = new CoordinateControl |
5969 |
{ |
5970 |
LineSize = Convert.ToDouble(data2.First()), |
5971 |
Paint = s.PaintState, |
5972 |
StartPoint = s.StartPoint, |
5973 |
EndPoint = s.EndPoint, |
5974 |
Angle = s.Angle, |
5975 |
StrokeColor = Brushes.Yellow, |
5976 |
DashSize = s.DashSize, |
5977 |
Opacity = s.Opac, |
5978 |
LeftBottomPoint = s.LB, |
5979 |
TopRightPoint = s.TR, |
5980 |
PointSet = s.PointSet, |
5981 |
UserID = s.UserID, |
5982 |
// FillColor = Brushes.Yellow, |
5983 |
}; |
5984 |
baseLayer.Add(instance); |
5985 |
instance.ApplyTemplate(); |
5986 |
|
5987 |
return_control = instance; |
5988 |
} |
5989 |
break; |
5990 |
#endregion |
5991 |
default: |
5992 |
break; |
5993 |
}; |
5994 |
} |
5995 |
} |
5996 |
return return_control; |
5997 |
} |
5998 |
|
5999 |
public S_BaseControl markupParse_GetBaseControl(string MarkupString) |
6000 |
{ |
6001 |
var item = JsonSerializerHelper.UnCompressString(MarkupString); //언패킹작업 |
6002 |
var unknownData = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업 |
6003 |
return unknownData; |
6004 |
} |
6005 |
|
6006 |
//Temp |
6007 |
public Control TempMarkupParseEx(string MarkupString, ObservableCollection<CommentUserInfo> baseLayer, string DisplayColor, string ToolTipMessage, string markupInfoID, string commentId) |
6008 |
{ |
6009 |
Control return_control = new Control(); |
6010 |
if (MarkupString != "False") |
6011 |
{ |
6012 |
SolidColorBrush _SetColor = new SolidColorBrush(Common.ValueConverter.StringToColorConverter.Parse(DisplayColor)); |
6013 |
//SolidColorBrush _SetColor = new SolidColorBrush(Colors.Red); |
6014 |
string[] delimiterChars = { "|DZ|" }; |
6015 |
string[] delimiterChars2 = { "|" }; |
6016 |
string[] data = MarkupString.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries); |
6017 |
List<string> dataSet = new List<string>(); |
6018 |
|
6019 |
foreach (var dataPease in data) |
6020 |
{ |
6021 |
var item = JsonSerializerHelper.UnCompressString(dataPease); //언패킹작업 |
6022 |
var unkownControl = JsonSerializerHelper.JsonDeserialize<S_BaseControl>(item); //복호화작업 |
6023 |
switch (unkownControl.Name) |
6024 |
{ |
6025 |
#region ArrowText |
6026 |
case "ArrowTextControl": |
6027 |
using (S_ArrowTextControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowTextControl>(item)) |
6028 |
{ |
6029 |
#region 신규 |
6030 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6031 |
ArrowTextControl instance = new ArrowTextControl(); |
6032 |
instance.MarkupInfoID = markupInfoID; |
6033 |
//Layer.Children.Add(instance); |
6034 |
baseLayer.Add(instance); |
6035 |
instance.ApplyTemplate(); |
6036 |
instance.LineSize = Convert.ToDouble(data2.First()); |
6037 |
instance.PointSet = s.PointSet; |
6038 |
instance.StartPoint = s.StartPoint; |
6039 |
instance.EndPoint = s.EndPoint; |
6040 |
instance.StrokeColor = new SolidColorBrush(Colors.Red); |
6041 |
//instance.DashSize = s.DashSize; |
6042 |
instance.ArrowTextStyle = s.ArrowStyle; |
6043 |
instance.isHighLight = s.isHighLight; |
6044 |
instance.ArrowText = s.ArrowText; |
6045 |
instance.Opacity = s.Opac; |
6046 |
instance.BorderSize = s.BorderSize; |
6047 |
instance.BoxWidth = s.BoxWidth; |
6048 |
instance.BoxHeight = s.BoxHeight; |
6049 |
instance.isFixed = s.isFixed; |
6050 |
instance.Angle = s.Angle; |
6051 |
instance.UserID = s.UserID; |
6052 |
instance.StrokeColor = _SetColor; |
6053 |
instance.isTrans = s.isTrans; |
6054 |
instance.MidPoint = s.MidPoint; |
6055 |
instance.Memo = s.Memo; |
6056 |
if (s.fontConfig == null || s.fontConfig.ToList().Count == 0) |
6057 |
{ |
6058 |
s.fontConfig = new List<string>(); |
6059 |
|
6060 |
s.fontConfig.Add("Arial"); |
6061 |
s.fontConfig.Add("Normal"); |
6062 |
s.fontConfig.Add("Normal"); |
6063 |
s.fontConfig.Add("30"); |
6064 |
} |
6065 |
|
6066 |
instance.TextFamily = new FontFamily(s.fontConfig[0]); |
6067 |
//인구 추가(2018.04.17) |
6068 |
instance.TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]); |
6069 |
instance.TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]); |
6070 |
instance.TextSize = Convert.ToDouble(s.fontConfig[3]); |
6071 |
|
6072 |
if (s.fontConfig.Count() == 5) |
6073 |
{ |
6074 |
instance.UnderLine = TextDecorations.Underline; |
6075 |
instance.Base_TextBox.TextDecorations = instance.UnderLine; |
6076 |
} |
6077 |
|
6078 |
instance.SetArrowTextPath(); |
6079 |
instance.Base_TextBox.IsHitTestVisible = false; |
6080 |
instance.CommentID = commentId; |
6081 |
#endregion |
6082 |
|
6083 |
|
6084 |
return_control = instance; |
6085 |
|
6086 |
}; |
6087 |
break; |
6088 |
#endregion |
6089 |
#region Arrow_Multi |
6090 |
case "ArrowControl_Multi": |
6091 |
using (S_ArrowControl_Multi s = JsonSerializerHelper.JsonDeserialize<S_ArrowControl_Multi>(item)) |
6092 |
{ |
6093 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6094 |
ArrowControl_Multi instance = new ArrowControl_Multi |
6095 |
{ |
6096 |
LineSize = Convert.ToDouble(data2.First()), |
6097 |
StartPoint = s.StartPoint, |
6098 |
MiddlePoint = s.MidPoint, |
6099 |
DashSize = s.DashSize, |
6100 |
EndPoint = s.EndPoint, |
6101 |
PointSet = s.PointSet, |
6102 |
Opacity = s.Opac, |
6103 |
StrokeColor = _SetColor, |
6104 |
UserID = s.UserID |
6105 |
}; |
6106 |
|
6107 |
//Layer.Children.Add(instance); |
6108 |
instance.Memo = s.Memo; |
6109 |
instance.CommentID = commentId; |
6110 |
instance.MarkupInfoID = markupInfoID; |
6111 |
baseLayer.Add(instance); |
6112 |
instance.ApplyTemplate(); |
6113 |
instance.SetArrowMultiPath(); |
6114 |
instance.SetValue(ToolTipService.ToolTipProperty, ToolTipMessage); |
6115 |
|
6116 |
return_control = instance; |
6117 |
} |
6118 |
break; |
6119 |
#endregion |
6120 |
#region Rectangle |
6121 |
case "RectangleControl": |
6122 |
using (S_RectControl s = JsonSerializerHelper.JsonDeserialize<S_RectControl>(item)) |
6123 |
{ |
6124 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6125 |
RectangleControl instance = new RectangleControl |
6126 |
{ |
6127 |
LineSize = Convert.ToDouble(data2.First()), |
6128 |
Paint = s.PaintState, |
6129 |
StartPoint = s.StartPoint, |
6130 |
EndPoint = s.EndPoint, |
6131 |
Angle = s.Angle, |
6132 |
StrokeColor = _SetColor, |
6133 |
DashSize = s.DashSize, |
6134 |
Opacity = s.Opac, |
6135 |
LeftBottomPoint = s.LB, |
6136 |
TopRightPoint = s.TR, |
6137 |
PointSet = s.PointSet, |
6138 |
UserID = s.UserID |
6139 |
}; |
6140 |
|
6141 |
instance.Memo = s.Memo; |
6142 |
//Layer.Children.Add(instance); |
6143 |
instance.CommentID = commentId; |
6144 |
instance.MarkupInfoID = markupInfoID; |
6145 |
baseLayer.Add(instance); |
6146 |
instance.ApplyTemplate(); |
6147 |
instance.SetRectPath(); |
6148 |
|
6149 |
return_control = instance; |
6150 |
} |
6151 |
break; |
6152 |
#endregion |
6153 |
#region Triangle |
6154 |
case "TriControl": |
6155 |
using (S_TriControl s = JsonSerializerHelper.JsonDeserialize<S_TriControl>(item)) |
6156 |
{ |
6157 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6158 |
TriControl instance = new TriControl |
6159 |
{ |
6160 |
LineSize = Convert.ToDouble(data2.First()), |
6161 |
MidPoint = s.MidPoint, |
6162 |
StartPoint = s.StartPoint, |
6163 |
Paint = s.Paint, |
6164 |
EndPoint = s.EndPoint, |
6165 |
Opacity = s.Opac, |
6166 |
Angle = s.Angle, |
6167 |
DashSize = s.DashSize, |
6168 |
PointSet = s.PointSet, |
6169 |
StrokeColor = _SetColor, |
6170 |
UserID = s.UserID, |
6171 |
}; |
6172 |
instance.Memo = s.Memo; |
6173 |
//Layer.Children.Add(instance); |
6174 |
instance.CommentID = commentId; |
6175 |
instance.MarkupInfoID = markupInfoID; |
6176 |
baseLayer.Add(instance); |
6177 |
instance.ApplyTemplate(); |
6178 |
instance.SetTri(); |
6179 |
return_control = instance; |
6180 |
} |
6181 |
break; |
6182 |
#endregion |
6183 |
#region Cicle |
6184 |
case "CircleControl": |
6185 |
using (S_CircleControl s = JsonSerializerHelper.JsonDeserialize<S_CircleControl>(item)) |
6186 |
{ |
6187 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6188 |
CircleControl instance = new CircleControl |
6189 |
{ |
6190 |
LineSize = Convert.ToDouble(data2.First()), |
6191 |
Paint = s.PaintState, |
6192 |
StartPoint = s.StartPoint, |
6193 |
EndPoint = s.EndPoint, |
6194 |
LeftBottomPoint = s.LBP, |
6195 |
TopRightPoint = s.TRP, |
6196 |
Opacity = s.Opac, |
6197 |
Angle = s.Angle, |
6198 |
DashSize = s.DashSize, |
6199 |
PointSet = s.PointSet, |
6200 |
StrokeColor = _SetColor, |
6201 |
UserID = s.UserID, |
6202 |
}; |
6203 |
instance.Memo = s.Memo; |
6204 |
//Layer.Children.Add(instance); |
6205 |
instance.CommentID = commentId; |
6206 |
instance.MarkupInfoID = markupInfoID; |
6207 |
baseLayer.Add(instance); |
6208 |
instance.ApplyTemplate(); |
6209 |
instance.SetCircle(); |
6210 |
return_control = instance; |
6211 |
} |
6212 |
break; |
6213 |
#endregion |
6214 |
#region Poly |
6215 |
case "PolygonControl": |
6216 |
using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item)) |
6217 |
{ |
6218 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6219 |
PolygonControl instance = new PolygonControl |
6220 |
{ |
6221 |
LineSize = Convert.ToDouble(data2.First()), |
6222 |
//Toler = s.Toler, |
6223 |
IsCompleted = s.IsCompleted, |
6224 |
//PointSet = new List<Point>(), |
6225 |
Opacity = s.Opac, |
6226 |
StrokeColor = _SetColor, |
6227 |
StartPoint = s.StartPoint, |
6228 |
PointSet = s.PointSet, |
6229 |
EndPoint = s.EndPoint, |
6230 |
UserID = s.UserID, |
6231 |
//강인구 추가(Chain인지 Polygon인지 구분) |
6232 |
ControlType = s.Type, |
6233 |
DashSize = s.DashSize, |
6234 |
Paint = s.PaintState, |
6235 |
//PointC = s.PointC, |
6236 |
}; |
6237 |
//Layer.Children.Add(instance); |
6238 |
instance.CommentID = commentId; |
6239 |
instance.MarkupInfoID = markupInfoID; |
6240 |
baseLayer.Add(instance); |
6241 |
|
6242 |
instance.Memo = s.Memo; |
6243 |
instance.ApplyTemplate(); |
6244 |
instance.SetPolyPath(); |
6245 |
return_control = instance; |
6246 |
//instance.PointSet = s.PointSet; |
6247 |
//instance.ClosePath(); |
6248 |
//instance.ChangePaint(s.PaintState); |
6249 |
} |
6250 |
break; |
6251 |
#endregion |
6252 |
#region InkControl |
6253 |
case "InkControl": |
6254 |
using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(item)) |
6255 |
{ |
6256 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6257 |
InkControl instance = new InkControl |
6258 |
{ |
6259 |
LineSize = Convert.ToDouble(data2.First()), |
6260 |
//Toler = s.Toler, |
6261 |
IsCompleted = s.IsCompleted, |
6262 |
//PointSet = new List<Point>(), |
6263 |
Opacity = s.Opac, |
6264 |
StrokeColor = _SetColor, |
6265 |
StartPoint = s.StartPoint, |
6266 |
PointSet = s.PointSet, |
6267 |
UserID = s.UserID, |
6268 |
EndPoint = s.EndPoint, |
6269 |
//강인구 추가(Chain인지 Polygon인지 구분) |
6270 |
ControlType = s.Type, |
6271 |
DashSize = s.DashSize, |
6272 |
Paint = s.PaintState, |
6273 |
//PointC = s.PointC, |
6274 |
}; |
6275 |
//Layer.Children.Add(instance); |
6276 |
instance.CommentID = commentId; |
6277 |
instance.MarkupInfoID = markupInfoID; |
6278 |
baseLayer.Add(instance); |
6279 |
|
6280 |
instance.Memo = s.Memo; |
6281 |
instance.ApplyTemplate(); |
6282 |
instance.SetPolyPath(); |
6283 |
return_control = instance; |
6284 |
//instance.PointSet = s.PointSet; |
6285 |
//instance.ClosePath(); |
6286 |
//instance.ChangePaint(s.PaintState); |
6287 |
} |
6288 |
break; |
6289 |
#endregion |
6290 |
#region Cloud |
6291 |
case "CloudControl": |
6292 |
using (S_CloudControl s = JsonSerializerHelper.JsonDeserialize<S_CloudControl>(item)) |
6293 |
{ |
6294 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6295 |
CloudControl instance = new CloudControl |
6296 |
{ |
6297 |
LineSize = Convert.ToDouble(data2.First()), |
6298 |
Toler = s.Toler, |
6299 |
PointSet = new List<Point>(), |
6300 |
ArcLength = s.ArcLength, |
6301 |
Paint = s.PaintState, |
6302 |
Opacity = s.Opac, |
6303 |
StrokeColor = _SetColor, |
6304 |
isTransOn = s.IsTrans, |
6305 |
isChain = s.IsChain, |
6306 |
DashSize = s.DashSize, |
6307 |
UserID = s.UserID, |
6308 |
StartPoint = s.StartPoint, |
6309 |
EndPoint = s.EndPoint, |
6310 |
//Fill = s.CloudFill, |
6311 |
}; |
6312 |
instance.Memo = s.Memo; |
6313 |
//Layer.Children.Add(instance); |
6314 |
instance.CommentID = commentId; |
6315 |
instance.MarkupInfoID = markupInfoID; |
6316 |
baseLayer.Add(instance); |
6317 |
|
6318 |
instance.PointSet = s.PointSet; |
6319 |
instance.ApplyTemplate(); |
6320 |
instance.ClosePath(); |
6321 |
instance.ChangePaint(s.PaintState); |
6322 |
return_control = instance; |
6323 |
} |
6324 |
break; |
6325 |
#endregion |
6326 |
#region Line |
6327 |
case "LineControl": |
6328 |
using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item)) |
6329 |
{ |
6330 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6331 |
LineControl instance = new LineControl() |
6332 |
{ |
6333 |
LineStyleSet = s.LineStyleSet, |
6334 |
StartPoint = s.StartPoint, |
6335 |
DimSize = s.DimSize, |
6336 |
EndPoint = s.EndPoint, |
6337 |
DashSize = s.DashSize, |
6338 |
Interval = s.Interval, |
6339 |
PointSet = s.PointSet, |
6340 |
Opacity = s.Opac, |
6341 |
StrokeColor = _SetColor, |
6342 |
UserID = s.UserID, |
6343 |
LineSize = Convert.ToDouble(data2.First()), |
6344 |
}; |
6345 |
instance.Memo = s.Memo; |
6346 |
//Layer.Children.Add(instance); |
6347 |
instance.CommentID = commentId; |
6348 |
instance.MarkupInfoID = markupInfoID; |
6349 |
baseLayer.Add(instance); |
6350 |
instance.ApplyTemplate(); |
6351 |
instance.SetLinePath(); |
6352 |
return_control = instance; |
6353 |
} |
6354 |
break; |
6355 |
#endregion |
6356 |
#region Text |
6357 |
case "TextControl": |
6358 |
using (S_TextControl s = JsonSerializerHelper.JsonDeserialize<S_TextControl>(item)) |
6359 |
{ |
6360 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6361 |
TextControl instance = new TextControl() |
6362 |
{ |
6363 |
Text = s.Text, |
6364 |
StartPoint = s.StartPoint, |
6365 |
EndPoint = s.EndPoint, |
6366 |
CanvasX = s.StartPoint.X, |
6367 |
CanvasY = s.StartPoint.Y, |
6368 |
BoxWidth = s.BoxW, |
6369 |
BoxHeight = s.BoxH, |
6370 |
ControlType_No = s.paintMethod, |
6371 |
LineSize = new Thickness(Convert.ToDouble(data2.First())), |
6372 |
TextSize = Convert.ToDouble(data2[1]), |
6373 |
FontColor = _SetColor, |
6374 |
//FontSize = 10, |
6375 |
UserID = s.UserID, |
6376 |
//isHighLight = s.isHighLight, |
6377 |
Angle = s.Angle, |
6378 |
PointSet = s.PointSet, |
6379 |
Opacity = s.Opac, |
6380 |
TextFamily = new FontFamily(s.fontConfig[0]), |
6381 |
//인구 추가(2018.04.17) |
6382 |
TextStyle = StringToFont.ConFontStyle(s.fontConfig[1]), |
6383 |
TextWeight = StringToFont.ConFontWeight(s.fontConfig[2]), |
6384 |
}; |
6385 |
|
6386 |
if (instance.Text != null) |
6387 |
{ |
6388 |
//Layer.Children.Add(instance); |
6389 |
instance.MarkupInfoID = markupInfoID; |
6390 |
baseLayer.Add(instance); |
6391 |
System.Diagnostics.Debug.WriteLine(instance.Angle); |
6392 |
instance.ApplyTemplate(); |
6393 |
instance.Memo = s.Memo; |
6394 |
if (s.fontConfig.Count() == 4) |
6395 |
{ |
6396 |
instance.UnderLine = TextDecorations.Underline; |
6397 |
instance.Base_TextBlock.TextDecorations = instance.UnderLine; |
6398 |
} |
6399 |
instance.Base_TextBlock.Margin = new Thickness(0, 0, 10, 0); |
6400 |
|
6401 |
//instance.Base_TextBlock.Margin = new Thickness(instance.Base_TextBox.Margin.Left + 4); |
6402 |
|
6403 |
instance.Base_TextBox.Visibility = Visibility.Collapsed; |
6404 |
instance.Base_TextBlock.Visibility = Visibility.Visible; |
6405 |
|
6406 |
instance.CommentID = commentId; |
6407 |
instance.DrawingCloud(); |
6408 |
instance.SetText(); |
6409 |
return_control = instance; |
6410 |
} |
6411 |
} |
6412 |
break; |
6413 |
#endregion |
6414 |
#region Arc |
6415 |
case "ArcControl": |
6416 |
using (S_ArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArcControl>(item)) |
6417 |
{ |
6418 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6419 |
ArcControl instance = new ArcControl() |
6420 |
{ |
6421 |
StartPoint = s.StartPoint, |
6422 |
EndPoint = s.EndPoint, |
6423 |
DashSize = s.DashSize, |
6424 |
PointSet = s.PointSet, |
6425 |
isTransOn = s.IsTransOn, |
6426 |
MidPoint = s.MidPoint, |
6427 |
StrokeColor = _SetColor, |
6428 |
Clock = s.Clock, |
6429 |
Opacity = s.Opac, |
6430 |
LineSize = Convert.ToDouble(data2.First()), |
6431 |
UserID = s.UserID, |
6432 |
}; |
6433 |
instance.Memo = s.Memo; |
6434 |
//Layer.Children.Add(instance); |
6435 |
instance.MarkupInfoID = markupInfoID; |
6436 |
instance.CommentID = commentId; |
6437 |
baseLayer.Add(instance); |
6438 |
|
6439 |
instance.ApplyTemplate(); |
6440 |
instance.SetArcPath(); |
6441 |
return_control = instance; |
6442 |
} |
6443 |
break; |
6444 |
#endregion |
6445 |
#region Arc |
6446 |
case "ArrowArcControl": |
6447 |
using (S_ArrowArcControl s = JsonSerializerHelper.JsonDeserialize<S_ArrowArcControl>(item)) |
6448 |
{ |
6449 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6450 |
ArrowArcControl instance = new ArrowArcControl() |
6451 |
{ |
6452 |
StartPoint = s.StartPoint, |
6453 |
EndPoint = s.EndPoint, |
6454 |
DashSize = s.DashSize, |
6455 |
PointSet = s.PointSet, |
6456 |
isTransOn = s.IsTransOn, |
6457 |
MidPoint = s.MidPoint, |
6458 |
StrokeColor = _SetColor, |
6459 |
Clock = s.Clock, |
6460 |
Opacity = s.Opac, |
6461 |
LineSize = Convert.ToDouble(data2.First()), |
6462 |
UserID = s.UserID, |
6463 |
}; |
6464 |
instance.Memo = s.Memo; |
6465 |
//Layer.Children.Add(instance); |
6466 |
instance.MarkupInfoID = markupInfoID; |
6467 |
instance.CommentID = commentId; |
6468 |
baseLayer.Add(instance); |
6469 |
|
6470 |
instance.ApplyTemplate(); |
6471 |
instance.SetArcPath(); |
6472 |
return_control = instance; |
6473 |
} |
6474 |
break; |
6475 |
#endregion |
6476 |
#region RectCloud |
6477 |
case "RectCloudControl": |
6478 |
using (S_RectCloudControl s = JsonSerializerHelper.JsonDeserialize<S_RectCloudControl>(item)) |
6479 |
{ |
6480 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6481 |
RectCloudControl instance = new RectCloudControl() |
6482 |
{ |
6483 |
StartPoint = s.StartPoint, |
6484 |
EndPoint = s.EndPoint, |
6485 |
LeftBottomPoint = s.LB, |
6486 |
Paint = s.PaintState, |
6487 |
Opacity = s.Opac, |
6488 |
DashSize = s.DashSize, |
6489 |
TopRightPoint = s.TR, |
6490 |
PointSet = s.PointSet, |
6491 |
StrokeColor = _SetColor, |
6492 |
LineSize = Convert.ToDouble(data2.First()), |
6493 |
UserID = s.UserID, |
6494 |
ArcLength = s.ArcLength |
6495 |
}; |
6496 |
instance.Memo = s.Memo; |
6497 |
//Layer.Children.Add(instance); |
6498 |
instance.MarkupInfoID = markupInfoID; |
6499 |
instance.CommentID = commentId; |
6500 |
baseLayer.Add(instance); |
6501 |
|
6502 |
instance.ApplyTemplate(); |
6503 |
instance.SetRectCloud(); |
6504 |
return_control = instance; |
6505 |
} |
6506 |
break; |
6507 |
#endregion |
6508 |
#region Sign |
6509 |
case "SignControl": |
6510 |
using (S_SignControl s = JsonSerializerHelper.JsonDeserialize<S_SignControl>(item)) |
6511 |
{ |
6512 |
SignControl instance = new SignControl |
6513 |
{ |
6514 |
Angle = s.Angle, |
6515 |
StartPoint = s.StartPoint, |
6516 |
TopRightPoint = s.TR, |
6517 |
EndPoint = s.EndPoint, |
6518 |
LeftBottomPoint = s.LB, |
6519 |
PointSet = s.PointSet, |
6520 |
Opacity = s.Opac, |
6521 |
SignImage = null, |
6522 |
UserID = s.UserID, |
6523 |
}; |
6524 |
instance.ApplyTemplate(); |
6525 |
//instance.ImageData = new BitmapImage(new Uri(s.ImagePath)); |
6526 |
|
6527 |
if (s.UserNumber != null) |
6528 |
{ |
6529 |
var _sign = getUser.GetSign(s.UserNumber, ProjectNo); |
6530 |
if (_sign != null) |
6531 |
{ |
6532 |
byte[] imageBytes = System.Convert.FromBase64String(_sign); |
6533 |
|
6534 |
System.IO.MemoryStream stream = new System.IO.MemoryStream(); |
6535 |
stream.Write(imageBytes, 0, imageBytes.Length); |
6536 |
stream.Position = 0; |
6537 |
System.Drawing.Image img = System.Drawing.Image.FromStream(stream); |
6538 |
BitmapImage returnImage = new BitmapImage(); |
6539 |
returnImage.BeginInit(); |
6540 |
System.IO.MemoryStream ms = new System.IO.MemoryStream(); |
6541 |
img.Save(ms, System.Drawing.Imaging.ImageFormat.Png); |
6542 |
ms.Seek(0, System.IO.SeekOrigin.Begin); |
6543 |
returnImage.StreamSource = ms; |
6544 |
returnImage.EndInit(); |
6545 |
stream.Close(); |
6546 |
instance.SignImage = returnImage; |
6547 |
} |
6548 |
} |
6549 |
|
6550 |
instance.MarkupInfoID = markupInfoID; |
6551 |
instance.CommentID = commentId; |
6552 |
baseLayer.Add(instance); |
6553 |
instance.ApplyTemplate(); |
6554 |
instance.SetImage(); |
6555 |
return_control = instance; |
6556 |
} |
6557 |
break; |
6558 |
#endregion |
6559 |
#region Ink |
6560 |
case "InkPresenter": |
6561 |
using (S_PensilControl s = JsonSerializerHelper.JsonDeserialize<S_PensilControl>(item)) |
6562 |
{ |
6563 |
#if SILVERLIGHT |
6564 |
this._InkBoard.Strokes = s.SCC; |
6565 |
#endif |
6566 |
} |
6567 |
break; |
6568 |
#endregion |
6569 |
#region Date |
6570 |
case "DateControl": |
6571 |
{ |
6572 |
using (S_DateControl s = JsonSerializerHelper.JsonDeserialize<S_DateControl>(item)) |
6573 |
{ |
6574 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6575 |
DateControl instance = new DateControl |
6576 |
{ |
6577 |
Angle = s.Angle, |
6578 |
StartPoint = s.StartPoint, |
6579 |
EndPoint = s.EndPoint, |
6580 |
LeftBottomPoint = s.LB, |
6581 |
TopRightPoint = s.TR, |
6582 |
Opacity = s.Opac, |
6583 |
FontColor = _SetColor, |
6584 |
LineSize = Convert.ToDouble(data2.First()), |
6585 |
Text = s.Text, |
6586 |
PointSet = s.PointSet, |
6587 |
UserID = s.UserID |
6588 |
}; |
6589 |
instance.Memo = s.Memo; |
6590 |
//Layer.Children.Add(instance); |
6591 |
instance.CommentID = commentId; |
6592 |
instance.MarkupInfoID = markupInfoID; |
6593 |
baseLayer.Add(instance); |
6594 |
|
6595 |
instance.ApplyTemplate(); |
6596 |
instance.SetDate(); |
6597 |
return_control = instance; |
6598 |
} |
6599 |
} |
6600 |
break; |
6601 |
#endregion |
6602 |
#region Symbol |
6603 |
case "SymControl": |
6604 |
using (S_SymControl s = JsonSerializerHelper.JsonDeserialize<S_SymControl>(item)) |
6605 |
{ |
6606 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6607 |
Common.StringToPathConverter sm = new Common.StringToPathConverter(); |
6608 |
SymControl instance = new SymControl() |
6609 |
{ |
6610 |
LineSize = Convert.ToDouble(data2.First()), |
6611 |
PointSet = s.PointSet, |
6612 |
Paint = s.PaintState, |
6613 |
StartPoint = s.StartPoint, |
6614 |
StrokeColor = _SetColor, |
6615 |
EndPoint = s.EndPoint, |
6616 |
Angle = s.Angle, |
6617 |
LeftBottomPoint = s.LB, |
6618 |
TopRightPoint = s.TR, |
6619 |
PathData = sm.Convert(s.PathInfo.ToString()), |
6620 |
Opacity = s.Opac, |
6621 |
}; |
6622 |
|
6623 |
instance.Memo = s.Memo; |
6624 |
|
6625 |
instance.CommentID = commentId; |
6626 |
instance.MarkupInfoID = markupInfoID; |
6627 |
baseLayer.Add(instance); |
6628 |
instance.ApplyTemplate(); |
6629 |
instance.SetSymPath(); |
6630 |
return_control = instance; |
6631 |
} |
6632 |
break; |
6633 |
#endregion |
6634 |
#region Image |
6635 |
case "ImgControl": |
6636 |
using (S_ImgControl s = JsonSerializerHelper.JsonDeserialize<S_ImgControl>(item)) |
6637 |
{ |
6638 |
Image img = new Image(); |
6639 |
//img.Source = new BitmapImage(new Uri(s.ImagePath)); |
6640 |
if (s.ImagePath.Contains(".svg")) |
6641 |
{ |
6642 |
byte[] imageData = null; |
6643 |
DrawingImage image = null; |
6644 |
using (System.Net.WebClient web = new System.Net.WebClient()) |
6645 |
{ |
6646 |
imageData = web.DownloadData(new Uri(s.ImagePath)); |
6647 |
System.IO.Stream stream = new System.IO.MemoryStream(imageData); |
6648 |
image = SvgReader.Load(stream); |
6649 |
} |
6650 |
img.Source = image; |
6651 |
} |
6652 |
else |
6653 |
{ |
6654 |
img.Source = new BitmapImage(new Uri(s.ImagePath)); |
6655 |
} |
6656 |
ImgControl instance = new ImgControl |
6657 |
{ |
6658 |
Angle = s.Angle, |
6659 |
StartPoint = s.StartPoint, |
6660 |
TopRightPoint = s.TR, |
6661 |
EndPoint = s.EndPoint, |
6662 |
LeftBottomPoint = s.LB, |
6663 |
PointSet = s.PointSet, |
6664 |
Opacity = s.Opac, |
6665 |
FilePath = s.ImagePath, |
6666 |
UserID = s.UserID, |
6667 |
ImageData = img.Source |
6668 |
}; |
6669 |
//Layer.Children.Add(instance); |
6670 |
instance.Memo = s.Memo; |
6671 |
|
6672 |
instance.CommentID = commentId; |
6673 |
instance.MarkupInfoID = markupInfoID; |
6674 |
baseLayer.Add(instance); |
6675 |
instance.ApplyTemplate(); |
6676 |
//instance.ImageData = new BitmapImage(new Uri(s.ImagePath)); |
6677 |
instance.ImageData = img.Source; |
6678 |
instance.SetImage(); |
6679 |
return_control = instance; |
6680 |
} |
6681 |
break; |
6682 |
#endregion |
6683 |
#region SymbolN |
6684 |
case "SymControlN": |
6685 |
using (S_SymControlN s = JsonSerializerHelper.JsonDeserialize<S_SymControlN>(item)) |
6686 |
{ |
6687 |
SymControlN instance = new SymControlN() |
6688 |
{ |
6689 |
PointSet = s.PointSet, |
6690 |
StartPoint = s.StartPoint, |
6691 |
EndPoint = s.EndPoint, |
6692 |
Angle = s.Angle, |
6693 |
LeftBottomPoint = s.LB, |
6694 |
TopRightPoint = s.TR, |
6695 |
Opacity = s.Opac, |
6696 |
PathXathData = s.DBData, |
6697 |
}; |
6698 |
instance.Memo = s.Memo; |
6699 |
instance.CommentID = commentId; |
6700 |
instance.MarkupInfoID = markupInfoID; |
6701 |
baseLayer.Add(instance); |
6702 |
|
6703 |
instance.ApplyTemplate(); |
6704 |
|
6705 |
var xamlData = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString_NonPrefix(instance.PathXathData); |
6706 |
xamlData = xamlData.Replace("daelim", "DAELIM"); |
6707 |
System.IO.MemoryStream stream = new System.IO.MemoryStream(); |
6708 |
System.IO.StreamWriter writer = new System.IO.StreamWriter(stream); |
6709 |
writer.Write(xamlData); |
6710 |
writer.Flush(); |
6711 |
stream.Position = 0; |
6712 |
|
6713 |
object obj = XamlReader.Load(stream); |
6714 |
instance.Base_ViewBox.Child = obj as UIElement; |
6715 |
instance.SetViewBox(); |
6716 |
return_control = instance; |
6717 |
} |
6718 |
break; |
6719 |
#endregion |
6720 |
|
6721 |
#region Cad |
6722 |
case "InsideWhiteControl": |
6723 |
using (S_InsideWhiteControl s = JsonSerializerHelper.JsonDeserialize<S_InsideWhiteControl>(item)) |
6724 |
{ |
6725 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6726 |
InsideWhiteControl instance = new InsideWhiteControl |
6727 |
{ |
6728 |
LineSize = Convert.ToDouble(data2.First()), |
6729 |
Paint = s.PaintState, |
6730 |
StartPoint = s.StartPoint, |
6731 |
EndPoint = s.EndPoint, |
6732 |
Angle = s.Angle, |
6733 |
StrokeColor = Brushes.White, |
6734 |
DashSize = s.DashSize, |
6735 |
Opacity = s.Opac, |
6736 |
LeftBottomPoint = s.LB, |
6737 |
TopRightPoint = s.TR, |
6738 |
PointSet = s.PointSet, |
6739 |
UserID = s.UserID, |
6740 |
FillColor = Brushes.White, |
6741 |
}; |
6742 |
|
6743 |
instance.Memo = s.Memo; |
6744 |
//Layer.Children.Add(instance); |
6745 |
instance.CommentID = commentId; |
6746 |
instance.MarkupInfoID = markupInfoID; |
6747 |
baseLayer.Add(instance); |
6748 |
instance.ApplyTemplate(); |
6749 |
instance.SetRectPath(); |
6750 |
|
6751 |
return_control = instance; |
6752 |
} |
6753 |
break; |
6754 |
case "OverlapWhiteControl": |
6755 |
using (S_OverlapWhiteControl s = JsonSerializerHelper.JsonDeserialize<S_OverlapWhiteControl>(item)) |
6756 |
{ |
6757 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6758 |
OverlapWhiteControl instance = new OverlapWhiteControl |
6759 |
{ |
6760 |
LineSize = Convert.ToDouble(data2.First()), |
6761 |
Paint = s.PaintState, |
6762 |
StartPoint = s.StartPoint, |
6763 |
EndPoint = s.EndPoint, |
6764 |
Angle = s.Angle, |
6765 |
StrokeColor = Brushes.White, |
6766 |
DashSize = s.DashSize, |
6767 |
Opacity = s.Opac, |
6768 |
LeftBottomPoint = s.LB, |
6769 |
TopRightPoint = s.TR, |
6770 |
PointSet = s.PointSet, |
6771 |
UserID = s.UserID, |
6772 |
FillColor = Brushes.White, |
6773 |
}; |
6774 |
|
6775 |
instance.Memo = s.Memo; |
6776 |
//Layer.Children.Add(instance); |
6777 |
instance.CommentID = commentId; |
6778 |
instance.MarkupInfoID = markupInfoID; |
6779 |
baseLayer.Add(instance); |
6780 |
instance.ApplyTemplate(); |
6781 |
instance.SetRectPath(); |
6782 |
|
6783 |
return_control = instance; |
6784 |
} |
6785 |
break; |
6786 |
case "ClipWhiteControl": |
6787 |
using (S_ClipWhiteControl s = JsonSerializerHelper.JsonDeserialize<S_ClipWhiteControl>(item)) |
6788 |
{ |
6789 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6790 |
ClipWhiteControl instance = new ClipWhiteControl |
6791 |
{ |
6792 |
LineSize = Convert.ToDouble(data2.First()), |
6793 |
Paint = s.PaintState, |
6794 |
StartPoint = s.StartPoint, |
6795 |
EndPoint = s.EndPoint, |
6796 |
Angle = s.Angle, |
6797 |
StrokeColor = Brushes.White, |
6798 |
DashSize = s.DashSize, |
6799 |
Opacity = s.Opac, |
6800 |
LeftBottomPoint = s.LB, |
6801 |
TopRightPoint = s.TR, |
6802 |
PointSet = s.PointSet, |
6803 |
UserID = s.UserID, |
6804 |
FillColor = Brushes.White, |
6805 |
}; |
6806 |
|
6807 |
instance.Memo = s.Memo; |
6808 |
//Layer.Children.Add(instance); |
6809 |
instance.CommentID = commentId; |
6810 |
instance.MarkupInfoID = markupInfoID; |
6811 |
baseLayer.Add(instance); |
6812 |
instance.ApplyTemplate(); |
6813 |
instance.SetRectPath(); |
6814 |
|
6815 |
return_control = instance; |
6816 |
} |
6817 |
break; |
6818 |
case "CoordinateControl": |
6819 |
using (S_CoordinateControl s = JsonSerializerHelper.JsonDeserialize<S_CoordinateControl>(item)) |
6820 |
{ |
6821 |
string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
6822 |
CoordinateControl instance = new CoordinateControl |
6823 |
{ |
6824 |
LineSize = Convert.ToDouble(data2.First()), |
6825 |
Paint = s.PaintState, |
6826 |
StartPoint = s.StartPoint, |
6827 |
EndPoint = s.EndPoint, |
6828 |
Angle = s.Angle, |
6829 |
StrokeColor = Brushes.Yellow, |
6830 |
DashSize = s.DashSize, |
6831 |
Opacity = s.Opac, |
6832 |
LeftBottomPoint = s.LB, |
6833 |
TopRightPoint = s.TR, |
6834 |
PointSet = s.PointSet, |
6835 |
UserID = s.UserID, |
6836 |
// FillColor = Brushes.Yellow, |
6837 |
}; |
6838 |
|
6839 |
instance.Memo = s.Memo; |
6840 |
//Layer.Children.Add(instance); |
6841 |
instance.CommentID = commentId; |
6842 |
instance.MarkupInfoID = markupInfoID; |
6843 |
baseLayer.Add(instance); |
6844 |
instance.ApplyTemplate(); |
6845 |
instance.SetRectPath(); |
6846 |
|
6847 |
return_control = instance; |
6848 |
} |
6849 |
break; |
6850 |
#endregion |
6851 |
default: |
6852 |
|
6853 |
break; |
6854 |
}; |
6855 |
} |
6856 |
} |
6857 |
return return_control; |
6858 |
} |
6859 |
|
6860 |
} |
6861 |
} |