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