markus / MarkupToPDF / Controls / Polygon / InkControl.cs @ 959b3ef2
이력 | 보기 | 이력해설 | 다운로드 (22.2 KB)
1 | 787a4489 | KangIngu | using MarkupToPDF.Common; |
---|---|---|---|
2 | using MarkupToPDF.Controls.Common; |
||
3 | 036650a0 | humkyung | using MarkupToPDF.Serialize.Core; |
4 | using MarkupToPDF.Serialize.S_Control; |
||
5 | 787a4489 | KangIngu | using System; |
6 | using System.Collections.Generic; |
||
7 | using System.ComponentModel; |
||
8 | using System.Linq; |
||
9 | using System.Text; |
||
10 | using System.Threading.Tasks; |
||
11 | using System.Windows; |
||
12 | using System.Windows.Controls; |
||
13 | using System.Windows.Media; |
||
14 | using System.Windows.Shapes; |
||
15 | |||
16 | namespace MarkupToPDF.Controls.Polygon |
||
17 | { |
||
18 | public class InkControl : CommentUserInfo, IDisposable, INotifyPropertyChanged, IShapeControl, IMarkupControlData, IDashControl |
||
19 | { |
||
20 | #region Constructure |
||
21 | |||
22 | static InkControl() |
||
23 | { |
||
24 | DefaultStyleKeyProperty.OverrideMetadata(typeof(InkControl), new FrameworkPropertyMetadata(typeof(InkControl))); |
||
25 | ResourceDictionary dictionary = new ResourceDictionary(); |
||
26 | dictionary.Source = new Uri("/MarkupToPDF;component/themes/generic.xaml", UriKind.RelativeOrAbsolute); |
||
27 | Application.Current.Resources.MergedDictionaries.Add(dictionary); |
||
28 | } |
||
29 | |||
30 | public InkControl() |
||
31 | { |
||
32 | this.DefaultStyleKey = typeof(InkControl); |
||
33 | } |
||
34 | |||
35 | #endregion |
||
36 | |||
37 | #region Variable |
||
38 | private const string PART_PolyPath = "PART_PolyPath"; |
||
39 | |||
40 | public Path Base_PolyPath = null; |
||
41 | |||
42 | #endregion |
||
43 | |||
44 | #region Internal Method |
||
45 | public override void OnApplyTemplate() |
||
46 | { |
||
47 | base.OnApplyTemplate(); |
||
48 | |||
49 | Base_PolyPath = GetTemplateChild(PART_PolyPath) as Path; |
||
50 | |||
51 | if (Base_PolyPath == null) |
||
52 | return; |
||
53 | |||
54 | this.SetPolyPath(); |
||
55 | } |
||
56 | |||
57 | |||
58 | #endregion |
||
59 | |||
60 | #region Method |
||
61 | |||
62 | public void ApplyOverViewData() |
||
63 | { |
||
64 | this.OverViewPathData = this.PathData; |
||
65 | } |
||
66 | |||
67 | #endregion |
||
68 | |||
69 | #region Dependency Properties |
||
70 | |||
71 | public static readonly DependencyProperty UserIDProperty = DependencyProperty.Register( |
||
72 | "UserID", typeof(string), typeof(InkControl), new PropertyMetadata(null)); |
||
73 | |||
74 | public static readonly DependencyProperty LineSizeProperty = DependencyProperty.Register( |
||
75 | "LineSize", typeof(double), typeof(InkControl), new PropertyMetadata((Double)3)); |
||
76 | |||
77 | public static readonly DependencyProperty StrokeColorProperty = DependencyProperty.Register( |
||
78 | "StrokeColor", typeof(SolidColorBrush), typeof(InkControl), |
||
79 | new PropertyMetadata(new SolidColorBrush(Colors.Red))); |
||
80 | |||
81 | public static readonly DependencyProperty PathDataProperty = DependencyProperty.Register( |
||
82 | "PathData", typeof(Geometry), typeof(InkControl), null); |
||
83 | |||
84 | //강인구 추가 |
||
85 | public static readonly DependencyProperty DashSizeProperty = DependencyProperty.Register( |
||
86 | "DashSize", typeof(DoubleCollection), typeof(InkControl), new PropertyMetadata(new DoubleCollection { 99999999 }, PointValueChanged)); |
||
87 | |||
88 | public static readonly DependencyProperty OverViewPathDataProperty = DependencyProperty.Register( |
||
89 | "OverViewPathData", typeof(Geometry), typeof(InkControl), null); |
||
90 | //강인구 추가 |
||
91 | public static readonly DependencyProperty PaintProperty = DependencyProperty.Register( |
||
92 | "Paint", typeof(PaintSet), typeof(InkControl), new PropertyMetadata(PaintSet.None, PointValueChanged)); |
||
93 | |||
94 | public static readonly DependencyProperty IsCompletedProperty = DependencyProperty.Register( |
||
95 | "IsCompleted", typeof(bool), typeof(InkControl), null); |
||
96 | |||
97 | public static readonly DependencyProperty StartPointProperty = DependencyProperty.Register( |
||
98 | "StartPoint", typeof(Point), typeof(InkControl), new PropertyMetadata(new Point(0, 0), PointValueChanged)); |
||
99 | |||
100 | public static readonly DependencyProperty EndPointProperty = DependencyProperty.Register( |
||
101 | "EndPoint", typeof(Point), typeof(InkControl), new PropertyMetadata(new Point(100, 100), PointValueChanged)); |
||
102 | |||
103 | public static readonly DependencyProperty PointSetProperty = DependencyProperty.Register( |
||
104 | "PointSet", typeof(List<Point>), typeof(InkControl), new PropertyMetadata(new List<Point>(), PointValueChanged)); |
||
105 | |||
106 | /// <summary> |
||
107 | /// StylusPointSet을 List<Point>로 대체하면 PointValueChanged가 작동안한다. |
||
108 | /// </summary> |
||
109 | /// 강인구 추가 Ink Control |
||
110 | public static readonly DependencyProperty StylusPointSetProperty = DependencyProperty.Register( |
||
111 | "PointC", typeof(List<StylusPointSet>), typeof(InkControl), new PropertyMetadata(new List<StylusPointSet>(), PointValueChanged)); |
||
112 | |||
113 | public static readonly DependencyProperty AngleProperty = |
||
114 | DependencyProperty.Register("Angle", typeof(double), typeof(InkControl), new PropertyMetadata((double)0.0, new PropertyChangedCallback |
||
115 | (AngleValueChanged))); |
||
116 | |||
117 | public static readonly DependencyProperty CenterXProperty = |
||
118 | DependencyProperty.Register("CenterX", typeof(double), typeof(InkControl), new PropertyMetadata((double)0, OnCenterXYChanged)); |
||
119 | |||
120 | public static readonly DependencyProperty CenterYProperty = |
||
121 | DependencyProperty.Register("CenterY", typeof(double), typeof(InkControl), new PropertyMetadata((double)0, OnCenterXYChanged)); |
||
122 | |||
123 | public static readonly DependencyProperty IsSelectedProperty = |
||
124 | DependencyProperty.Register("IsSelected", typeof(bool), typeof(InkControl), new FrameworkPropertyMetadata(false, IsSelectedChanged)); |
||
125 | |||
126 | public static readonly DependencyProperty ControlTypeProperty = |
||
127 | DependencyProperty.Register("ControlType", typeof(ControlType), typeof(InkControl), new FrameworkPropertyMetadata(ControlType.Ink)); |
||
128 | |||
129 | public static readonly DependencyProperty CanvasXProperty = DependencyProperty.Register( |
||
130 | "CanvasX", typeof(double), typeof(InkControl), new PropertyMetadata((double)0, OnSetCansvasChanged)); |
||
131 | |||
132 | public static readonly DependencyProperty CanvasYProperty = DependencyProperty.Register( |
||
133 | "CanvasY", typeof(double), typeof(InkControl), new PropertyMetadata((double)0, OnSetCansvasChanged)); |
||
134 | |||
135 | #endregion |
||
136 | |||
137 | #region PropertyChanged Method |
||
138 | public static void OnSetCansvasChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) |
||
139 | { |
||
140 | var instance = (InkControl)sender; |
||
141 | |||
142 | if (e.OldValue != e.NewValue && instance != null) |
||
143 | { |
||
144 | instance.SetValue(e.Property, e.NewValue); |
||
145 | //Canvas.SetLeft(instance, instance.CanvasX); |
||
146 | //Canvas.SetTop(instance, instance.CanvasY); |
||
147 | } |
||
148 | } |
||
149 | |||
150 | public static void PointValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) |
||
151 | { |
||
152 | var instance = (InkControl)sender; |
||
153 | |||
154 | if (e.OldValue != e.NewValue && instance != null) |
||
155 | { |
||
156 | instance.SetValue(e.Property, e.NewValue); |
||
157 | //강인구 추가 |
||
158 | instance.SetPolyPath(); |
||
159 | //instance.SetPolyPath(); 주석처리 |
||
160 | |||
161 | } |
||
162 | } |
||
163 | public static void AngleValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) |
||
164 | { |
||
165 | var instance = (InkControl)sender; |
||
166 | |||
167 | if (e.OldValue != e.NewValue && instance != null) |
||
168 | { |
||
169 | instance.SetValue(e.Property, e.NewValue); |
||
170 | instance.SetPolyPath(); |
||
171 | } |
||
172 | } |
||
173 | public static void OnCenterXYChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) |
||
174 | { |
||
175 | var instance = (InkControl)sender; |
||
176 | if (e.OldValue != e.NewValue && instance != null) |
||
177 | { |
||
178 | instance.SetValue(e.Property, e.NewValue); |
||
179 | instance.SetPolyPath(); |
||
180 | } |
||
181 | } |
||
182 | |||
183 | public static void IsSelectedChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) |
||
184 | { |
||
185 | //var instance = (InkControl)sender; |
||
186 | |||
187 | //if (e.OldValue != e.NewValue && instance.Base_PolyPath != null) |
||
188 | //{ |
||
189 | // instance.SetValue(e.Property, e.NewValue); |
||
190 | |||
191 | // if (instance.IsSelected) |
||
192 | // { |
||
193 | // instance.Base_PolyPath.Stroke = new SolidColorBrush(Colors.Blue); |
||
194 | // } |
||
195 | // else |
||
196 | // { |
||
197 | // instance.Base_PolyPath.Stroke = new SolidColorBrush(Colors.Transparent); |
||
198 | // } |
||
199 | //} |
||
200 | } |
||
201 | |||
202 | #endregion |
||
203 | |||
204 | #region Properties |
||
205 | |||
206 | |||
207 | public bool IsCompleted |
||
208 | { |
||
209 | get { return (bool)GetValue(IsCompletedProperty); } |
||
210 | set |
||
211 | { |
||
212 | SetValue(IsCompletedProperty, value); |
||
213 | OnPropertyChanged("IsCompleted"); |
||
214 | } |
||
215 | } |
||
216 | |||
217 | |||
218 | public Geometry OverViewPathData |
||
219 | { |
||
220 | get { return (Geometry)GetValue(OverViewPathDataProperty); } |
||
221 | set |
||
222 | { |
||
223 | SetValue(OverViewPathDataProperty, value); |
||
224 | OnPropertyChanged("OverViewPathData"); |
||
225 | } |
||
226 | } |
||
227 | |||
228 | public double CanvasX |
||
229 | { |
||
230 | get { return (double)GetValue(CanvasXProperty); } |
||
231 | set |
||
232 | { |
||
233 | if (this.CanvasX != value) |
||
234 | { |
||
235 | SetValue(CanvasXProperty, value); |
||
236 | OnPropertyChanged("CanvasX"); |
||
237 | } |
||
238 | } |
||
239 | } |
||
240 | |||
241 | public double CanvasY |
||
242 | { |
||
243 | get { return (double)GetValue(CanvasYProperty); } |
||
244 | set |
||
245 | { |
||
246 | if (this.CanvasY != value) |
||
247 | { |
||
248 | SetValue(CanvasYProperty, value); |
||
249 | OnPropertyChanged("CanvasY"); |
||
250 | } |
||
251 | } |
||
252 | } |
||
253 | |||
254 | 959b3ef2 | humkyung | public override bool IsSelected |
255 | 787a4489 | KangIngu | { |
256 | get |
||
257 | { |
||
258 | return (bool)GetValue(IsSelectedProperty); |
||
259 | } |
||
260 | set |
||
261 | { |
||
262 | SetValue(IsSelectedProperty, value); |
||
263 | OnPropertyChanged("IsSelected"); |
||
264 | } |
||
265 | } |
||
266 | |||
267 | public PaintSet Paint |
||
268 | { |
||
269 | get { return (PaintSet)GetValue(PaintProperty); } |
||
270 | set |
||
271 | { |
||
272 | if (this.Paint != value) |
||
273 | { |
||
274 | SetValue(PaintProperty, value); |
||
275 | OnPropertyChanged("Paint"); |
||
276 | } |
||
277 | } |
||
278 | } |
||
279 | |||
280 | 5529d2a2 | humkyung | public override ControlType ControlType |
281 | 787a4489 | KangIngu | { |
282 | set |
||
283 | { |
||
284 | SetValue(ControlTypeProperty, value); |
||
285 | OnPropertyChanged("ControlType"); |
||
286 | } |
||
287 | get |
||
288 | { |
||
289 | return (ControlType)GetValue(ControlTypeProperty); |
||
290 | } |
||
291 | } |
||
292 | |||
293 | public Double LineSize |
||
294 | { |
||
295 | get { return (Double)GetValue(LineSizeProperty); } |
||
296 | set |
||
297 | { |
||
298 | if (this.LineSize != value) |
||
299 | { |
||
300 | SetValue(LineSizeProperty, value); |
||
301 | OnPropertyChanged("LineSize"); |
||
302 | } |
||
303 | } |
||
304 | } |
||
305 | |||
306 | public DoubleCollection DashSize |
||
307 | { |
||
308 | get { return (DoubleCollection)GetValue(DashSizeProperty); } |
||
309 | set |
||
310 | { |
||
311 | if (this.DashSize != value) |
||
312 | { |
||
313 | SetValue(DashSizeProperty, value); |
||
314 | OnPropertyChanged("DashSize"); |
||
315 | } |
||
316 | } |
||
317 | } |
||
318 | public string UserID |
||
319 | { |
||
320 | get { return (string)GetValue(UserIDProperty); } |
||
321 | set |
||
322 | { |
||
323 | if (this.UserID != value) |
||
324 | { |
||
325 | SetValue(UserIDProperty, value); |
||
326 | OnPropertyChanged("UserID"); |
||
327 | } |
||
328 | } |
||
329 | } |
||
330 | public List<Point> PointSet |
||
331 | { |
||
332 | get { return (List<Point>)GetValue(PointSetProperty); } |
||
333 | set |
||
334 | { |
||
335 | SetValue(PointSetProperty, value); |
||
336 | OnPropertyChanged("PointSet"); |
||
337 | } |
||
338 | } |
||
339 | //강인구 추가 InkControl |
||
340 | public List<StylusPointSet> PointC |
||
341 | { |
||
342 | get { return (List<StylusPointSet>)GetValue(StylusPointSetProperty); } |
||
343 | set |
||
344 | { |
||
345 | SetValue(StylusPointSetProperty, value); |
||
346 | OnPropertyChanged("PointC"); |
||
347 | } |
||
348 | } |
||
349 | |||
350 | |||
351 | public double CenterX |
||
352 | { |
||
353 | get { return (double)GetValue(CenterXProperty); } |
||
354 | set |
||
355 | { |
||
356 | SetValue(CenterXProperty, value); |
||
357 | OnPropertyChanged("CenterX"); |
||
358 | } |
||
359 | } |
||
360 | public double CenterY |
||
361 | { |
||
362 | get |
||
363 | { |
||
364 | return (double)GetValue(CenterYProperty); |
||
365 | } |
||
366 | set |
||
367 | { |
||
368 | SetValue(CenterYProperty, value); |
||
369 | OnPropertyChanged("CenterY"); |
||
370 | } |
||
371 | } |
||
372 | public SolidColorBrush StrokeColor |
||
373 | { |
||
374 | get { return (SolidColorBrush)GetValue(StrokeColorProperty); } |
||
375 | set |
||
376 | { |
||
377 | if (this.StrokeColor != value) |
||
378 | { |
||
379 | SetValue(StrokeColorProperty, value); |
||
380 | OnPropertyChanged("StrokeColor"); |
||
381 | } |
||
382 | } |
||
383 | } |
||
384 | public Geometry PathData |
||
385 | { |
||
386 | get { return (Geometry)GetValue(PathDataProperty); } |
||
387 | set |
||
388 | { |
||
389 | SetValue(PathDataProperty, value); |
||
390 | OnPropertyChanged("PathData"); |
||
391 | } |
||
392 | } |
||
393 | |||
394 | public double Angle |
||
395 | { |
||
396 | get { return (double)GetValue(AngleProperty); } |
||
397 | set |
||
398 | { |
||
399 | if (this.Angle != value) |
||
400 | { |
||
401 | SetValue(AngleProperty, value); |
||
402 | OnPropertyChanged("Angle"); |
||
403 | } |
||
404 | } |
||
405 | } |
||
406 | |||
407 | public Point EndPoint |
||
408 | { |
||
409 | get { return (Point)GetValue(EndPointProperty); } |
||
410 | set |
||
411 | { |
||
412 | SetValue(EndPointProperty, value); |
||
413 | OnPropertyChanged("EndPoint"); |
||
414 | } |
||
415 | } |
||
416 | public Point StartPoint |
||
417 | { |
||
418 | get { return (Point)GetValue(StartPointProperty); } |
||
419 | set |
||
420 | { |
||
421 | SetValue(StartPointProperty, value); |
||
422 | OnPropertyChanged("StartPoint"); |
||
423 | } |
||
424 | } |
||
425 | #endregion |
||
426 | |||
427 | public void updateControl() |
||
428 | { |
||
429 | this.PointSet = new List<Point>(); |
||
430 | |||
431 | //this.PointSet.Clear(); |
||
432 | |||
433 | //this.PointSet.AddRange(PointC.pointSet); |
||
434 | //this.PointSet.AddRange(PointSet); |
||
435 | |||
436 | //강인구 추가(Ink Control) |
||
437 | |||
438 | |||
439 | foreach (var item in PointC) |
||
440 | { |
||
441 | PointSet.AddRange(item.pointSet); |
||
442 | } |
||
443 | |||
444 | //////////////////////////////////////// |
||
445 | |||
446 | this.StartPoint = new Point(this.PointSet[0].X, this.PointSet[0].Y); |
||
447 | |||
448 | this.EndPoint = new Point(this.PointSet[this.PointSet.Count - 1].X, this.PointSet[this.PointSet.Count - 1].Y); |
||
449 | |||
450 | //SetPolyPath(); |
||
451 | } |
||
452 | |||
453 | 661b7416 | humkyung | private void SetPolyPath() |
454 | 787a4489 | KangIngu | { |
455 | this.ApplyTemplate(); |
||
456 | |||
457 | if (Base_PolyPath != null) |
||
458 | { |
||
459 | Base_PolyPath.StrokeDashArray.Clear(); |
||
460 | |||
461 | if (DashSize != null) |
||
462 | { |
||
463 | foreach (var item in this.DashSize) |
||
464 | { |
||
465 | Base_PolyPath.StrokeDashArray.Add(item); |
||
466 | } |
||
467 | } |
||
468 | |||
469 | PathGeometry pathGeometry = new PathGeometry(); |
||
470 | if (PointC != null && PointC.Count > 0) |
||
471 | { |
||
472 | foreach (var item in PointC) |
||
473 | { |
||
474 | PathFigure pathFigure_ = new PathFigure(); |
||
475 | pathFigure_.StartPoint = item.pointSet[0]; |
||
476 | System.Diagnostics.Debug.WriteLine("SP : " + pathFigure_.StartPoint); |
||
477 | PolyLineSegment instance_ = new PolyLineSegment(); |
||
478 | foreach (var Inneritem in item.pointSet) |
||
479 | { |
||
480 | instance_.Points.Add(Inneritem); |
||
481 | } |
||
482 | pathFigure_.Segments.Add(instance_); |
||
483 | pathGeometry.Figures.Add(pathFigure_); |
||
484 | } |
||
485 | this.PathData = pathGeometry; |
||
486 | return; |
||
487 | } |
||
488 | |||
489 | PathFigure pathFigure = new PathFigure(); |
||
490 | PolyLineSegment instance = new PolyLineSegment(); |
||
491 | |||
492 | |||
493 | foreach (var Inneritem in PointSet) |
||
494 | { |
||
495 | instance.Points.Add(Inneritem); |
||
496 | } |
||
497 | |||
498 | |||
499 | StartPoint = instance.Points.First(); |
||
500 | pathFigure.StartPoint = StartPoint; |
||
501 | EndPoint = instance.Points.Last(); |
||
502 | pathFigure.Segments.Add(instance); |
||
503 | pathGeometry.Figures.Add(pathFigure); |
||
504 | |||
505 | //강인구 추가(Chain이 아닌 Polygon일때만 채우기 및 빗금 하기) |
||
506 | if (ControlType == ControlType.Ink) |
||
507 | { |
||
508 | switch (this.Paint) |
||
509 | { |
||
510 | case PaintSet.None: |
||
511 | { |
||
512 | //강인구 추가 |
||
513 | Base_PolyPath.Fill = null; |
||
514 | } |
||
515 | break; |
||
516 | case PaintSet.Fill: |
||
517 | { |
||
518 | Base_PolyPath.Fill = this.StrokeColor; |
||
519 | } |
||
520 | break; |
||
521 | case PaintSet.Hatch: |
||
522 | { |
||
523 | Base_PolyPath.Fill = HatchMake.CreateHatchBrush(this.StrokeColor, this.LineSize * 0.1); |
||
524 | } |
||
525 | break; |
||
526 | default: |
||
527 | break; |
||
528 | } |
||
529 | } |
||
530 | |||
531 | this.PathData = pathGeometry; |
||
532 | this.OverViewPathData = PathData; |
||
533 | } |
||
534 | } |
||
535 | |||
536 | public void ChangePaint(PaintSet state) |
||
537 | { |
||
538 | |||
539 | } |
||
540 | |||
541 | 036650a0 | humkyung | /// <summary> |
542 | /// Serialize this |
||
543 | /// </summary> |
||
544 | /// <param name="sUserId"></param> |
||
545 | /// <returns></returns> |
||
546 | public override string Serialize() |
||
547 | { |
||
548 | using (S_PolyControl STemp = new S_PolyControl()) |
||
549 | { |
||
550 | STemp.TransformPoint = "0|0"; |
||
551 | STemp.SizeSet = String.Format("{0}", this.LineSize); |
||
552 | STemp.StrokeColor = this.StrokeColor.Color.ToString(); |
||
553 | //STemp.StrokeColor = "#FF000FFF"; |
||
554 | STemp.Name = this.GetType().Name.ToString(); |
||
555 | //STemp.Toler = this.Toler; |
||
556 | STemp.PaintState = this.Paint; |
||
557 | STemp.Opac = this.Opacity; |
||
558 | STemp.UserID = this.UserID; |
||
559 | STemp.PaintState = this.Paint; |
||
560 | //강인구 추가(Chain인지 Polygon인지 구분) |
||
561 | STemp.Type = this.ControlType; |
||
562 | //STemp.IsTrans = this.isTransOn; |
||
563 | //STemp.IsChain = this.isChain; |
||
564 | STemp.PointSet = new List<Point>(); |
||
565 | STemp.DashSize = this.DashSize; |
||
566 | STemp.IsCompleted = this.IsCompleted; |
||
567 | STemp.StartPoint = this.StartPoint; |
||
568 | STemp.EndPoint = this.EndPoint; |
||
569 | foreach (var point in this.PointSet) |
||
570 | { |
||
571 | STemp.PointSet.Add(point); |
||
572 | } |
||
573 | ///강인구 추가(2017.11.02) |
||
574 | ///Memo 추가 |
||
575 | STemp.Memo = this.Memo; |
||
576 | |||
577 | return "|DZ|" + JsonSerializerHelper.CompressString((STemp.JsonSerialize())); |
||
578 | }; |
||
579 | } |
||
580 | |||
581 | 661b7416 | humkyung | /// <summary> |
582 | /// create a inkcontrol from given string |
||
583 | /// </summary> |
||
584 | /// <param name="str"></param> |
||
585 | /// <returns></returns> |
||
586 | public static InkControl FromString(string str, SolidColorBrush brush, string sProjectNo) |
||
587 | { |
||
588 | using (S_PolyControl s = JsonSerializerHelper.JsonDeserialize<S_PolyControl>(str)) |
||
589 | { |
||
590 | string[] data2 = s.SizeSet.Split(delimiterChars2, StringSplitOptions.RemoveEmptyEntries); |
||
591 | return new InkControl |
||
592 | { |
||
593 | LineSize = Convert.ToDouble(data2.First()), |
||
594 | //Toler = s.Toler, |
||
595 | IsCompleted = s.IsCompleted, |
||
596 | //PointSet = new List<Point>(), |
||
597 | Opacity = s.Opac, |
||
598 | StrokeColor = brush, |
||
599 | //강인구 추가(Chain인지 Polygon인지 구분) |
||
600 | ControlType = s.Type, |
||
601 | DashSize = s.DashSize, |
||
602 | StartPoint = s.StartPoint, |
||
603 | PointSet = s.PointSet, |
||
604 | UserID = s.UserID, |
||
605 | Paint = s.PaintState, |
||
606 | EndPoint = s.EndPoint, |
||
607 | //PointC = s.PointC, |
||
608 | Memo = s.Memo |
||
609 | }; |
||
610 | } |
||
611 | } |
||
612 | 787a4489 | KangIngu | //public PaintSet Paint { get; set; } |
613 | |||
614 | |||
615 | #region Dispose |
||
616 | public void Dispose() |
||
617 | { |
||
618 | GC.Collect(); |
||
619 | GC.SuppressFinalize(this); |
||
620 | } |
||
621 | #endregion |
||
622 | |||
623 | #region INotifyPropertyChanged |
||
624 | private void OnPropertyChanged(string name) |
||
625 | { |
||
626 | if (PropertyChanged != null) |
||
627 | { |
||
628 | PropertyChanged(this, new PropertyChangedEventArgs(name)); |
||
629 | } |
||
630 | } |
||
631 | |||
632 | public event PropertyChangedEventHandler PropertyChanged; |
||
633 | #endregion |
||
634 | } |
||
635 | |||
636 | //public class StylusPointSet : INotifyPropertyChanged |
||
637 | //{ |
||
638 | // public StylusPointSet() |
||
639 | // { |
||
640 | // if (pointSet == null) |
||
641 | // pointSet = new List<Point>(); |
||
642 | // } |
||
643 | |||
644 | // public List<Point> _pointSet; |
||
645 | |||
646 | // public List<Point> pointSet |
||
647 | // { |
||
648 | // get |
||
649 | // { |
||
650 | // return _pointSet; |
||
651 | // } |
||
652 | // set |
||
653 | // { |
||
654 | // _pointSet = value; |
||
655 | // OnPropertyChanged("pointSet"); |
||
656 | // } |
||
657 | // } |
||
658 | |||
659 | // #region INotifyPropertyChanged |
||
660 | // private void OnPropertyChanged(string name) |
||
661 | // { |
||
662 | // if (PropertyChanged != null) |
||
663 | // { |
||
664 | // PropertyChanged(this, new PropertyChangedEventArgs(name)); |
||
665 | // } |
||
666 | // } |
||
667 | |||
668 | // public event PropertyChangedEventHandler PropertyChanged; |
||
669 | // #endregion |
||
670 | //} |
||
671 | } |