markus / KCOM / Events / Move.cs @ bc664e9b
이력 | 보기 | 이력해설 | 다운로드 (31.8 KB)
1 |
using MarkupToPDF.Common; |
---|---|
2 |
using MarkupToPDF.Controls.Common; |
3 |
using MarkupToPDF.Controls.Line; |
4 |
using MarkupToPDF.Controls.Polygon; |
5 |
using MarkupToPDF.Controls.Shape; |
6 |
using MarkupToPDF.Controls.Text; |
7 |
using MarkupToPDF.Controls.Etc; |
8 |
using System; |
9 |
using System.Collections.Generic; |
10 |
using System.Linq; |
11 |
using System.Text; |
12 |
using System.Windows; |
13 |
using System.Windows.Controls; |
14 |
using System.Windows.Media; |
15 |
|
16 |
namespace KCOM.Events |
17 |
{ |
18 |
public class Move |
19 |
{ |
20 |
#region 변수 선언 |
21 |
public SelectControl selectcontrol; |
22 |
private Dictionary<object, Point> Dic; |
23 |
RectangleControl rectanglecontrol; |
24 |
CircleControl circlecontrol; |
25 |
TriControl tricontrol; |
26 |
RectCloudControl rectCloudcontrol; |
27 |
LineControl linecontrol; |
28 |
ArcControl arccontrol; |
29 |
ArrowControl_Multi arrowControl_Multi; |
30 |
TextControl textcontrol; |
31 |
CloudControl cloudcontrol; |
32 |
PolygonControl polygoncontrol; |
33 |
ArrowTextControl arrowtextcontrol; |
34 |
IMarkupCommonData CommonData; |
35 |
Vector rectSize; |
36 |
Rect itemRect; |
37 |
Point s_point; |
38 |
Point e_point; |
39 |
Rect DragRect; |
40 |
Dictionary<Geometry, string> selected_item; |
41 |
#endregion |
42 |
|
43 |
Point[] StartPoint |
44 |
{ |
45 |
get; |
46 |
set; |
47 |
} |
48 |
|
49 |
Point[] MidPoint |
50 |
{ |
51 |
get; |
52 |
set; |
53 |
} |
54 |
|
55 |
Point[] EndPoint |
56 |
{ |
57 |
get; |
58 |
set; |
59 |
} |
60 |
|
61 |
public List<Point> PointSet |
62 |
{ |
63 |
get; |
64 |
set; |
65 |
} |
66 |
|
67 |
public CommentUserInfo CurrentControl |
68 |
{ |
69 |
get; |
70 |
set; |
71 |
} |
72 |
|
73 |
public MouseMode mousemode |
74 |
{ |
75 |
get; |
76 |
set; |
77 |
} |
78 |
|
79 |
|
80 |
#region 아이템 선택 |
81 |
public Boolean control_Select(object Control, Rect dragrect) |
82 |
{ |
83 |
//CommonData = commonData; |
84 |
DragRect = dragrect; |
85 |
|
86 |
ItemRect(Control); |
87 |
|
88 |
if (DragRect.Contains(itemRect)) |
89 |
return true; |
90 |
else |
91 |
return false; |
92 |
#region 주석 |
93 |
|
94 |
//switch (commonData.ControlType) |
95 |
//{ |
96 |
// #region Shape |
97 |
// case (ControlType.Rectangle): |
98 |
// { |
99 |
// Flag = IsSelectionControl((Control as RectangleControl).OverViewPathData); |
100 |
// } |
101 |
// break; |
102 |
// case (ControlType.Circle): |
103 |
// { |
104 |
// Flag = IsSelectionControl((Control as CircleControl).OverViewPathData); |
105 |
// } |
106 |
// break; |
107 |
// case (ControlType.RectCloud): |
108 |
// { |
109 |
// Flag = IsSelectionControl((Control as RectCloudControl).OverViewPathData); |
110 |
// } |
111 |
// break; |
112 |
// case (ControlType.Triangle): |
113 |
// { |
114 |
// Flag = IsSelectionControl((Control as TriControl).OverViewPathData); |
115 |
// } |
116 |
// break; |
117 |
// #endregion |
118 |
// #region Line |
119 |
// case (ControlType.SingleLine): |
120 |
// { |
121 |
// Flag = IsSelectionControl((Control as LineControl).OverViewPathData); |
122 |
// } |
123 |
// break; |
124 |
// case (ControlType.ArrowLine): |
125 |
// { |
126 |
// Flag = IsSelectionControl((Control as LineControl).OverViewPathData); |
127 |
// } |
128 |
// break; |
129 |
// case (ControlType.ArrowMultiLine): |
130 |
// { |
131 |
// Flag = IsSelectionControl((Control as ArrowControl_Multi).OverViewPathData); |
132 |
// } |
133 |
// break; |
134 |
// case (ControlType.CancelLine): |
135 |
// { |
136 |
// Flag = IsSelectionControl((Control as LineControl).OverViewPathData); |
137 |
// } |
138 |
// break; |
139 |
// case (ControlType.ChainLine): |
140 |
// { |
141 |
// Flag = IsSelectionControl((Control as LineControl).OverViewPathData); |
142 |
// } |
143 |
// break; |
144 |
// case (ControlType.DimLine): |
145 |
// { |
146 |
// Flag = IsSelectionControl((Control as LineControl).OverViewPathData); |
147 |
// } |
148 |
// break; |
149 |
// case (ControlType.TwinLine): |
150 |
// { |
151 |
// Flag = IsSelectionControl((Control as LineControl).OverViewPathData); |
152 |
// } |
153 |
// break; |
154 |
// case (ControlType.ArcLine): |
155 |
// { |
156 |
// Flag = IsSelectionControl((Control as ArcControl).OverViewPathData); |
157 |
// } |
158 |
// break; |
159 |
// case (ControlType.ArcArrow): |
160 |
// { |
161 |
// Flag = IsSelectionControl((Control as ArcControl).OverViewPathData); |
162 |
// } |
163 |
// break; |
164 |
// #endregion |
165 |
|
166 |
// #region text |
167 |
|
168 |
// case (ControlType.TextControl): |
169 |
// { |
170 |
// //IsSelectionControl((Control as TextControl).OverViewPathData); |
171 |
// Flag = IsSelectionControl((Control as TextControl).OverViewPathData); |
172 |
// } |
173 |
// break; |
174 |
|
175 |
// case (ControlType.TextBorder): |
176 |
// { |
177 |
// //IsSelectionControl((Control as TextControl).OverViewPathData); |
178 |
// Flag = IsSelectionControl((Control as TextControl).OverViewPathData); |
179 |
// } |
180 |
// break; |
181 |
|
182 |
// case (ControlType.TextCloud): |
183 |
// { |
184 |
// //IsSelectionControl((Control as TextControl).OverViewPathData); |
185 |
// Flag = IsSelectionControl((Control as TextControl).OverViewPathData); |
186 |
// } |
187 |
// break; |
188 |
// #endregion |
189 |
// #region ArrowText |
190 |
|
191 |
// case (ControlType.ArrowTextControl): |
192 |
// { |
193 |
// //IsSelectionControl((Control as TextControl).OverViewPathData); |
194 |
// Flag = IsSelectionControl((Control as ArrowTextControl).OverViewPathData); |
195 |
// } |
196 |
// break; |
197 |
// case (ControlType.ArrowTextBorderControl): |
198 |
// { |
199 |
// //IsSelectionControl((Control as TextControl).OverViewPathData); |
200 |
// Flag = IsSelectionControl((Control as ArrowTextControl).OverViewPathData); |
201 |
// } |
202 |
// break; |
203 |
// case (ControlType.ArrowTextCloudControl): |
204 |
// { |
205 |
// //IsSelectionControl((Control as TextControl).OverViewPathData); |
206 |
// Flag = IsSelectionControl((Control as ArrowTextControl).OverViewPathData); |
207 |
// } |
208 |
// break; |
209 |
// case (ControlType.ArrowTransTextControl): |
210 |
// { |
211 |
// //IsSelectionControl((Control as TextControl).OverViewPathData); |
212 |
// Flag = IsSelectionControl((Control as ArrowTextControl).OverViewPathData); |
213 |
// } |
214 |
// break; |
215 |
// case (ControlType.ArrowTransTextBorderControl): |
216 |
// { |
217 |
// //IsSelectionControl((Control as TextControl).OverViewPathData); |
218 |
// Flag = IsSelectionControl((Control as ArrowTextControl).OverViewPathData); |
219 |
// } |
220 |
// break; |
221 |
// case (ControlType.ArrowTransTextCloudControl): |
222 |
// { |
223 |
// //IsSelectionControl((Control as TextControl).OverViewPathData); |
224 |
// Flag = IsSelectionControl((Control as ArrowTextControl).OverViewPathData); |
225 |
// } |
226 |
// break; |
227 |
// #endregion |
228 |
|
229 |
//} |
230 |
#endregion |
231 |
} |
232 |
#endregion |
233 |
|
234 |
public void ItemRect(object control) |
235 |
{ |
236 |
s_point = new Point(); |
237 |
e_point = new Point(); |
238 |
|
239 |
|
240 |
if (control.GetType().Name == "TextControl") |
241 |
{ |
242 |
s_point.X = (control as TextControl).CanvasX; |
243 |
s_point.Y = (control as TextControl).CanvasY; |
244 |
|
245 |
Point length = new Point(); |
246 |
double angle = (control as TextControl).Angle; |
247 |
angle = Math.PI * angle / 180; |
248 |
|
249 |
length.X = (control as TextControl).BoxWidth * Math.Cos(angle) - (control as TextControl).BoxHeight * Math.Sin(angle); |
250 |
length.Y = (control as TextControl).BoxWidth * Math.Sin(angle) + (control as TextControl).BoxHeight * Math.Cos(angle); |
251 |
|
252 |
e_point.X = s_point.X + length.X; |
253 |
e_point.Y = s_point.Y + length.Y; |
254 |
rectSize = e_point - s_point; |
255 |
|
256 |
itemRect = new Rect(s_point, new Point(s_point.X + rectSize.X, s_point.Y + rectSize.Y)); |
257 |
return; |
258 |
} |
259 |
|
260 |
switch ((control as IMarkupCommonData).ControlType) |
261 |
{ |
262 |
#region Shape |
263 |
case (ControlType.Rectangle): |
264 |
{ |
265 |
s_point.X = Math.Min((control as RectangleControl).StartPoint.X, (control as RectangleControl).EndPoint.X); |
266 |
s_point.Y = Math.Min((control as RectangleControl).StartPoint.Y, (control as RectangleControl).EndPoint.Y); |
267 |
e_point.X = Math.Max((control as RectangleControl).StartPoint.X, (control as RectangleControl).EndPoint.X); |
268 |
e_point.Y = Math.Max((control as RectangleControl).StartPoint.Y, (control as RectangleControl).EndPoint.Y); |
269 |
rectSize = e_point - s_point; |
270 |
} |
271 |
break; |
272 |
case (ControlType.Circle): |
273 |
{ |
274 |
s_point.X = Math.Min((control as CircleControl).StartPoint.X, (control as CircleControl).EndPoint.X); |
275 |
s_point.Y = Math.Min((control as CircleControl).StartPoint.Y, (control as CircleControl).EndPoint.Y); |
276 |
e_point.X = Math.Max((control as CircleControl).StartPoint.X, (control as CircleControl).EndPoint.X); |
277 |
e_point.Y = Math.Max((control as CircleControl).StartPoint.Y, (control as CircleControl).EndPoint.Y); |
278 |
rectSize = e_point - s_point; |
279 |
} |
280 |
break; |
281 |
case (ControlType.RectCloud): |
282 |
{ |
283 |
s_point.X = Math.Min((control as RectCloudControl).StartPoint.X, (control as RectCloudControl).EndPoint.X); |
284 |
s_point.Y = Math.Min((control as RectCloudControl).StartPoint.Y, (control as RectCloudControl).EndPoint.Y); |
285 |
e_point.X = Math.Max((control as RectCloudControl).StartPoint.X, (control as RectCloudControl).EndPoint.X); |
286 |
e_point.Y = Math.Max((control as RectCloudControl).StartPoint.Y, (control as RectCloudControl).EndPoint.Y); |
287 |
rectSize = e_point - s_point; |
288 |
} |
289 |
break; |
290 |
case (ControlType.Triangle): |
291 |
{ |
292 |
s_point.X = Math.Min((control as TriControl).StartPoint.X, (control as TriControl).EndPoint.X); |
293 |
s_point.X = Math.Min((control as TriControl).MidPoint.X, s_point.X); |
294 |
s_point.Y = Math.Min((control as TriControl).StartPoint.Y, (control as TriControl).EndPoint.Y); |
295 |
s_point.Y = Math.Min((control as TriControl).MidPoint.Y, s_point.Y); |
296 |
e_point.X = Math.Max((control as TriControl).StartPoint.X, (control as TriControl).EndPoint.X); |
297 |
e_point.X = Math.Max((control as TriControl).MidPoint.X, e_point.X); |
298 |
e_point.Y = Math.Max((control as TriControl).StartPoint.Y, (control as TriControl).EndPoint.Y); |
299 |
e_point.Y = Math.Max((control as TriControl).MidPoint.Y, e_point.Y); |
300 |
rectSize = e_point - s_point; |
301 |
} |
302 |
break; |
303 |
#endregion |
304 |
|
305 |
#region Line |
306 |
case (ControlType.SingleLine): |
307 |
{ |
308 |
s_point.X = Math.Min((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
309 |
s_point.Y = Math.Min((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
310 |
e_point.X = Math.Max((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
311 |
e_point.Y = Math.Max((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
312 |
rectSize = e_point - s_point; |
313 |
} |
314 |
break; |
315 |
case (ControlType.ArrowLine): |
316 |
{ |
317 |
s_point.X = Math.Min((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
318 |
s_point.Y = Math.Min((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
319 |
e_point.X = Math.Max((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
320 |
e_point.Y = Math.Max((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
321 |
rectSize = e_point - s_point; |
322 |
} |
323 |
break; |
324 |
case (ControlType.ArrowMultiLine): |
325 |
{ |
326 |
s_point.X = Math.Min((control as ArrowControl_Multi).StartPoint.X, (control as ArrowControl_Multi).EndPoint.X); |
327 |
s_point.X = Math.Min((control as ArrowControl_Multi).MiddlePoint.X, s_point.X); |
328 |
s_point.Y = Math.Min((control as ArrowControl_Multi).StartPoint.Y, (control as ArrowControl_Multi).EndPoint.Y); |
329 |
s_point.Y = Math.Min((control as ArrowControl_Multi).MiddlePoint.Y, s_point.Y); |
330 |
e_point.X = Math.Max((control as ArrowControl_Multi).StartPoint.X, (control as ArrowControl_Multi).EndPoint.X); |
331 |
e_point.X = Math.Max((control as ArrowControl_Multi).MiddlePoint.X, e_point.X); |
332 |
e_point.Y = Math.Max((control as ArrowControl_Multi).StartPoint.Y, (control as ArrowControl_Multi).EndPoint.Y); |
333 |
e_point.Y = Math.Max((control as ArrowControl_Multi).MiddlePoint.Y, e_point.Y); |
334 |
rectSize = e_point - s_point; |
335 |
} |
336 |
break; |
337 |
case (ControlType.CancelLine): |
338 |
{ |
339 |
s_point.X = Math.Min((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
340 |
s_point.Y = Math.Min((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
341 |
e_point.X = Math.Max((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
342 |
e_point.Y = Math.Max((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
343 |
rectSize = e_point - s_point; |
344 |
} |
345 |
break; |
346 |
case (ControlType.DimLine): |
347 |
{ |
348 |
s_point.X = Math.Min((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
349 |
s_point.Y = Math.Min((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
350 |
e_point.X = Math.Max((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
351 |
e_point.Y = Math.Max((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
352 |
rectSize = e_point - s_point; |
353 |
} |
354 |
break; |
355 |
case (ControlType.TwinLine): |
356 |
{ |
357 |
s_point.X = Math.Min((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
358 |
s_point.Y = Math.Min((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
359 |
e_point.X = Math.Max((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
360 |
e_point.Y = Math.Max((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
361 |
rectSize = e_point - s_point; |
362 |
} |
363 |
break; |
364 |
case (ControlType.ArcLine): |
365 |
{ |
366 |
s_point.X = Math.Min((control as ArcControl).StartPoint.X, (control as ArcControl).EndPoint.X); |
367 |
s_point.X = Math.Min((control as ArcControl).MidPoint.X, s_point.X); |
368 |
s_point.Y = Math.Min((control as ArcControl).StartPoint.Y, (control as ArcControl).EndPoint.Y); |
369 |
s_point.Y = Math.Min((control as ArcControl).MidPoint.Y, s_point.Y); |
370 |
e_point.X = Math.Max((control as ArcControl).StartPoint.X, (control as ArcControl).EndPoint.X); |
371 |
e_point.X = Math.Max((control as ArcControl).MidPoint.X, e_point.X); |
372 |
e_point.Y = Math.Max((control as ArcControl).StartPoint.Y, (control as ArcControl).EndPoint.Y); |
373 |
e_point.Y = Math.Max((control as ArcControl).MidPoint.Y, e_point.Y); |
374 |
rectSize = e_point - s_point; |
375 |
} |
376 |
break; |
377 |
case (ControlType.ArcArrow): |
378 |
{ |
379 |
s_point.X = Math.Min((control as ArcControl).StartPoint.X, (control as ArcControl).EndPoint.X); |
380 |
s_point.X = Math.Min((control as ArcControl).MidPoint.X, s_point.X); |
381 |
s_point.Y = Math.Min((control as ArcControl).StartPoint.Y, (control as ArcControl).EndPoint.Y); |
382 |
s_point.Y = Math.Min((control as ArcControl).MidPoint.Y, s_point.Y); |
383 |
e_point.X = Math.Max((control as ArcControl).StartPoint.X, (control as ArcControl).EndPoint.X); |
384 |
e_point.X = Math.Max((control as ArcControl).MidPoint.X, e_point.X); |
385 |
e_point.Y = Math.Max((control as ArcControl).StartPoint.Y, (control as ArcControl).EndPoint.Y); |
386 |
e_point.Y = Math.Max((control as ArcControl).MidPoint.Y, e_point.Y); |
387 |
rectSize = e_point - s_point; |
388 |
} |
389 |
break; |
390 |
#endregion |
391 |
|
392 |
#region Polygon |
393 |
|
394 |
|
395 |
case (ControlType.Ink): |
396 |
{ |
397 |
s_point.X = Math.Min((control as PolygonControl).StartPoint.X, (control as PolygonControl).EndPoint.X); |
398 |
s_point.Y = Math.Min((control as PolygonControl).StartPoint.Y, (control as PolygonControl).EndPoint.Y); |
399 |
e_point.X = Math.Max((control as PolygonControl).StartPoint.X, (control as PolygonControl).EndPoint.X); |
400 |
e_point.Y = Math.Max((control as PolygonControl).StartPoint.Y, (control as PolygonControl).EndPoint.Y); |
401 |
|
402 |
rectSize = e_point - s_point; |
403 |
} |
404 |
break; |
405 |
|
406 |
case (ControlType.ChainLine): |
407 |
{ |
408 |
//rectSize |
409 |
|
410 |
foreach (Point A in (control as PolygonControl).PointSet) |
411 |
{ |
412 |
if (s_point == new Point()) |
413 |
{ |
414 |
s_point = A; |
415 |
e_point = A; |
416 |
} |
417 |
s_point.X = Math.Min(s_point.X, A.X); |
418 |
s_point.Y = Math.Min(s_point.Y, A.Y); |
419 |
e_point.X = Math.Max(e_point.X, A.X); |
420 |
e_point.Y = Math.Max(e_point.Y, A.Y); |
421 |
} |
422 |
|
423 |
rectSize = e_point - s_point; |
424 |
} |
425 |
break; |
426 |
|
427 |
case (ControlType.PolygonControl): |
428 |
{ |
429 |
//rectSize |
430 |
|
431 |
foreach (Point A in (control as PolygonControl).PointSet) |
432 |
{ |
433 |
if (s_point == new Point()) |
434 |
{ |
435 |
s_point = A; |
436 |
e_point = A; |
437 |
} |
438 |
s_point.X = Math.Min(s_point.X, A.X); |
439 |
s_point.Y = Math.Min(s_point.Y, A.Y); |
440 |
e_point.X = Math.Max(e_point.X, A.X); |
441 |
e_point.Y = Math.Max(e_point.Y, A.Y); |
442 |
} |
443 |
|
444 |
rectSize = e_point - s_point; |
445 |
} |
446 |
break; |
447 |
case (ControlType.PolygonCloud): |
448 |
{ |
449 |
//rectSize |
450 |
|
451 |
foreach (Point A in (control as CloudControl).PointSet) |
452 |
{ |
453 |
if (s_point == new Point()) |
454 |
{ |
455 |
s_point = A; |
456 |
e_point = A; |
457 |
} |
458 |
s_point.X = Math.Min(s_point.X, A.X); |
459 |
s_point.Y = Math.Min(s_point.Y, A.Y); |
460 |
e_point.X = Math.Max(e_point.X, A.X); |
461 |
e_point.Y = Math.Max(e_point.Y, A.Y); |
462 |
} |
463 |
|
464 |
rectSize = e_point - s_point; |
465 |
} |
466 |
break; |
467 |
#endregion |
468 |
|
469 |
#region Text |
470 |
//case (ControlType.TextControl): |
471 |
// { |
472 |
// s_point.X = (control as TextControl).CanvasX; |
473 |
// s_point.Y = (control as TextControl).CanvasY; |
474 |
|
475 |
// e_point.X = s_point.X + (control as TextControl).BoxWidth; |
476 |
// e_point.Y = s_point.Y + (control as TextControl).BoxHeight; |
477 |
|
478 |
// rectSize = e_point - s_point; |
479 |
// } |
480 |
// break; |
481 |
|
482 |
//case (ControlType.TextBorder): |
483 |
// { |
484 |
|
485 |
// s_point.X = (control as TextControl).CanvasX; |
486 |
// s_point.Y = (control as TextControl).CanvasY; |
487 |
|
488 |
// e_point.X = s_point.X + (control as TextControl).BoxWidth; |
489 |
// e_point.Y = s_point.Y + (control as TextControl).BoxHeight; |
490 |
|
491 |
// rectSize = e_point - s_point; |
492 |
// } |
493 |
// break; |
494 |
|
495 |
//case (ControlType.TextCloud): |
496 |
// { |
497 |
|
498 |
// s_point.X = (control as TextControl).CanvasX; |
499 |
// s_point.Y = (control as TextControl).CanvasY; |
500 |
|
501 |
// e_point.X = s_point.X + (control as TextControl).BoxWidth; |
502 |
// e_point.Y = s_point.Y + (control as TextControl).BoxHeight; |
503 |
|
504 |
// rectSize = e_point - s_point; |
505 |
// } |
506 |
// break; |
507 |
#endregion |
508 |
|
509 |
#region ArrowText |
510 |
|
511 |
case (ControlType.ArrowTextControl): |
512 |
{ |
513 |
s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
514 |
s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
515 |
e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
516 |
e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
517 |
rectSize = e_point - s_point; |
518 |
} |
519 |
break; |
520 |
case (ControlType.ArrowTransTextControl): |
521 |
{ |
522 |
s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
523 |
s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
524 |
e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
525 |
e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
526 |
rectSize = e_point - s_point; |
527 |
} |
528 |
break; |
529 |
case (ControlType.ArrowTextBorderControl): |
530 |
{ |
531 |
s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
532 |
s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
533 |
e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
534 |
e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
535 |
rectSize = e_point - s_point; |
536 |
} |
537 |
break; |
538 |
case (ControlType.ArrowTransTextBorderControl): |
539 |
{ |
540 |
s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
541 |
s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
542 |
e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
543 |
e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
544 |
rectSize = e_point - s_point; |
545 |
} |
546 |
break; |
547 |
case (ControlType.ArrowTextCloudControl): |
548 |
{ |
549 |
s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
550 |
s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
551 |
e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
552 |
e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
553 |
rectSize = e_point - s_point; |
554 |
} |
555 |
break; |
556 |
case (ControlType.ArrowTransTextCloudControl): |
557 |
{ |
558 |
s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
559 |
s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
560 |
e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
561 |
e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
562 |
rectSize = e_point - s_point; |
563 |
} |
564 |
break; |
565 |
#endregion |
566 |
|
567 |
#region ETC |
568 |
case (ControlType.Date): |
569 |
{ |
570 |
s_point.X = Math.Min((control as DateControl).StartPoint.X, (control as DateControl).EndPoint.X); |
571 |
s_point.Y = Math.Min((control as DateControl).StartPoint.Y, (control as DateControl).EndPoint.Y); |
572 |
e_point.X = Math.Max((control as DateControl).StartPoint.X, (control as DateControl).EndPoint.X); |
573 |
e_point.Y = Math.Max((control as DateControl).StartPoint.Y, (control as DateControl).EndPoint.Y); |
574 |
rectSize = e_point - s_point; |
575 |
} |
576 |
break; |
577 |
case (ControlType.ImgControl): |
578 |
{ |
579 |
s_point.X = Math.Min((control as ImgControl).StartPoint.X, (control as ImgControl).EndPoint.X); |
580 |
s_point.Y = Math.Min((control as ImgControl).StartPoint.Y, (control as ImgControl).EndPoint.Y); |
581 |
e_point.X = Math.Max((control as ImgControl).StartPoint.X, (control as ImgControl).EndPoint.X); |
582 |
e_point.Y = Math.Max((control as ImgControl).StartPoint.Y, (control as ImgControl).EndPoint.Y); |
583 |
rectSize = e_point - s_point; |
584 |
} |
585 |
break; |
586 |
case (ControlType.Sign): |
587 |
{ |
588 |
s_point.X = Math.Min((control as SignControl).StartPoint.X, (control as SignControl).EndPoint.X); |
589 |
s_point.Y = Math.Min((control as SignControl).StartPoint.Y, (control as SignControl).EndPoint.Y); |
590 |
e_point.X = Math.Max((control as SignControl).StartPoint.X, (control as SignControl).EndPoint.X); |
591 |
e_point.Y = Math.Max((control as SignControl).StartPoint.Y, (control as SignControl).EndPoint.Y); |
592 |
rectSize = e_point - s_point; |
593 |
} |
594 |
break; |
595 |
case (ControlType.Symbol): |
596 |
{ |
597 |
s_point.X = Math.Min((control as SymControl).StartPoint.X, (control as SymControl).EndPoint.X); |
598 |
s_point.Y = Math.Min((control as SymControl).StartPoint.Y, (control as SymControl).EndPoint.Y); |
599 |
e_point.X = Math.Max((control as SymControl).StartPoint.X, (control as SymControl).EndPoint.X); |
600 |
e_point.Y = Math.Max((control as SymControl).StartPoint.Y, (control as SymControl).EndPoint.Y); |
601 |
rectSize = e_point - s_point; |
602 |
} |
603 |
break; |
604 |
case (ControlType.Mark): |
605 |
{ |
606 |
s_point.X = Math.Min((control as RectangleControl).StartPoint.X, (control as RectangleControl).EndPoint.X); |
607 |
s_point.Y = Math.Min((control as RectangleControl).StartPoint.Y, (control as RectangleControl).EndPoint.Y); |
608 |
e_point.X = Math.Max((control as RectangleControl).StartPoint.X, (control as RectangleControl).EndPoint.X); |
609 |
e_point.Y = Math.Max((control as RectangleControl).StartPoint.Y, (control as RectangleControl).EndPoint.Y); |
610 |
rectSize = e_point - s_point; |
611 |
} |
612 |
break; |
613 |
case (ControlType.Stamp): |
614 |
{ |
615 |
s_point.X = Math.Min((control as SymControlN).StartPoint.X, (control as SymControlN).EndPoint.X); |
616 |
s_point.Y = Math.Min((control as SymControlN).StartPoint.Y, (control as SymControlN).EndPoint.Y); |
617 |
e_point.X = Math.Max((control as SymControlN).StartPoint.X, (control as SymControlN).EndPoint.X); |
618 |
e_point.Y = Math.Max((control as SymControlN).StartPoint.Y, (control as SymControlN).EndPoint.Y); |
619 |
rectSize = e_point - s_point; |
620 |
} |
621 |
break; |
622 |
|
623 |
#endregion |
624 |
|
625 |
} |
626 |
itemRect = new Rect(s_point.X, s_point.Y, rectSize.X, rectSize.Y); |
627 |
} |
628 |
|
629 |
public Boolean IsSelectionControl(Geometry OverViewPathData) |
630 |
{ |
631 |
if (DragRect.Contains(itemRect)) |
632 |
return true; |
633 |
else |
634 |
return false; |
635 |
} |
636 |
} |
637 |
} |