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