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 MarkupToPDF.Controls;
|
12
|
using MarkupToPDF.Controls.Line;
|
13
|
using MarkupToPDF.Controls.Shape;
|
14
|
using MarkupToPDF.Controls.Polygon;
|
15
|
using MarkupToPDF.Controls.Text;
|
16
|
using MarkupToPDF.Controls.Etc;
|
17
|
using MarkupToPDF.Controls.Common.ValueConverter;
|
18
|
using MarkupToPDF.Serialize.S_Control;
|
19
|
using MarkupToPDF.Serialize.Core;
|
20
|
using System.Collections.Generic;
|
21
|
using System.Collections.ObjectModel;
|
22
|
using System.Text;
|
23
|
using MarkupToPDF.Controls.Common;
|
24
|
using MarkupToPDF.Common;
|
25
|
|
26
|
namespace MarkupToPDF.Controls.Parsing
|
27
|
{
|
28
|
//public partial class LayerControl : Control
|
29
|
//{
|
30
|
//public class MarkupReturn
|
31
|
//{
|
32
|
// public string ConvertData { get; set; }
|
33
|
// public int DATA_TYPE { get; set; }
|
34
|
//}
|
35
|
|
36
|
//public string MarkupToString(ObservableCollection<CommentUserInfo> baseLayer, string UserId)
|
37
|
//{
|
38
|
|
39
|
// String ConvertData = "";
|
40
|
|
41
|
// #region ######### 마크업 파싱##########
|
42
|
// foreach (UIElement item in baseLayer)
|
43
|
// {
|
44
|
// switch (item.GetType().Name.ToString())
|
45
|
// {
|
46
|
// #region Arrow_Multi
|
47
|
// case "ArrowControl_Multi":
|
48
|
// using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi())
|
49
|
// {
|
50
|
// var instance = item as ArrowControl_Multi;
|
51
|
// STemp.TransformPoint = "0|0";
|
52
|
// STemp.PointSet = instance.PointSet;
|
53
|
// STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
54
|
// STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
55
|
// STemp.StartPoint = instance.StartPoint;
|
56
|
// STemp.EndPoint = instance.EndPoint;
|
57
|
// STemp.UserID = UserId;
|
58
|
// STemp.Opac = instance.Opacity;
|
59
|
// STemp.DashSize = instance.DashSize;
|
60
|
// STemp.MidPoint = instance.MiddlePoint;
|
61
|
// STemp.Name = instance.GetType().Name.ToString();
|
62
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
63
|
// };
|
64
|
// break;
|
65
|
// #endregion
|
66
|
// #region ArrowText
|
67
|
// case "ArrowTextControl":
|
68
|
// using (S_ArrowTextControl STemp = new S_ArrowTextControl())
|
69
|
// {
|
70
|
// var instance = item as ArrowTextControl;
|
71
|
// STemp.TransformPoint = "0|0";
|
72
|
// STemp.PointSet = instance.PointSet;
|
73
|
// STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
74
|
// STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
75
|
// STemp.StartPoint = instance.StartPoint;
|
76
|
// STemp.ArrowStyle = instance.ArrowTextStyle;
|
77
|
// STemp.UserID = UserId;
|
78
|
// STemp.ArrowText = instance.Base_TextBox.Text;
|
79
|
// STemp.BorderSize = instance.BorderSize;
|
80
|
// STemp.isHighLight = instance.isHighLight;
|
81
|
// STemp.BoxHeight = instance.BoxHeight;
|
82
|
// STemp.BoxWidth = instance.BoxWidth;
|
83
|
// STemp.Opac = instance.Opacity;
|
84
|
// STemp.EndPoint = instance.EndPoint;
|
85
|
// STemp.isFixed = instance.isFixed;
|
86
|
// //STemp.DashSize = instance.DashSize;
|
87
|
// STemp.Name = instance.GetType().Name.ToString();
|
88
|
// STemp.isTrans = instance.isTrans;
|
89
|
// STemp.MidPoint = instance.MidPoint;
|
90
|
// STemp.Angle = instance.Angle;
|
91
|
// STemp.fontConfig = new List<string>()
|
92
|
// {
|
93
|
// instance.TextFamily.ToString(),
|
94
|
// instance.TextStyle.ToString(),
|
95
|
// instance.TextWeight.ToString(),
|
96
|
// instance.TextSize.ToString(),
|
97
|
// };
|
98
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
99
|
// };
|
100
|
// break;
|
101
|
// #endregion
|
102
|
// #region Line
|
103
|
// case "LineControl":
|
104
|
// using (S_LineControl STemp = new S_LineControl())
|
105
|
// {
|
106
|
// var instance = item as LineControl;
|
107
|
// STemp.TransformPoint = "0|0";
|
108
|
// STemp.PointSet = instance.PointSet;
|
109
|
// STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
110
|
// STemp.LineStyleSet = instance.LineStyleSet;
|
111
|
// STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
112
|
// STemp.StartPoint = instance.StartPoint;
|
113
|
// STemp.EndPoint = instance.EndPoint;
|
114
|
// STemp.UserID = UserId;
|
115
|
// STemp.Opac = instance.Opacity;
|
116
|
// STemp.DashSize = instance.DashSize;
|
117
|
// STemp.Interval = instance.Interval;
|
118
|
// STemp.DimSize = instance.DimSize;
|
119
|
// STemp.Name = instance.GetType().Name.ToString();
|
120
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
121
|
// };
|
122
|
// break;
|
123
|
// #endregion
|
124
|
// #region Arc
|
125
|
// case "ArcControl":
|
126
|
// using (S_ArcControl STemp = new S_ArcControl())
|
127
|
// {
|
128
|
// var instance = item as ArcControl;
|
129
|
// STemp.TransformPoint = "0|0";
|
130
|
// STemp.PointSet = instance.PointSet;
|
131
|
// STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
132
|
// STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
133
|
// STemp.StartPoint = instance.StartPoint;
|
134
|
// STemp.UserID = UserId;
|
135
|
// STemp.Opac = instance.Opacity;
|
136
|
// STemp.MidPoint = instance.MidPoint;
|
137
|
// STemp.EndPoint = instance.EndPoint;
|
138
|
// STemp.IsTransOn = instance.isTransOn;
|
139
|
// STemp.DashSize = instance.DashSize;
|
140
|
// STemp.Clock = instance.Clock;
|
141
|
// //STemp.ArcStyleSet = instance.ControlType;
|
142
|
// STemp.Name = instance.GetType().Name.ToString();
|
143
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
144
|
// };
|
145
|
// break;
|
146
|
// #endregion
|
147
|
// #region RectCloud
|
148
|
// case "RectCloudControl":
|
149
|
// {
|
150
|
// using (S_RectCloudControl STemp = new S_RectCloudControl())
|
151
|
// {
|
152
|
// var instance = item as RectCloudControl;
|
153
|
// STemp.TransformPoint = "0|0";
|
154
|
// STemp.PointSet = instance.PointSet;
|
155
|
// STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
156
|
// STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
157
|
// STemp.StartPoint = instance.StartPoint;
|
158
|
// STemp.UserID = UserId;
|
159
|
// STemp.Opac = instance.Opacity;
|
160
|
// STemp.TR = instance.TopRightPoint;
|
161
|
// STemp.LB = instance.LeftBottomPoint;
|
162
|
// STemp.EndPoint = instance.EndPoint;
|
163
|
// STemp.PaintState = instance.Paint;
|
164
|
// STemp.DashSize = instance.DashSize;
|
165
|
// STemp.Name = instance.GetType().Name.ToString();
|
166
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
167
|
// }
|
168
|
// }
|
169
|
// break;
|
170
|
// #endregion
|
171
|
// #region Circle
|
172
|
// case "CircleControl":
|
173
|
// using (S_CircleControl STemp = new S_CircleControl())
|
174
|
// {
|
175
|
// var instance = item as CircleControl;
|
176
|
// STemp.TransformPoint = "0|0";
|
177
|
// STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
178
|
// STemp.PaintState = instance.Paint;
|
179
|
// STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
180
|
// if (instance.FillColor != null)
|
181
|
// {
|
182
|
// STemp.FillColor = instance.FillColor.Color.ToString();
|
183
|
// }
|
184
|
// STemp.StartPoint = instance.StartPoint;
|
185
|
// STemp.UserID = UserId;
|
186
|
// STemp.EndPoint = instance.EndPoint;
|
187
|
// STemp.TRP = instance.TopRightPoint;
|
188
|
// STemp.LBP = instance.LeftBottomPoint;
|
189
|
// STemp.Opac = instance.Opacity;
|
190
|
// STemp.Angle = instance.Angle;
|
191
|
// STemp.PointSet = instance.PointSet;
|
192
|
// STemp.DashSize = instance.DashSize;
|
193
|
// STemp.Name = instance.GetType().Name.ToString();
|
194
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
195
|
// };
|
196
|
// break;
|
197
|
// #endregion
|
198
|
// #region Rectangle
|
199
|
// case "RectangleControl":
|
200
|
// using (S_RectControl STemp = new S_RectControl())
|
201
|
// {
|
202
|
// var instance = item as RectangleControl;
|
203
|
// STemp.TransformPoint = "0|0";
|
204
|
// STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
205
|
// STemp.PaintState = instance.Paint;
|
206
|
// STemp.PointSet = instance.PointSet;
|
207
|
// STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
208
|
// if (instance.FillColor != null)
|
209
|
// {
|
210
|
// STemp.FillColor = instance.FillColor.Color.ToString();
|
211
|
// }
|
212
|
// STemp.StartPoint = instance.StartPoint;
|
213
|
// STemp.UserID = instance.Uid;
|
214
|
// //STemp.Angle = instance.a;
|
215
|
// STemp.EndPoint = instance.EndPoint;
|
216
|
// STemp.LB = instance.LeftBottomPoint;
|
217
|
// STemp.TR = instance.TopRightPoint;
|
218
|
// //STemp.DashSize = instance.DashSize;
|
219
|
// STemp.Opac = instance.Opacity;
|
220
|
// STemp.Name = instance.GetType().Name.ToString();
|
221
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
222
|
// };
|
223
|
// break;
|
224
|
// #endregion
|
225
|
// #region Triangle
|
226
|
// case "TriControl":
|
227
|
// using (S_TriControl STemp = new S_TriControl())
|
228
|
// {
|
229
|
// var instance = item as TriControl;
|
230
|
// STemp.TransformPoint = "0|0";
|
231
|
// STemp.Paint = instance.Paint;
|
232
|
// STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
233
|
// STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
234
|
// if (instance.FillColor != null)
|
235
|
// {
|
236
|
// STemp.FillColor = instance.FillColor.Color.ToString();
|
237
|
// }
|
238
|
// STemp.StartPoint = instance.StartPoint;
|
239
|
// STemp.EndPoint = instance.EndPoint;
|
240
|
// STemp.MidPoint = instance.MidPoint;
|
241
|
// STemp.Opac = instance.Opacity;
|
242
|
// STemp.UserID = UserId;
|
243
|
// STemp.PointSet = instance.PointSet;
|
244
|
// STemp.Angle = instance.Angle;
|
245
|
// STemp.DashSize = instance.DashSize;
|
246
|
// STemp.Name = instance.GetType().Name.ToString();
|
247
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
248
|
// }
|
249
|
// break;
|
250
|
// #endregion
|
251
|
// #region Poly
|
252
|
// case "PolygonControl":
|
253
|
// using (S_PolyControl STemp = new S_PolyControl())
|
254
|
// {
|
255
|
// var instance = item as PolygonControl;
|
256
|
|
257
|
// STemp.TransformPoint = "0|0";
|
258
|
// STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
259
|
// //STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
260
|
// STemp.Name = instance.GetType().Name.ToString();
|
261
|
// //STemp.Toler = instance.Toler;
|
262
|
// //STemp.PaintState = instance.Paint;
|
263
|
// STemp.Opac = instance.Opacity;
|
264
|
// STemp.UserID = UserId;
|
265
|
// //STemp.IsTrans = instance.isTransOn;
|
266
|
// //STemp.IsChain = instance.isChain;
|
267
|
// STemp.PointSet = new List<Point>();
|
268
|
// //STemp.DashSize = instance.DashSize;
|
269
|
// STemp.IsCompleted = instance.IsCompleted;
|
270
|
// foreach (var point in instance.PointSet)
|
271
|
// {
|
272
|
// STemp.PointSet.Add(point);
|
273
|
// }
|
274
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
275
|
// };
|
276
|
// break;
|
277
|
// #endregion
|
278
|
// #region Cloud
|
279
|
// case "CloudControl":
|
280
|
// using (S_CloudControl STemp = new S_CloudControl())
|
281
|
// {
|
282
|
// var instance = item as CloudControl;
|
283
|
|
284
|
// STemp.TransformPoint = "0|0";
|
285
|
// STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
286
|
// STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
287
|
// STemp.Name = instance.GetType().Name.ToString();
|
288
|
// STemp.Toler = instance.Toler;
|
289
|
// STemp.PaintState = instance.Paint;
|
290
|
// STemp.Opac = instance.Opacity;
|
291
|
// STemp.UserID = UserId;
|
292
|
// STemp.IsTrans = instance.isTransOn;
|
293
|
// STemp.IsChain = instance.isChain;
|
294
|
// STemp.PointSet = new List<Point>();
|
295
|
// STemp.DashSize = instance.DashSize;
|
296
|
// foreach (var point in instance.PointSet)
|
297
|
// {
|
298
|
// STemp.PointSet.Add(point);
|
299
|
// }
|
300
|
|
301
|
// //STemp.CloudFill = instance.Fill;
|
302
|
// STemp.ArcLength = instance.ArcLength;
|
303
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
304
|
// }
|
305
|
// break;
|
306
|
// #endregion
|
307
|
// #region Sign
|
308
|
// case "SignControl":
|
309
|
// {
|
310
|
// using (S_SignControl STemp = new S_SignControl())
|
311
|
// {
|
312
|
// //SignControl instance = item as SignControl;
|
313
|
// //STemp.Angle = instance.Angle;
|
314
|
// //STemp.EndPoint = instance.EndPoint;
|
315
|
// //STemp.UserID = UserId;
|
316
|
// //STemp.LB = instance.LeftBottomPoint;
|
317
|
// //STemp.Name = instance.GetType().Name;
|
318
|
// //STemp.PointSet = instance.PointSet;
|
319
|
// //STemp.StartPoint = instance.StartPoint;
|
320
|
// //STemp.Opac = instance.Opacity;
|
321
|
// //STemp.TR = instance.TopRightPoint;
|
322
|
// //STemp.UserNumber = instance.UserNumber;
|
323
|
// //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
324
|
// }
|
325
|
// }
|
326
|
// break;
|
327
|
// #endregion
|
328
|
// #region Ink
|
329
|
// case "InkPresenter":
|
330
|
// {
|
331
|
// var instance = item as InkPresenter;
|
332
|
// if (instance.Strokes.Count >= 1)
|
333
|
// {
|
334
|
// using (S_PensilControl STemp = new S_PensilControl())
|
335
|
// {
|
336
|
// bool isRealData = true;
|
337
|
// foreach (var strokeData in instance.Strokes)
|
338
|
// {
|
339
|
// if (strokeData.StylusPoints.Count == 0)
|
340
|
// {
|
341
|
// isRealData = false;
|
342
|
// }
|
343
|
// }
|
344
|
// if (isRealData)
|
345
|
// {
|
346
|
// if (instance.Tag != null)
|
347
|
// {
|
348
|
// STemp.UserID = instance.Tag.ToString();
|
349
|
// }
|
350
|
// STemp.SCC = instance.Strokes;
|
351
|
// STemp.Name = instance.GetType().Name;
|
352
|
// STemp.Opac = instance.Opacity;
|
353
|
// STemp.TransformPoint = "0|0";
|
354
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
355
|
// }
|
356
|
// }
|
357
|
// }
|
358
|
// }
|
359
|
// break;
|
360
|
// #endregion
|
361
|
// #region Text
|
362
|
// case "TextControl":
|
363
|
// using (S_TextControl STemp = new S_TextControl())
|
364
|
// {
|
365
|
|
366
|
// var instance = item as TextControl;
|
367
|
// STemp.TransformPoint = "0|0";
|
368
|
// STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString());
|
369
|
// STemp.Text = instance.Text;
|
370
|
// STemp.UserID = UserId;
|
371
|
// STemp.FontColor = instance.FontColor.Color.ToString();
|
372
|
// //STemp.EndPoint = instance.EndPoint;
|
373
|
// STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY);
|
374
|
// STemp.Opac = instance.Opacity;
|
375
|
// //STemp.StartPoint = instance.StartPoint;
|
376
|
// STemp.PointSet = instance.PointSet;
|
377
|
// STemp.Angle = instance.Angle;
|
378
|
// STemp.paintMethod = instance.ControlType_No;
|
379
|
// STemp.BoxW = instance.BoxWidth;
|
380
|
// STemp.BoxH = instance.BoxHeight;
|
381
|
// STemp.isHighLight = instance.IsHighLight;
|
382
|
// STemp.Name = instance.GetType().Name.ToString();
|
383
|
// STemp.fontConfig = new List<string>()
|
384
|
// {
|
385
|
// instance.TextFamily.ToString(),
|
386
|
// instance.TextStyle.ToString(),
|
387
|
// instance.TextWeight.ToString(),
|
388
|
// };
|
389
|
|
390
|
|
391
|
|
392
|
// if (instance.UnderLine != null)
|
393
|
// {
|
394
|
// STemp.fontConfig.Add("true");
|
395
|
// }
|
396
|
|
397
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
398
|
// }
|
399
|
// break;
|
400
|
// #endregion
|
401
|
// #region Date
|
402
|
// case "DateControl":
|
403
|
// {
|
404
|
// using (S_DateControl STemp = new S_DateControl())
|
405
|
// {
|
406
|
// DateControl instance = item as DateControl;
|
407
|
// STemp.Angle = instance.Angle;
|
408
|
// STemp.EndPoint = instance.EndPoint;
|
409
|
// STemp.UserID = UserId;
|
410
|
// STemp.LB = instance.LeftBottomPoint;
|
411
|
// STemp.Name = instance.GetType().Name;
|
412
|
// STemp.PointSet = instance.PointSet;
|
413
|
// STemp.StartPoint = instance.StartPoint;
|
414
|
// STemp.Opac = instance.Opacity;
|
415
|
// STemp.TR = instance.TopRightPoint;
|
416
|
// STemp.TransformPoint = "0|0";
|
417
|
// STemp.FontColor = instance.FontColor.Color.ToString();
|
418
|
// STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
419
|
// STemp.Text = instance.Text;
|
420
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
421
|
// }
|
422
|
// }
|
423
|
// break;
|
424
|
// #endregion
|
425
|
// #region Symbol
|
426
|
// case "SymControl":
|
427
|
// using (S_SymControl STemp = new S_SymControl())
|
428
|
// {
|
429
|
// //var instance = item as SymControl;
|
430
|
// //STemp.TransformPoint = "0|0";
|
431
|
// //STemp.PointSet = instance.PointSet;
|
432
|
// //STemp.UserID = UserId;
|
433
|
// //STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString());
|
434
|
// //STemp.PaintState = instance.Paint;
|
435
|
// //STemp.PathInfo = instance.PathData.ToString();
|
436
|
// //STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
437
|
// //STemp.StartPoint = instance.StartPoint;
|
438
|
// //STemp.Angle = instance.Angle;
|
439
|
// //STemp.EndPoint = instance.EndPoint;
|
440
|
// //STemp.LB = instance.LeftBottomPoint;
|
441
|
// //STemp.TR = instance.TopRightPoint;
|
442
|
// //STemp.Opac = instance.Opacity;
|
443
|
// //STemp.Name = instance.GetType().Name.ToString();
|
444
|
// //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
445
|
// }
|
446
|
// break;
|
447
|
// #endregion
|
448
|
// #region SymbolN
|
449
|
// case "SymControlN":
|
450
|
// using (S_SymControlN STemp = new S_SymControlN())
|
451
|
// {
|
452
|
// //var instance = item as SymControlN;
|
453
|
// //STemp.TransformPoint = "0|0";
|
454
|
// //STemp.PointSet = instance.PointSet;
|
455
|
// ////STemp.XamlData = instance.PathXathData;
|
456
|
// //STemp.UserID = UserId;
|
457
|
// //STemp.DBData = JsonSerializerHelper.CompressString(instance.PathXathData);
|
458
|
// ////STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
459
|
// //STemp.StartPoint = instance.StartPoint;
|
460
|
// //STemp.Angle = instance.Angle;
|
461
|
// //STemp.EndPoint = instance.EndPoint;
|
462
|
// //STemp.LB = instance.LeftBottomPoint;
|
463
|
// //STemp.TR = instance.TopRightPoint;
|
464
|
// //STemp.Opac = instance.Opacity;
|
465
|
// //STemp.Name = instance.GetType().Name.ToString();
|
466
|
// //ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
467
|
// }
|
468
|
// break;
|
469
|
// #endregion
|
470
|
// #region Image
|
471
|
// case "ImgControl":
|
472
|
// using (S_ImgControl STemp = new S_ImgControl())
|
473
|
// {
|
474
|
// ImgControl instance = item as ImgControl;
|
475
|
// STemp.Angle = instance.Angle;
|
476
|
// STemp.EndPoint = instance.EndPoint;
|
477
|
// STemp.LB = instance.LeftBottomPoint;
|
478
|
// STemp.Name = instance.GetType().Name;
|
479
|
// STemp.PointSet = instance.PointSet;
|
480
|
// STemp.StartPoint = instance.StartPoint;
|
481
|
// STemp.UserID = UserId;
|
482
|
// STemp.Opac = instance.Opacity;
|
483
|
// STemp.TR = instance.TopRightPoint;
|
484
|
// STemp.ImagePath = instance.FilePath;
|
485
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
486
|
// }
|
487
|
// break;
|
488
|
// #endregion
|
489
|
// default:
|
490
|
// break;
|
491
|
// }
|
492
|
// }
|
493
|
// #endregion
|
494
|
|
495
|
// return ConvertData;
|
496
|
//}
|
497
|
|
498
|
public partial class LayerControl : Control
|
499
|
{
|
500
|
|
501
|
public MarkupReturn MarkupToString(CommentUserInfo Control, string UserId)
|
502
|
{
|
503
|
MarkupReturn Data = new MarkupReturn();
|
504
|
Data.ConvertData = "";
|
505
|
Data.DATA_TYPE = 0;
|
506
|
Data.CommentID = Control.CommentID;
|
507
|
if(Data.CommentID == null)
|
508
|
{
|
509
|
Data.CommentID = shortGuid();
|
510
|
}
|
511
|
|
512
|
String ConvertData = "";
|
513
|
//int DATA_TYPE = 0;
|
514
|
|
515
|
#region ######### 마크업 파싱##########
|
516
|
|
517
|
switch (Control.GetType().Name.ToString())
|
518
|
{
|
519
|
#region Line
|
520
|
#region Arrow_Multi
|
521
|
case "ArrowControl_Multi":
|
522
|
using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi())
|
523
|
{
|
524
|
var instance = Control as ArrowControl_Multi;
|
525
|
STemp.TransformPoint = "0|0";
|
526
|
STemp.PointSet = instance.PointSet;
|
527
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
528
|
//STemp.StrokeColor = "#FF00FF00";
|
529
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
530
|
STemp.StartPoint = instance.StartPoint;
|
531
|
STemp.EndPoint = instance.EndPoint;
|
532
|
STemp.UserID = UserId;
|
533
|
STemp.Opac = instance.Opacity;
|
534
|
STemp.DashSize = instance.DashSize;
|
535
|
STemp.MidPoint = instance.MiddlePoint;
|
536
|
STemp.Name = instance.GetType().Name.ToString();
|
537
|
|
538
|
///강인구 추가(2017.11.02)
|
539
|
///Memo 추가
|
540
|
STemp.Memo = instance.Memo;
|
541
|
|
542
|
///강인구 추가(2017.11.02)
|
543
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
544
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
545
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
546
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
547
|
};
|
548
|
break;
|
549
|
#endregion
|
550
|
#region Line
|
551
|
case "LineControl":
|
552
|
using (S_LineControl STemp = new S_LineControl())
|
553
|
{
|
554
|
var instance = Control as LineControl;
|
555
|
|
556
|
STemp.TransformPoint = "0|0";
|
557
|
STemp.PointSet = instance.PointSet;
|
558
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
559
|
STemp.LineStyleSet = instance.LineStyleSet;
|
560
|
//STemp.StrokeColor = "#FF00FF00";
|
561
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
562
|
STemp.StartPoint = instance.StartPoint;
|
563
|
STemp.EndPoint = instance.EndPoint;
|
564
|
STemp.UserID = UserId;
|
565
|
STemp.Opac = instance.Opacity;
|
566
|
STemp.DashSize = instance.DashSize;
|
567
|
STemp.Interval = instance.Interval;
|
568
|
STemp.DimSize = instance.DimSize;
|
569
|
STemp.Name = instance.GetType().Name.ToString();
|
570
|
|
571
|
///강인구 추가(2017.11.02)
|
572
|
///Memo 추가
|
573
|
STemp.Memo = instance.Memo;
|
574
|
|
575
|
///강인구 추가(2017.11.02)
|
576
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
577
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
578
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
579
|
|
580
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
581
|
|
582
|
//var item = JsonSerializerHelper.UnCompressString(Data.ConvertData); //언패킹작업
|
583
|
//using (S_LineControl s = JsonSerializerHelper.JsonDeserialize<S_LineControl>(item))
|
584
|
//{
|
585
|
// LineControl ins = new LineControl()
|
586
|
// {
|
587
|
// Memo = s.Memo
|
588
|
// };
|
589
|
//}
|
590
|
|
591
|
};
|
592
|
break;
|
593
|
#endregion
|
594
|
#region Arc
|
595
|
case "ArcControl":
|
596
|
using (S_ArcControl STemp = new S_ArcControl())
|
597
|
{
|
598
|
var instance = Control as ArcControl;
|
599
|
STemp.TransformPoint = "0|0";
|
600
|
STemp.PointSet = instance.PointSet;
|
601
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
602
|
//STemp.StrokeColor = "#FF000FFF";
|
603
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
604
|
STemp.StartPoint = instance.StartPoint;
|
605
|
STemp.UserID = UserId;
|
606
|
STemp.Opac = instance.Opacity;
|
607
|
STemp.MidPoint = instance.MidPoint;
|
608
|
STemp.EndPoint = instance.EndPoint;
|
609
|
STemp.IsTransOn = instance.isTransOn;
|
610
|
STemp.DashSize = instance.DashSize;
|
611
|
STemp.Clock = instance.Clock;
|
612
|
//STemp.ArcStyleSet = instance.ControlType;
|
613
|
STemp.Name = instance.GetType().Name.ToString();
|
614
|
|
615
|
///강인구 추가(2017.11.02)
|
616
|
///Memo 추가
|
617
|
STemp.Memo = instance.Memo;
|
618
|
|
619
|
///강인구 추가(2017.11.02)
|
620
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
621
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
622
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
623
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
624
|
|
625
|
};
|
626
|
break;
|
627
|
#endregion
|
628
|
#endregion
|
629
|
|
630
|
#region Shape
|
631
|
#region RectCloud
|
632
|
case "RectCloudControl":
|
633
|
{
|
634
|
using (S_RectCloudControl STemp = new S_RectCloudControl())
|
635
|
{
|
636
|
var instance = Control as RectCloudControl;
|
637
|
STemp.TransformPoint = "0|0";
|
638
|
STemp.PointSet = instance.PointSet;
|
639
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
640
|
//STemp.StrokeColor = "#FF00FF00";
|
641
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
642
|
STemp.StartPoint = instance.StartPoint;
|
643
|
STemp.UserID = UserId;
|
644
|
STemp.Opac = instance.Opacity;
|
645
|
STemp.TR = instance.TopRightPoint;
|
646
|
STemp.LB = instance.LeftBottomPoint;
|
647
|
STemp.EndPoint = instance.EndPoint;
|
648
|
STemp.PaintState = instance.Paint;
|
649
|
STemp.DashSize = instance.DashSize;
|
650
|
STemp.Name = instance.GetType().Name.ToString();
|
651
|
///강인구 추가(2017.11.02)
|
652
|
///Memo 추가
|
653
|
STemp.Memo = instance.Memo;
|
654
|
|
655
|
///강인구 추가(2017.11.02)
|
656
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
657
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
658
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
659
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
660
|
}
|
661
|
}
|
662
|
break;
|
663
|
#endregion
|
664
|
#region Circle
|
665
|
case "CircleControl":
|
666
|
using (S_CircleControl STemp = new S_CircleControl())
|
667
|
{
|
668
|
var instance = Control as CircleControl;
|
669
|
STemp.TransformPoint = "0|0";
|
670
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
671
|
STemp.PaintState = instance.Paint;
|
672
|
//STemp.StrokeColor = "#FF00FF00";
|
673
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
674
|
if (instance.FillColor != null)
|
675
|
{
|
676
|
STemp.FillColor = instance.FillColor.Color.ToString();
|
677
|
}
|
678
|
STemp.StartPoint = instance.StartPoint;
|
679
|
STemp.UserID = UserId;
|
680
|
STemp.EndPoint = instance.EndPoint;
|
681
|
STemp.TRP = instance.TopRightPoint;
|
682
|
STemp.LBP = instance.LeftBottomPoint;
|
683
|
STemp.Opac = instance.Opacity;
|
684
|
STemp.Angle = instance.Angle;
|
685
|
STemp.PointSet = instance.PointSet;
|
686
|
STemp.DashSize = instance.DashSize;
|
687
|
STemp.Name = instance.GetType().Name.ToString();
|
688
|
///강인구 추가(2017.11.02)
|
689
|
///Memo 추가
|
690
|
STemp.Memo = instance.Memo;
|
691
|
|
692
|
///강인구 추가(2017.11.02)
|
693
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
694
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
695
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
696
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
697
|
};
|
698
|
break;
|
699
|
#endregion
|
700
|
#region Rectangle
|
701
|
case "RectangleControl":
|
702
|
using (S_RectControl STemp = new S_RectControl())
|
703
|
{
|
704
|
var instance = Control as RectangleControl;
|
705
|
STemp.TransformPoint = "0|0";
|
706
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
707
|
STemp.PaintState = instance.Paint;
|
708
|
STemp.PointSet = instance.PointSet;
|
709
|
//STemp.StrokeColor = "#FF00FF00";
|
710
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
711
|
if (instance.FillColor != null)
|
712
|
{
|
713
|
STemp.FillColor = instance.FillColor.Color.ToString();
|
714
|
}
|
715
|
STemp.StartPoint = instance.StartPoint;
|
716
|
STemp.UserID = UserId;
|
717
|
//STemp.Angle = instance.a;
|
718
|
STemp.EndPoint = instance.EndPoint;
|
719
|
STemp.LB = instance.LeftBottomPoint;
|
720
|
STemp.TR = instance.TopRightPoint;
|
721
|
STemp.DashSize = instance.DashSize;
|
722
|
STemp.Opac = instance.Opacity;
|
723
|
STemp.Name = instance.GetType().Name.ToString();
|
724
|
///강인구 추가(2017.11.02)
|
725
|
///Memo 추가
|
726
|
STemp.Memo = instance.Memo;
|
727
|
|
728
|
///강인구 추가(2017.11.02)
|
729
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
730
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
731
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
732
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
733
|
};
|
734
|
break;
|
735
|
#endregion
|
736
|
#region Triangle
|
737
|
case "TriControl":
|
738
|
using (S_TriControl STemp = new S_TriControl())
|
739
|
{
|
740
|
var instance = Control as TriControl;
|
741
|
STemp.TransformPoint = "0|0";
|
742
|
STemp.Paint = instance.Paint;
|
743
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
744
|
//STemp.StrokeColor = "#FF00FF00";
|
745
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
746
|
if (instance.FillColor != null)
|
747
|
{
|
748
|
STemp.FillColor = instance.FillColor.Color.ToString();
|
749
|
}
|
750
|
STemp.StartPoint = instance.StartPoint;
|
751
|
STemp.EndPoint = instance.EndPoint;
|
752
|
STemp.MidPoint = instance.MidPoint;
|
753
|
STemp.Opac = instance.Opacity;
|
754
|
STemp.UserID = UserId;
|
755
|
STemp.PointSet = instance.PointSet;
|
756
|
STemp.Angle = instance.Angle;
|
757
|
STemp.DashSize = instance.DashSize;
|
758
|
STemp.Name = instance.GetType().Name.ToString();
|
759
|
///강인구 추가(2017.11.02)
|
760
|
///Memo 추가
|
761
|
STemp.Memo = instance.Memo;
|
762
|
|
763
|
///강인구 추가(2017.11.02)
|
764
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
765
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
766
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
767
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
768
|
}
|
769
|
break;
|
770
|
#endregion
|
771
|
#endregion
|
772
|
|
773
|
#region Polygon
|
774
|
#region Poly
|
775
|
case "PolygonControl":
|
776
|
using (S_PolyControl STemp = new S_PolyControl())
|
777
|
{
|
778
|
var instance = Control as PolygonControl;
|
779
|
|
780
|
STemp.TransformPoint = "0|0";
|
781
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
782
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
783
|
//STemp.StrokeColor = "#FF000FFF";
|
784
|
STemp.Name = instance.GetType().Name.ToString();
|
785
|
//STemp.Toler = instance.Toler;
|
786
|
STemp.PaintState = instance.Paint;
|
787
|
STemp.Opac = instance.Opacity;
|
788
|
STemp.UserID = UserId;
|
789
|
STemp.PaintState = instance.Paint;
|
790
|
//강인구 추가(Chain인지 Polygon인지 구분)
|
791
|
STemp.Type = instance.ControlType;
|
792
|
//STemp.IsTrans = instance.isTransOn;
|
793
|
//STemp.IsChain = instance.isChain;
|
794
|
STemp.PointSet = new List<Point>();
|
795
|
STemp.DashSize = instance.DashSize;
|
796
|
STemp.StartPoint = instance.StartPoint;
|
797
|
STemp.EndPoint = instance.EndPoint;
|
798
|
STemp.IsCompleted = instance.IsCompleted;
|
799
|
foreach (var point in instance.PointSet)
|
800
|
{
|
801
|
STemp.PointSet.Add(point);
|
802
|
}
|
803
|
///강인구 추가(2017.11.02)
|
804
|
///Memo 추가
|
805
|
STemp.Memo = instance.Memo;
|
806
|
|
807
|
///강인구 추가(2017.11.02)
|
808
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
809
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
810
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
811
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
812
|
};
|
813
|
break;
|
814
|
#endregion
|
815
|
|
816
|
#region InkControl
|
817
|
case "InkControl":
|
818
|
using (S_PolyControl STemp = new S_PolyControl())
|
819
|
{
|
820
|
var instance = Control as InkControl;
|
821
|
|
822
|
STemp.TransformPoint = "0|0";
|
823
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
824
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
825
|
//STemp.StrokeColor = "#FF000FFF";
|
826
|
STemp.Name = instance.GetType().Name.ToString();
|
827
|
//STemp.Toler = instance.Toler;
|
828
|
STemp.PaintState = instance.Paint;
|
829
|
STemp.Opac = instance.Opacity;
|
830
|
STemp.UserID = UserId;
|
831
|
STemp.PaintState = instance.Paint;
|
832
|
//강인구 추가(Chain인지 Polygon인지 구분)
|
833
|
STemp.Type = instance.ControlType;
|
834
|
//STemp.IsTrans = instance.isTransOn;
|
835
|
//STemp.IsChain = instance.isChain;
|
836
|
STemp.PointSet = new List<Point>();
|
837
|
STemp.DashSize = instance.DashSize;
|
838
|
STemp.IsCompleted = instance.IsCompleted;
|
839
|
STemp.StartPoint = instance.StartPoint;
|
840
|
STemp.EndPoint = instance.EndPoint;
|
841
|
foreach (var point in instance.PointSet)
|
842
|
{
|
843
|
STemp.PointSet.Add(point);
|
844
|
}
|
845
|
///강인구 추가(2017.11.02)
|
846
|
///Memo 추가
|
847
|
STemp.Memo = instance.Memo;
|
848
|
|
849
|
///강인구 추가(2017.11.02)
|
850
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
851
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
852
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
853
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
854
|
};
|
855
|
break;
|
856
|
#endregion
|
857
|
|
858
|
#region Cloud
|
859
|
case "CloudControl":
|
860
|
using (S_CloudControl STemp = new S_CloudControl())
|
861
|
{
|
862
|
var instance = Control as CloudControl;
|
863
|
|
864
|
STemp.TransformPoint = "0|0";
|
865
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
866
|
//STemp.StrokeColor = "#FF000FFF";
|
867
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
868
|
STemp.Name = instance.GetType().Name.ToString();
|
869
|
STemp.Toler = instance.Toler;
|
870
|
STemp.PaintState = instance.Paint;
|
871
|
STemp.Opac = instance.Opacity;
|
872
|
STemp.UserID = UserId;
|
873
|
STemp.IsTrans = instance.isTransOn;
|
874
|
STemp.IsChain = instance.isChain;
|
875
|
STemp.PointSet = new List<Point>();
|
876
|
STemp.DashSize = instance.DashSize;
|
877
|
STemp.StartPoint = instance.StartPoint;
|
878
|
STemp.EndPoint = instance.EndPoint;
|
879
|
foreach (var point in instance.PointSet)
|
880
|
{
|
881
|
STemp.PointSet.Add(point);
|
882
|
}
|
883
|
|
884
|
//STemp.CloudFill = instance.Fill;
|
885
|
STemp.ArcLength = instance.ArcLength;
|
886
|
///강인구 추가(2017.11.02)
|
887
|
///Memo 추가
|
888
|
STemp.Memo = instance.Memo;
|
889
|
|
890
|
///강인구 추가(2017.11.02)
|
891
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
892
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
893
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
894
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
895
|
}
|
896
|
break;
|
897
|
#endregion
|
898
|
#endregion
|
899
|
|
900
|
#region Text
|
901
|
#region Text
|
902
|
case "TextControl":
|
903
|
using (S_TextControl STemp = new S_TextControl())
|
904
|
{
|
905
|
|
906
|
var instance = Control as TextControl;
|
907
|
STemp.TransformPoint = "0|0";
|
908
|
STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString());
|
909
|
STemp.Text = instance.Text;
|
910
|
STemp.UserID = UserId;
|
911
|
STemp.FontColor = instance.FontColor.Color.ToString();
|
912
|
//STemp.FontColor = "#FFFFFF00";
|
913
|
|
914
|
if(instance.StartPoint == new Point())
|
915
|
STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY);
|
916
|
else
|
917
|
STemp.StartPoint = instance.StartPoint;
|
918
|
|
919
|
STemp.EndPoint = instance.EndPoint;
|
920
|
STemp.Opac = instance.Opacity;
|
921
|
STemp.PointSet = instance.PointSet;
|
922
|
STemp.Angle = instance.Angle;
|
923
|
STemp.paintMethod = instance.ControlType_No;
|
924
|
STemp.BoxW = instance.BoxWidth;
|
925
|
STemp.BoxH = instance.BoxHeight;
|
926
|
STemp.isHighLight = instance.IsHighLight;
|
927
|
STemp.Name = instance.GetType().Name.ToString();
|
928
|
STemp.fontConfig = new List<string>()
|
929
|
{
|
930
|
instance.TextFamily.ToString(),
|
931
|
instance.TextStyle.ToString(),
|
932
|
instance.TextWeight.ToString(),
|
933
|
};
|
934
|
|
935
|
|
936
|
|
937
|
if (instance.UnderLine != null)
|
938
|
{
|
939
|
STemp.fontConfig.Add("true");
|
940
|
}
|
941
|
|
942
|
///강인구 추가(2017.11.02)
|
943
|
///Memo 추가
|
944
|
STemp.Memo = instance.Memo;
|
945
|
|
946
|
///강인구 추가(2017.11.02)
|
947
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
948
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
949
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
950
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
951
|
}
|
952
|
break;
|
953
|
#endregion
|
954
|
#region ArrowText
|
955
|
case "ArrowTextControl":
|
956
|
using (S_ArrowTextControl STemp = new S_ArrowTextControl())
|
957
|
{
|
958
|
var instance = Control as ArrowTextControl;
|
959
|
|
960
|
STemp.TransformPoint = "0|0";
|
961
|
STemp.PointSet = instance.PointSet;
|
962
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
963
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
964
|
STemp.StartPoint = instance.StartPoint;
|
965
|
STemp.ArrowStyle = instance.ArrowTextStyle;
|
966
|
//STemp.StrokeColor = "#FF00FF00";
|
967
|
STemp.UserID = UserId;
|
968
|
STemp.ArrowText = instance.Base_TextBox.Text;
|
969
|
STemp.BorderSize = instance.BorderSize;
|
970
|
STemp.isHighLight = instance.isHighLight;
|
971
|
STemp.BoxHeight = instance.BoxHeight;
|
972
|
STemp.BoxWidth = instance.BoxWidth;
|
973
|
STemp.Opac = instance.Opacity;
|
974
|
STemp.EndPoint = instance.EndPoint;
|
975
|
STemp.isFixed = instance.isFixed;
|
976
|
//STemp.DashSize = instance.DashSize;
|
977
|
STemp.Name = instance.GetType().Name.ToString();
|
978
|
STemp.isTrans = instance.isTrans;
|
979
|
STemp.MidPoint = instance.MidPoint;
|
980
|
STemp.Angle = instance.Angle;
|
981
|
STemp.fontConfig = new List<string>()
|
982
|
{
|
983
|
instance.TextFamily.ToString(),
|
984
|
instance.TextStyle.ToString(),
|
985
|
instance.TextWeight.ToString(),
|
986
|
instance.TextSize.ToString(),
|
987
|
};
|
988
|
|
989
|
if (instance.UnderLine != null)
|
990
|
{
|
991
|
STemp.fontConfig.Add("true");
|
992
|
}
|
993
|
|
994
|
///강인구 추가(2017.11.02)
|
995
|
///Memo 추가
|
996
|
STemp.Memo = instance.Memo;
|
997
|
|
998
|
///강인구 추가(2017.11.02)
|
999
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
1000
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1001
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
1002
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1003
|
};
|
1004
|
break;
|
1005
|
#endregion
|
1006
|
#endregion
|
1007
|
|
1008
|
#region ETC
|
1009
|
#region Sign
|
1010
|
case "SignControl":
|
1011
|
{
|
1012
|
//강인구 추가
|
1013
|
using (S_SignControl STemp = new S_SignControl())
|
1014
|
{
|
1015
|
SignControl instance = Control as SignControl;
|
1016
|
STemp.Angle = instance.Angle;
|
1017
|
STemp.EndPoint = instance.EndPoint;
|
1018
|
STemp.UserID = UserId;
|
1019
|
STemp.LB = instance.LeftBottomPoint;
|
1020
|
STemp.Name = instance.GetType().Name;
|
1021
|
STemp.PointSet = instance.PointSet;
|
1022
|
STemp.StartPoint = instance.StartPoint;
|
1023
|
STemp.Opac = instance.Opacity;
|
1024
|
STemp.TR = instance.TopRightPoint;
|
1025
|
STemp.UserNumber = instance.UserNumber == null ? UserId : instance.UserNumber;
|
1026
|
|
1027
|
///강인구 추가(2017.11.02)
|
1028
|
///Memo 추가
|
1029
|
STemp.Memo = instance.Memo;
|
1030
|
|
1031
|
///강인구 추가(2017.11.02)
|
1032
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
1033
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1034
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
1035
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1036
|
}
|
1037
|
}
|
1038
|
break;
|
1039
|
#endregion
|
1040
|
|
1041
|
|
1042
|
//변경 필요
|
1043
|
#region Ink
|
1044
|
case "InkPresenter":
|
1045
|
{
|
1046
|
//var instance = item as InkPresenter;
|
1047
|
//if (instance.Strokes.Count >= 1)
|
1048
|
//{
|
1049
|
// using (S_PensilControl STemp = new S_PensilControl())
|
1050
|
// {
|
1051
|
// bool isRealData = true;
|
1052
|
// foreach (var strokeData in instance.Strokes)
|
1053
|
// {
|
1054
|
// if (strokeData.StylusPoints.Count == 0)
|
1055
|
// {
|
1056
|
// isRealData = false;
|
1057
|
// }
|
1058
|
// }
|
1059
|
// if (isRealData)
|
1060
|
// {
|
1061
|
// if (instance.Tag != null)
|
1062
|
// {
|
1063
|
// STemp.UserID = instance.Tag.ToString();
|
1064
|
// }
|
1065
|
// STemp.SCC = instance.Strokes;
|
1066
|
// STemp.Name = instance.GetType().Name;
|
1067
|
// STemp.Opac = instance.Opacity;
|
1068
|
// STemp.TransformPoint = "0|0";
|
1069
|
// ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1070
|
// }
|
1071
|
// }
|
1072
|
//}
|
1073
|
}
|
1074
|
break;
|
1075
|
#endregion
|
1076
|
#region Date
|
1077
|
case "DateControl":
|
1078
|
{
|
1079
|
using (S_DateControl STemp = new S_DateControl())
|
1080
|
{
|
1081
|
DateControl instance = Control as DateControl;
|
1082
|
STemp.Angle = instance.Angle;
|
1083
|
STemp.EndPoint = instance.EndPoint;
|
1084
|
STemp.UserID = UserId;
|
1085
|
STemp.LB = instance.LeftBottomPoint;
|
1086
|
STemp.Name = instance.GetType().Name;
|
1087
|
STemp.PointSet = instance.PointSet;
|
1088
|
STemp.StartPoint = instance.StartPoint;
|
1089
|
STemp.Opac = instance.Opacity;
|
1090
|
STemp.TR = instance.TopRightPoint;
|
1091
|
STemp.TransformPoint = "0|0";
|
1092
|
STemp.FontColor = instance.FontColor.Color.ToString();
|
1093
|
//STemp.FontColor = "#FFFFFF00";
|
1094
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1095
|
STemp.Text = instance.Text;
|
1096
|
///강인구 추가(2017.11.02)
|
1097
|
///Memo 추가
|
1098
|
STemp.Memo = instance.Memo;
|
1099
|
|
1100
|
///강인구 추가(2017.11.02)
|
1101
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
1102
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1103
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
1104
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1105
|
}
|
1106
|
}
|
1107
|
break;
|
1108
|
#endregion
|
1109
|
#region Symbol
|
1110
|
case "SymControl":
|
1111
|
using (S_SymControl STemp = new S_SymControl())
|
1112
|
{
|
1113
|
var instance = Control as SymControl;
|
1114
|
STemp.TransformPoint = "0|0";
|
1115
|
STemp.PointSet = instance.PointSet;
|
1116
|
STemp.UserID = UserId;
|
1117
|
STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString());
|
1118
|
STemp.PaintState = instance.Paint;
|
1119
|
STemp.PathInfo = instance.PathData.ToString();
|
1120
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1121
|
STemp.StartPoint = instance.StartPoint;
|
1122
|
STemp.Angle = instance.Angle;
|
1123
|
STemp.EndPoint = instance.EndPoint;
|
1124
|
STemp.LB = instance.LeftBottomPoint;
|
1125
|
STemp.TR = instance.TopRightPoint;
|
1126
|
STemp.Opac = instance.Opacity;
|
1127
|
STemp.Name = instance.GetType().Name.ToString();
|
1128
|
|
1129
|
///강인구 추가(2017.11.02)
|
1130
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
1131
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1132
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
1133
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1134
|
}
|
1135
|
break;
|
1136
|
#endregion
|
1137
|
#region SymbolN
|
1138
|
case "SymControlN":
|
1139
|
using (S_SymControlN STemp = new S_SymControlN())
|
1140
|
{
|
1141
|
var instance = Control as SymControlN;
|
1142
|
STemp.TransformPoint = "0|0";
|
1143
|
STemp.PointSet = instance.PointSet;
|
1144
|
//STemp.XamlData = instance.PathXathData;
|
1145
|
STemp.UserID = UserId;
|
1146
|
STemp.DBData = JsonSerializerHelper.CompressString(instance.PathXathData);
|
1147
|
//STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1148
|
STemp.StartPoint = instance.StartPoint;
|
1149
|
STemp.Angle = instance.Angle;
|
1150
|
STemp.EndPoint = instance.EndPoint;
|
1151
|
STemp.LB = instance.LeftBottomPoint;
|
1152
|
STemp.TR = instance.TopRightPoint;
|
1153
|
STemp.Opac = instance.Opacity;
|
1154
|
STemp.Name = instance.GetType().Name.ToString();
|
1155
|
|
1156
|
///강인구 추가(2017.11.02)
|
1157
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
1158
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1159
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
1160
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1161
|
}
|
1162
|
break;
|
1163
|
#endregion
|
1164
|
#region Image
|
1165
|
case "ImgControl":
|
1166
|
using (S_ImgControl STemp = new S_ImgControl())
|
1167
|
{
|
1168
|
ImgControl instance = Control as ImgControl;
|
1169
|
STemp.Angle = instance.Angle;
|
1170
|
STemp.EndPoint = instance.EndPoint;
|
1171
|
STemp.LB = instance.LeftBottomPoint;
|
1172
|
STemp.Name = instance.GetType().Name;
|
1173
|
STemp.PointSet = instance.PointSet;
|
1174
|
STemp.StartPoint = instance.StartPoint;
|
1175
|
STemp.UserID = UserId;
|
1176
|
STemp.Opac = instance.Opacity;
|
1177
|
STemp.TR = instance.TopRightPoint;
|
1178
|
STemp.ImagePath = instance.FilePath;
|
1179
|
///강인구 추가(2017.11.02)
|
1180
|
///Memo 추가
|
1181
|
STemp.Memo = instance.Memo;
|
1182
|
|
1183
|
///강인구 추가(2017.11.02)
|
1184
|
///DATA_TYPE추가로 인한 클래스 변수 대입
|
1185
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1186
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
1187
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1188
|
}
|
1189
|
break;
|
1190
|
#endregion
|
1191
|
#endregion
|
1192
|
default:
|
1193
|
break;
|
1194
|
}
|
1195
|
|
1196
|
#endregion
|
1197
|
|
1198
|
//return ConvertData;
|
1199
|
return Data;
|
1200
|
}
|
1201
|
|
1202
|
public MarkupReturn MarkupToString(ObservableCollection<Control> baseLayer, string UserId)
|
1203
|
{
|
1204
|
MarkupReturn Data = new MarkupReturn();
|
1205
|
Data.ConvertData = "";
|
1206
|
Data.DATA_TYPE = 0;
|
1207
|
|
1208
|
String ConvertData = "";
|
1209
|
//int DATA_TYPE = 0;
|
1210
|
|
1211
|
#region ######### 마크업 파싱##########
|
1212
|
foreach (UIElement item in baseLayer)
|
1213
|
{
|
1214
|
switch (item.GetType().Name.ToString())
|
1215
|
{
|
1216
|
#region Line
|
1217
|
#region Arrow_Multi
|
1218
|
case "ArrowControl_Multi":
|
1219
|
using (S_ArrowControl_Multi STemp = new S_ArrowControl_Multi())
|
1220
|
{
|
1221
|
var instance = item as ArrowControl_Multi;
|
1222
|
STemp.TransformPoint = "0|0";
|
1223
|
STemp.PointSet = instance.PointSet;
|
1224
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1225
|
//STemp.StrokeColor = "#FF00FF00";
|
1226
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1227
|
STemp.StartPoint = instance.StartPoint;
|
1228
|
STemp.EndPoint = instance.EndPoint;
|
1229
|
STemp.UserID = UserId;
|
1230
|
STemp.Opac = instance.Opacity;
|
1231
|
STemp.DashSize = instance.DashSize;
|
1232
|
STemp.MidPoint = instance.MiddlePoint;
|
1233
|
STemp.Name = instance.GetType().Name.ToString();
|
1234
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1235
|
};
|
1236
|
break;
|
1237
|
#endregion
|
1238
|
#region Line
|
1239
|
case "LineControl":
|
1240
|
using (S_LineControl STemp = new S_LineControl())
|
1241
|
{
|
1242
|
var instance = item as LineControl;
|
1243
|
|
1244
|
//Data Type 테스트
|
1245
|
Data.DATA_TYPE = (int)(instance.ControlType);
|
1246
|
|
1247
|
STemp.TransformPoint = "0|0";
|
1248
|
STemp.PointSet = instance.PointSet;
|
1249
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1250
|
STemp.LineStyleSet = instance.LineStyleSet;
|
1251
|
//STemp.StrokeColor = "#FF00FF00";
|
1252
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1253
|
STemp.StartPoint = instance.StartPoint;
|
1254
|
STemp.EndPoint = instance.EndPoint;
|
1255
|
STemp.UserID = UserId;
|
1256
|
STemp.Opac = instance.Opacity;
|
1257
|
STemp.DashSize = instance.DashSize;
|
1258
|
STemp.Interval = instance.Interval;
|
1259
|
STemp.DimSize = instance.DimSize;
|
1260
|
STemp.Name = instance.GetType().Name.ToString();
|
1261
|
|
1262
|
Data.ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1263
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1264
|
};
|
1265
|
break;
|
1266
|
#endregion
|
1267
|
#region Arc
|
1268
|
case "ArcControl":
|
1269
|
using (S_ArcControl STemp = new S_ArcControl())
|
1270
|
{
|
1271
|
var instance = item as ArcControl;
|
1272
|
STemp.TransformPoint = "0|0";
|
1273
|
STemp.PointSet = instance.PointSet;
|
1274
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1275
|
//STemp.StrokeColor = "#FF000FFF";
|
1276
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1277
|
STemp.StartPoint = instance.StartPoint;
|
1278
|
STemp.UserID = UserId;
|
1279
|
STemp.Opac = instance.Opacity;
|
1280
|
STemp.MidPoint = instance.MidPoint;
|
1281
|
STemp.EndPoint = instance.EndPoint;
|
1282
|
STemp.IsTransOn = instance.isTransOn;
|
1283
|
STemp.DashSize = instance.DashSize;
|
1284
|
STemp.Clock = instance.Clock;
|
1285
|
//STemp.ArcStyleSet = instance.ControlType;
|
1286
|
STemp.Name = instance.GetType().Name.ToString();
|
1287
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1288
|
};
|
1289
|
break;
|
1290
|
#endregion
|
1291
|
#endregion
|
1292
|
|
1293
|
#region Shape
|
1294
|
#region RectCloud
|
1295
|
case "RectCloudControl":
|
1296
|
{
|
1297
|
using (S_RectCloudControl STemp = new S_RectCloudControl())
|
1298
|
{
|
1299
|
var instance = item as RectCloudControl;
|
1300
|
STemp.TransformPoint = "0|0";
|
1301
|
STemp.PointSet = instance.PointSet;
|
1302
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1303
|
//STemp.StrokeColor = "#FF00FF00";
|
1304
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1305
|
STemp.StartPoint = instance.StartPoint;
|
1306
|
STemp.UserID = UserId;
|
1307
|
STemp.Opac = instance.Opacity;
|
1308
|
STemp.TR = instance.TopRightPoint;
|
1309
|
STemp.LB = instance.LeftBottomPoint;
|
1310
|
STemp.EndPoint = instance.EndPoint;
|
1311
|
STemp.PaintState = instance.Paint;
|
1312
|
STemp.DashSize = instance.DashSize;
|
1313
|
STemp.Name = instance.GetType().Name.ToString();
|
1314
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1315
|
}
|
1316
|
}
|
1317
|
break;
|
1318
|
#endregion
|
1319
|
#region Circle
|
1320
|
case "CircleControl":
|
1321
|
using (S_CircleControl STemp = new S_CircleControl())
|
1322
|
{
|
1323
|
var instance = item as CircleControl;
|
1324
|
STemp.TransformPoint = "0|0";
|
1325
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1326
|
STemp.PaintState = instance.Paint;
|
1327
|
//STemp.StrokeColor = "#FF00FF00";
|
1328
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1329
|
if (instance.FillColor != null)
|
1330
|
{
|
1331
|
STemp.FillColor = instance.FillColor.Color.ToString();
|
1332
|
}
|
1333
|
STemp.StartPoint = instance.StartPoint;
|
1334
|
STemp.UserID = UserId;
|
1335
|
STemp.EndPoint = instance.EndPoint;
|
1336
|
STemp.TRP = instance.TopRightPoint;
|
1337
|
STemp.LBP = instance.LeftBottomPoint;
|
1338
|
STemp.Opac = instance.Opacity;
|
1339
|
STemp.Angle = instance.Angle;
|
1340
|
STemp.PointSet = instance.PointSet;
|
1341
|
STemp.DashSize = instance.DashSize;
|
1342
|
STemp.Name = instance.GetType().Name.ToString();
|
1343
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1344
|
};
|
1345
|
break;
|
1346
|
#endregion
|
1347
|
#region Rectangle
|
1348
|
case "RectangleControl":
|
1349
|
using (S_RectControl STemp = new S_RectControl())
|
1350
|
{
|
1351
|
var instance = item as RectangleControl;
|
1352
|
STemp.TransformPoint = "0|0";
|
1353
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1354
|
STemp.PaintState = instance.Paint;
|
1355
|
STemp.PointSet = instance.PointSet;
|
1356
|
//STemp.StrokeColor = "#FF00FF00";
|
1357
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1358
|
if (instance.FillColor != null)
|
1359
|
{
|
1360
|
STemp.FillColor = instance.FillColor.Color.ToString();
|
1361
|
}
|
1362
|
STemp.StartPoint = instance.StartPoint;
|
1363
|
STemp.UserID = UserId;
|
1364
|
STemp.Angle = instance.Angle;
|
1365
|
STemp.EndPoint = instance.EndPoint;
|
1366
|
STemp.LB = instance.LeftBottomPoint;
|
1367
|
STemp.TR = instance.TopRightPoint;
|
1368
|
STemp.DashSize = instance.DashSize;
|
1369
|
STemp.Opac = instance.Opacity;
|
1370
|
STemp.Name = instance.GetType().Name.ToString();
|
1371
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1372
|
};
|
1373
|
break;
|
1374
|
#endregion
|
1375
|
#region Triangle
|
1376
|
case "TriControl":
|
1377
|
using (S_TriControl STemp = new S_TriControl())
|
1378
|
{
|
1379
|
var instance = item as TriControl;
|
1380
|
STemp.TransformPoint = "0|0";
|
1381
|
STemp.Paint = instance.Paint;
|
1382
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1383
|
//STemp.StrokeColor = "#FF00FF00";
|
1384
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1385
|
if (instance.FillColor != null)
|
1386
|
{
|
1387
|
STemp.FillColor = instance.FillColor.Color.ToString();
|
1388
|
}
|
1389
|
STemp.StartPoint = instance.StartPoint;
|
1390
|
STemp.EndPoint = instance.EndPoint;
|
1391
|
STemp.MidPoint = instance.MidPoint;
|
1392
|
STemp.Opac = instance.Opacity;
|
1393
|
STemp.UserID = UserId;
|
1394
|
STemp.PointSet = instance.PointSet;
|
1395
|
STemp.Angle = instance.Angle;
|
1396
|
STemp.DashSize = instance.DashSize;
|
1397
|
STemp.Name = instance.GetType().Name.ToString();
|
1398
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1399
|
}
|
1400
|
break;
|
1401
|
#endregion
|
1402
|
#endregion
|
1403
|
|
1404
|
#region Polygon
|
1405
|
|
1406
|
#region Poly
|
1407
|
case "PolygonControl":
|
1408
|
using (S_PolyControl STemp = new S_PolyControl())
|
1409
|
{
|
1410
|
var instance = item as PolygonControl;
|
1411
|
|
1412
|
STemp.TransformPoint = "0|0";
|
1413
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1414
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1415
|
//STemp.StrokeColor = "#FF000FFF";
|
1416
|
STemp.Name = instance.GetType().Name.ToString();
|
1417
|
//STemp.Toler = instance.Toler;
|
1418
|
STemp.PaintState = instance.Paint;
|
1419
|
STemp.Opac = instance.Opacity;
|
1420
|
STemp.UserID = UserId;
|
1421
|
//강인구 추가(Chain인지 Polygon인지 구분)
|
1422
|
STemp.Type = instance.ControlType;
|
1423
|
//STemp.IsTrans = instance.isTransOn;
|
1424
|
//STemp.IsChain = instance.isChain;
|
1425
|
STemp.PointSet = new List<Point>();
|
1426
|
STemp.DashSize = instance.DashSize;
|
1427
|
STemp.IsCompleted = instance.IsCompleted;
|
1428
|
STemp.StartPoint = instance.StartPoint;
|
1429
|
STemp.EndPoint = instance.EndPoint;
|
1430
|
foreach (var point in instance.PointSet)
|
1431
|
{
|
1432
|
STemp.PointSet.Add(point);
|
1433
|
}
|
1434
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1435
|
};
|
1436
|
break;
|
1437
|
#endregion
|
1438
|
|
1439
|
#region Inkcontrol
|
1440
|
case "InkControl":
|
1441
|
using (S_PolyControl STemp = new S_PolyControl())
|
1442
|
{
|
1443
|
var instance = item as InkControl;
|
1444
|
|
1445
|
STemp.TransformPoint = "0|0";
|
1446
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1447
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1448
|
//STemp.StrokeColor = "#FF000FFF";
|
1449
|
STemp.Name = instance.GetType().Name.ToString();
|
1450
|
//STemp.Toler = instance.Toler;
|
1451
|
STemp.PaintState = instance.Paint;
|
1452
|
STemp.Opac = instance.Opacity;
|
1453
|
STemp.UserID = UserId;
|
1454
|
//강인구 추가(Chain인지 Polygon인지 구분)
|
1455
|
STemp.Type = instance.ControlType;
|
1456
|
//STemp.IsTrans = instance.isTransOn;
|
1457
|
//STemp.IsChain = instance.isChain;
|
1458
|
STemp.PointSet = new List<Point>();
|
1459
|
STemp.DashSize = instance.DashSize;
|
1460
|
STemp.IsCompleted = instance.IsCompleted;
|
1461
|
STemp.StartPoint = instance.StartPoint;
|
1462
|
STemp.EndPoint = instance.EndPoint;
|
1463
|
foreach (var point in instance.PointSet)
|
1464
|
{
|
1465
|
STemp.PointSet.Add(point);
|
1466
|
}
|
1467
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1468
|
};
|
1469
|
break;
|
1470
|
#endregion
|
1471
|
|
1472
|
#region Cloud
|
1473
|
case "CloudControl":
|
1474
|
using (S_CloudControl STemp = new S_CloudControl())
|
1475
|
{
|
1476
|
var instance = item as CloudControl;
|
1477
|
|
1478
|
STemp.TransformPoint = "0|0";
|
1479
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1480
|
//STemp.StrokeColor = "#FF000FFF";
|
1481
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1482
|
STemp.Name = instance.GetType().Name.ToString();
|
1483
|
STemp.Toler = instance.Toler;
|
1484
|
STemp.PaintState = instance.Paint;
|
1485
|
STemp.Opac = instance.Opacity;
|
1486
|
STemp.UserID = UserId;
|
1487
|
STemp.IsTrans = instance.isTransOn;
|
1488
|
STemp.IsChain = instance.isChain;
|
1489
|
STemp.PointSet = new List<Point>();
|
1490
|
STemp.DashSize = instance.DashSize;
|
1491
|
STemp.StartPoint = instance.StartPoint;
|
1492
|
STemp.EndPoint = instance.EndPoint;
|
1493
|
foreach (var point in instance.PointSet)
|
1494
|
{
|
1495
|
STemp.PointSet.Add(point);
|
1496
|
}
|
1497
|
|
1498
|
//STemp.CloudFill = instance.Fill;
|
1499
|
STemp.ArcLength = instance.ArcLength;
|
1500
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1501
|
}
|
1502
|
break;
|
1503
|
#endregion
|
1504
|
|
1505
|
#endregion
|
1506
|
|
1507
|
#region Text
|
1508
|
#region Text
|
1509
|
case "TextControl":
|
1510
|
using (S_TextControl STemp = new S_TextControl())
|
1511
|
{
|
1512
|
|
1513
|
var instance = item as TextControl;
|
1514
|
STemp.TransformPoint = "0|0";
|
1515
|
STemp.SizeSet = String.Format("{0}|{1}", instance.LineSize.Left.ToString(), instance.TextSize.ToString());
|
1516
|
STemp.Text = instance.Text;
|
1517
|
STemp.UserID = UserId;
|
1518
|
STemp.FontColor = instance.FontColor.Color.ToString();
|
1519
|
//STemp.FontColor = "#FFFFFF00";
|
1520
|
//STemp.EndPoint = instance.EndPoint;
|
1521
|
STemp.StartPoint = new Point(instance.CanvasX, instance.CanvasY);
|
1522
|
STemp.Opac = instance.Opacity;
|
1523
|
//STemp.StartPoint = instance.StartPoint;
|
1524
|
STemp.PointSet = instance.PointSet;
|
1525
|
STemp.Angle = instance.Angle;
|
1526
|
STemp.paintMethod = instance.ControlType_No;
|
1527
|
STemp.BoxW = instance.BoxWidth;
|
1528
|
STemp.BoxH = instance.BoxHeight;
|
1529
|
STemp.isHighLight = instance.IsHighLight;
|
1530
|
STemp.Name = instance.GetType().Name.ToString();
|
1531
|
STemp.fontConfig = new List<string>()
|
1532
|
{
|
1533
|
instance.TextFamily.ToString(),
|
1534
|
instance.TextStyle.ToString(),
|
1535
|
instance.TextWeight.ToString(),
|
1536
|
};
|
1537
|
|
1538
|
|
1539
|
|
1540
|
if (instance.UnderLine != null)
|
1541
|
{
|
1542
|
STemp.fontConfig.Add("true");
|
1543
|
}
|
1544
|
|
1545
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1546
|
}
|
1547
|
break;
|
1548
|
#endregion
|
1549
|
#region ArrowText
|
1550
|
case "ArrowTextControl":
|
1551
|
using (S_ArrowTextControl STemp = new S_ArrowTextControl())
|
1552
|
{
|
1553
|
var instance = item as ArrowTextControl;
|
1554
|
|
1555
|
STemp.TransformPoint = "0|0";
|
1556
|
STemp.PointSet = instance.PointSet;
|
1557
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1558
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1559
|
STemp.StartPoint = instance.StartPoint;
|
1560
|
STemp.ArrowStyle = instance.ArrowTextStyle;
|
1561
|
//STemp.StrokeColor = "#FF00FF00";
|
1562
|
STemp.UserID = UserId;
|
1563
|
STemp.ArrowText = instance.Base_TextBox.Text;
|
1564
|
STemp.BorderSize = instance.BorderSize;
|
1565
|
STemp.isHighLight = instance.isHighLight;
|
1566
|
STemp.BoxHeight = instance.BoxHeight;
|
1567
|
STemp.BoxWidth = instance.BoxWidth;
|
1568
|
STemp.Opac = instance.Opacity;
|
1569
|
STemp.EndPoint = instance.EndPoint;
|
1570
|
STemp.isFixed = instance.isFixed;
|
1571
|
//STemp.DashSize = instance.DashSize;
|
1572
|
STemp.Name = instance.GetType().Name.ToString();
|
1573
|
STemp.isTrans = instance.isTrans;
|
1574
|
STemp.MidPoint = instance.MidPoint;
|
1575
|
STemp.Angle = instance.Angle;
|
1576
|
STemp.fontConfig = new List<string>()
|
1577
|
{
|
1578
|
instance.TextFamily.ToString(),
|
1579
|
instance.TextStyle.ToString(),
|
1580
|
instance.TextWeight.ToString(),
|
1581
|
instance.TextSize.ToString(),
|
1582
|
};
|
1583
|
|
1584
|
if (instance.UnderLine != null)
|
1585
|
{
|
1586
|
STemp.fontConfig.Add("true");
|
1587
|
}
|
1588
|
|
1589
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1590
|
};
|
1591
|
break;
|
1592
|
#endregion
|
1593
|
#endregion
|
1594
|
|
1595
|
#region ETC
|
1596
|
#region Sign
|
1597
|
case "SignControl":
|
1598
|
{
|
1599
|
using (S_SignControl STemp = new S_SignControl())
|
1600
|
{
|
1601
|
//SignControl instance = item as SignControl;
|
1602
|
//STemp.Angle = instance.Angle;
|
1603
|
//STemp.EndPoint = instance.EndPoint;
|
1604
|
//STemp.UserID = UserId;
|
1605
|
//STemp.LB = instance.LeftBottomPoint;
|
1606
|
//STemp.Name = instance.GetType().Name;
|
1607
|
//STemp.PointSet = instance.PointSet;
|
1608
|
//STemp.StartPoint = instance.StartPoint;
|
1609
|
//STemp.Opac = instance.Opacity;
|
1610
|
//STemp.TR = instance.TopRightPoint;
|
1611
|
//STemp.UserNumber = instance.UserNumber;
|
1612
|
//ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1613
|
}
|
1614
|
}
|
1615
|
break;
|
1616
|
#endregion
|
1617
|
#region Ink
|
1618
|
case "InkPresenter":
|
1619
|
{
|
1620
|
var instance = item as InkPresenter;
|
1621
|
if (instance.Strokes.Count >= 1)
|
1622
|
{
|
1623
|
using (S_PensilControl STemp = new S_PensilControl())
|
1624
|
{
|
1625
|
bool isRealData = true;
|
1626
|
foreach (var strokeData in instance.Strokes)
|
1627
|
{
|
1628
|
if (strokeData.StylusPoints.Count == 0)
|
1629
|
{
|
1630
|
isRealData = false;
|
1631
|
}
|
1632
|
}
|
1633
|
if (isRealData)
|
1634
|
{
|
1635
|
if (instance.Tag != null)
|
1636
|
{
|
1637
|
STemp.UserID = instance.Tag.ToString();
|
1638
|
}
|
1639
|
STemp.SCC = instance.Strokes;
|
1640
|
STemp.Name = instance.GetType().Name;
|
1641
|
STemp.Opac = instance.Opacity;
|
1642
|
STemp.TransformPoint = "0|0";
|
1643
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1644
|
}
|
1645
|
}
|
1646
|
}
|
1647
|
}
|
1648
|
break;
|
1649
|
#endregion
|
1650
|
#region Date
|
1651
|
case "DateControl":
|
1652
|
{
|
1653
|
using (S_DateControl STemp = new S_DateControl())
|
1654
|
{
|
1655
|
DateControl instance = item as DateControl;
|
1656
|
STemp.Angle = instance.Angle;
|
1657
|
STemp.EndPoint = instance.EndPoint;
|
1658
|
STemp.UserID = UserId;
|
1659
|
STemp.LB = instance.LeftBottomPoint;
|
1660
|
STemp.Name = instance.GetType().Name;
|
1661
|
STemp.PointSet = instance.PointSet;
|
1662
|
STemp.StartPoint = instance.StartPoint;
|
1663
|
STemp.Opac = instance.Opacity;
|
1664
|
STemp.TR = instance.TopRightPoint;
|
1665
|
STemp.TransformPoint = "0|0";
|
1666
|
STemp.FontColor = instance.FontColor.Color.ToString();
|
1667
|
//STemp.FontColor = "#FFFFFF00";
|
1668
|
STemp.SizeSet = String.Format("{0}", instance.LineSize);
|
1669
|
STemp.Text = instance.Text;
|
1670
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1671
|
}
|
1672
|
}
|
1673
|
break;
|
1674
|
#endregion
|
1675
|
#region Symbol
|
1676
|
case "SymControl":
|
1677
|
using (S_SymControl STemp = new S_SymControl())
|
1678
|
{
|
1679
|
var instance = item as SymControl;
|
1680
|
STemp.TransformPoint = "0|0";
|
1681
|
STemp.PointSet = instance.PointSet;
|
1682
|
STemp.UserID = UserId;
|
1683
|
STemp.SizeSet = String.Format("{0}", instance.LineSize.ToString());
|
1684
|
STemp.PaintState = instance.Paint;
|
1685
|
STemp.PathInfo = instance.PathData.ToString();
|
1686
|
STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1687
|
STemp.StartPoint = instance.StartPoint;
|
1688
|
STemp.Angle = instance.Angle;
|
1689
|
STemp.EndPoint = instance.EndPoint;
|
1690
|
STemp.LB = instance.LeftBottomPoint;
|
1691
|
STemp.TR = instance.TopRightPoint;
|
1692
|
STemp.Opac = instance.Opacity;
|
1693
|
STemp.Name = instance.GetType().Name.ToString();
|
1694
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1695
|
}
|
1696
|
break;
|
1697
|
#endregion
|
1698
|
#region SymbolN
|
1699
|
case "SymControlN":
|
1700
|
using (S_SymControlN STemp = new S_SymControlN())
|
1701
|
{
|
1702
|
var instance = item as SymControlN;
|
1703
|
STemp.TransformPoint = "0|0";
|
1704
|
STemp.PointSet = instance.PointSet;
|
1705
|
//STemp.XamlData = instance.PathXathData;
|
1706
|
STemp.UserID = UserId;
|
1707
|
STemp.DBData = JsonSerializerHelper.CompressString(instance.PathXathData);
|
1708
|
//STemp.StrokeColor = instance.StrokeColor.Color.ToString();
|
1709
|
STemp.StartPoint = instance.StartPoint;
|
1710
|
STemp.Angle = instance.Angle;
|
1711
|
STemp.EndPoint = instance.EndPoint;
|
1712
|
STemp.LB = instance.LeftBottomPoint;
|
1713
|
STemp.TR = instance.TopRightPoint;
|
1714
|
STemp.Opac = instance.Opacity;
|
1715
|
STemp.Name = instance.GetType().Name.ToString();
|
1716
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1717
|
}
|
1718
|
break;
|
1719
|
#endregion
|
1720
|
#region Image
|
1721
|
case "ImgControl":
|
1722
|
using (S_ImgControl STemp = new S_ImgControl())
|
1723
|
{
|
1724
|
ImgControl instance = item as ImgControl;
|
1725
|
STemp.Angle = instance.Angle;
|
1726
|
STemp.EndPoint = instance.EndPoint;
|
1727
|
STemp.LB = instance.LeftBottomPoint;
|
1728
|
STemp.Name = instance.GetType().Name;
|
1729
|
STemp.PointSet = instance.PointSet;
|
1730
|
STemp.StartPoint = instance.StartPoint;
|
1731
|
STemp.UserID = UserId;
|
1732
|
STemp.Opac = instance.Opacity;
|
1733
|
STemp.TR = instance.TopRightPoint;
|
1734
|
STemp.ImagePath = instance.FilePath;
|
1735
|
ConvertData += "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize()));
|
1736
|
}
|
1737
|
break;
|
1738
|
#endregion
|
1739
|
#endregion
|
1740
|
default:
|
1741
|
break;
|
1742
|
}
|
1743
|
}
|
1744
|
#endregion
|
1745
|
|
1746
|
//return ConvertData;
|
1747
|
return Data;
|
1748
|
}
|
1749
|
|
1750
|
|
1751
|
//GUID생성(최민수 사원 수정)
|
1752
|
public string shortGuid()
|
1753
|
{
|
1754
|
byte[] bytes = new byte[16];
|
1755
|
using (var provider = System.Security.Cryptography.RandomNumberGenerator.Create())
|
1756
|
{
|
1757
|
provider.GetBytes(bytes);
|
1758
|
}
|
1759
|
|
1760
|
var guid = new Guid(bytes);
|
1761
|
|
1762
|
return Convert.ToBase64String(guid.ToByteArray())
|
1763
|
.Substring(0, 10)
|
1764
|
.Replace("/", "")
|
1765
|
.Replace("+", "") + DateTime.UtcNow.Ticks.ToString("x");
|
1766
|
}
|
1767
|
|
1768
|
//GUID생성
|
1769
|
//안쓰는 내용
|
1770
|
public Guid GetUniqueGuid()
|
1771
|
{
|
1772
|
char[] chars = "ABCDEF1234567890".ToCharArray();
|
1773
|
byte[] data = new byte[1];
|
1774
|
System.Security.Cryptography.RNGCryptoServiceProvider crypto = new System.Security.Cryptography.RNGCryptoServiceProvider();
|
1775
|
crypto.GetNonZeroBytes(data);
|
1776
|
data = new byte[32];
|
1777
|
crypto.GetNonZeroBytes(data);
|
1778
|
StringBuilder result = new StringBuilder(32);
|
1779
|
|
1780
|
foreach (byte b in data)
|
1781
|
{
|
1782
|
result.Append(chars[b % (chars.Length - 1)]);
|
1783
|
}
|
1784
|
|
1785
|
return Guid.ParseExact(result.ToString(0, 8) + "-" + result.ToString(8, 4) + "-" + result.ToString(11, 4) + "-"
|
1786
|
+ result.ToString(16, 4) + "-" + result.ToString(20, 12), "D");
|
1787
|
}
|
1788
|
|
1789
|
///강인구 추가(2017.11.02)
|
1790
|
///DATA_TYPE추가로 인한 클래스 변수 추가
|
1791
|
//markup_Data.DATA = MarkupString;
|
1792
|
public class MarkupReturn
|
1793
|
{
|
1794
|
public string ConvertData { get; set; }
|
1795
|
public int DATA_TYPE { get; set; }
|
1796
|
|
1797
|
public string CommentID { get; set; }
|
1798
|
}
|
1799
|
|
1800
|
//GUID생성
|
1801
|
//public Guid GetUniqueGuid()
|
1802
|
//{
|
1803
|
// char[] chars = "ABCDEF1234567890".ToCharArray();
|
1804
|
// byte[] data = new byte[1];
|
1805
|
// System.Security.Cryptography.RNGCryptoServiceProvider crypto = new System.Security.Cryptography.RNGCryptoServiceProvider();
|
1806
|
// crypto.GetNonZeroBytes(data);
|
1807
|
// data = new byte[32];
|
1808
|
// crypto.GetNonZeroBytes(data);
|
1809
|
// StringBuilder result = new StringBuilder(32);
|
1810
|
|
1811
|
// foreach (byte b in data)
|
1812
|
// {
|
1813
|
// result.Append(chars[b % (chars.Length - 1)]);
|
1814
|
// }
|
1815
|
|
1816
|
// return Guid.ParseExact(result.ToString(0, 8) + "-" + result.ToString(8, 4) + "-" + result.ToString(11, 4) + "-"
|
1817
|
// + result.ToString(16, 4) + "-" + result.ToString(20, 12), "D");
|
1818
|
//}
|
1819
|
}
|
1820
|
}
|