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