markus / KCOM / Events / Move.cs.bak @ 787a4489
이력 | 보기 | 이력해설 | 다운로드 (30.1 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 |
switch ((control as IMarkupCommonData).ControlType) |
237 |
{ |
238 |
#region Shape |
239 |
case (ControlType.Rectangle): |
240 |
{ |
241 |
s_point.X = Math.Min((control as RectangleControl).StartPoint.X, (control as RectangleControl).EndPoint.X); |
242 |
s_point.Y = Math.Min((control as RectangleControl).StartPoint.Y, (control as RectangleControl).EndPoint.Y); |
243 |
e_point.X = Math.Max((control as RectangleControl).StartPoint.X, (control as RectangleControl).EndPoint.X); |
244 |
e_point.Y = Math.Max((control as RectangleControl).StartPoint.Y, (control as RectangleControl).EndPoint.Y); |
245 |
rectSize = e_point - s_point; |
246 |
} |
247 |
break; |
248 |
case (ControlType.Circle): |
249 |
{ |
250 |
s_point.X = Math.Min((control as CircleControl).StartPoint.X, (control as CircleControl).EndPoint.X); |
251 |
s_point.Y = Math.Min((control as CircleControl).StartPoint.Y, (control as CircleControl).EndPoint.Y); |
252 |
e_point.X = Math.Max((control as CircleControl).StartPoint.X, (control as CircleControl).EndPoint.X); |
253 |
e_point.Y = Math.Max((control as CircleControl).StartPoint.Y, (control as CircleControl).EndPoint.Y); |
254 |
rectSize = e_point - s_point; |
255 |
} |
256 |
break; |
257 |
case (ControlType.RectCloud): |
258 |
{ |
259 |
s_point.X = Math.Min((control as RectCloudControl).StartPoint.X, (control as RectCloudControl).EndPoint.X); |
260 |
s_point.Y = Math.Min((control as RectCloudControl).StartPoint.Y, (control as RectCloudControl).EndPoint.Y); |
261 |
e_point.X = Math.Max((control as RectCloudControl).StartPoint.X, (control as RectCloudControl).EndPoint.X); |
262 |
e_point.Y = Math.Max((control as RectCloudControl).StartPoint.Y, (control as RectCloudControl).EndPoint.Y); |
263 |
rectSize = e_point - s_point; |
264 |
} |
265 |
break; |
266 |
case (ControlType.Triangle): |
267 |
{ |
268 |
s_point.X = Math.Min((control as TriControl).StartPoint.X, (control as TriControl).EndPoint.X); |
269 |
s_point.X = Math.Min((control as TriControl).MidPoint.X, s_point.X); |
270 |
s_point.Y = Math.Min((control as TriControl).StartPoint.Y, (control as TriControl).EndPoint.Y); |
271 |
s_point.Y = Math.Min((control as TriControl).MidPoint.Y, s_point.Y); |
272 |
e_point.X = Math.Max((control as TriControl).StartPoint.X, (control as TriControl).EndPoint.X); |
273 |
e_point.X = Math.Max((control as TriControl).MidPoint.X, e_point.X); |
274 |
e_point.Y = Math.Max((control as TriControl).StartPoint.Y, (control as TriControl).EndPoint.Y); |
275 |
e_point.Y = Math.Max((control as TriControl).MidPoint.Y, e_point.Y); |
276 |
rectSize = e_point - s_point; |
277 |
} |
278 |
break; |
279 |
#endregion |
280 |
|
281 |
#region Line |
282 |
case (ControlType.SingleLine): |
283 |
{ |
284 |
s_point.X = Math.Min((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
285 |
s_point.Y = Math.Min((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
286 |
e_point.X = Math.Max((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
287 |
e_point.Y = Math.Max((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
288 |
rectSize = e_point - s_point; |
289 |
} |
290 |
break; |
291 |
case (ControlType.ArrowLine): |
292 |
{ |
293 |
s_point.X = Math.Min((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
294 |
s_point.Y = Math.Min((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
295 |
e_point.X = Math.Max((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
296 |
e_point.Y = Math.Max((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
297 |
rectSize = e_point - s_point; |
298 |
} |
299 |
break; |
300 |
case (ControlType.ArrowMultiLine): |
301 |
{ |
302 |
s_point.X = Math.Min((control as ArrowControl_Multi).StartPoint.X, (control as ArrowControl_Multi).EndPoint.X); |
303 |
s_point.X = Math.Min((control as ArrowControl_Multi).MiddlePoint.X, s_point.X); |
304 |
s_point.Y = Math.Min((control as ArrowControl_Multi).StartPoint.Y, (control as ArrowControl_Multi).EndPoint.Y); |
305 |
s_point.Y = Math.Min((control as ArrowControl_Multi).MiddlePoint.Y, s_point.Y); |
306 |
e_point.X = Math.Max((control as ArrowControl_Multi).StartPoint.X, (control as ArrowControl_Multi).EndPoint.X); |
307 |
e_point.X = Math.Max((control as ArrowControl_Multi).MiddlePoint.X, e_point.X); |
308 |
e_point.Y = Math.Max((control as ArrowControl_Multi).StartPoint.Y, (control as ArrowControl_Multi).EndPoint.Y); |
309 |
e_point.Y = Math.Max((control as ArrowControl_Multi).MiddlePoint.Y, e_point.Y); |
310 |
rectSize = e_point - s_point; |
311 |
} |
312 |
break; |
313 |
case (ControlType.CancelLine): |
314 |
{ |
315 |
s_point.X = Math.Min((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
316 |
s_point.Y = Math.Min((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
317 |
e_point.X = Math.Max((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
318 |
e_point.Y = Math.Max((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
319 |
rectSize = e_point - s_point; |
320 |
} |
321 |
break; |
322 |
case (ControlType.DimLine): |
323 |
{ |
324 |
s_point.X = Math.Min((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
325 |
s_point.Y = Math.Min((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
326 |
e_point.X = Math.Max((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
327 |
e_point.Y = Math.Max((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
328 |
rectSize = e_point - s_point; |
329 |
} |
330 |
break; |
331 |
case (ControlType.TwinLine): |
332 |
{ |
333 |
s_point.X = Math.Min((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
334 |
s_point.Y = Math.Min((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
335 |
e_point.X = Math.Max((control as LineControl).StartPoint.X, (control as LineControl).EndPoint.X); |
336 |
e_point.Y = Math.Max((control as LineControl).StartPoint.Y, (control as LineControl).EndPoint.Y); |
337 |
rectSize = e_point - s_point; |
338 |
} |
339 |
break; |
340 |
case (ControlType.ArcLine): |
341 |
{ |
342 |
s_point.X = Math.Min((control as ArcControl).StartPoint.X, (control as ArcControl).EndPoint.X); |
343 |
s_point.X = Math.Min((control as ArcControl).MidPoint.X, s_point.X); |
344 |
s_point.Y = Math.Min((control as ArcControl).StartPoint.Y, (control as ArcControl).EndPoint.Y); |
345 |
s_point.Y = Math.Min((control as ArcControl).MidPoint.Y, s_point.Y); |
346 |
e_point.X = Math.Max((control as ArcControl).StartPoint.X, (control as ArcControl).EndPoint.X); |
347 |
e_point.X = Math.Max((control as ArcControl).MidPoint.X, e_point.X); |
348 |
e_point.Y = Math.Max((control as ArcControl).StartPoint.Y, (control as ArcControl).EndPoint.Y); |
349 |
e_point.Y = Math.Max((control as ArcControl).MidPoint.Y, e_point.Y); |
350 |
rectSize = e_point - s_point; |
351 |
} |
352 |
break; |
353 |
case (ControlType.ArcArrow): |
354 |
{ |
355 |
s_point.X = Math.Min((control as ArcControl).StartPoint.X, (control as ArcControl).EndPoint.X); |
356 |
s_point.X = Math.Min((control as ArcControl).MidPoint.X, s_point.X); |
357 |
s_point.Y = Math.Min((control as ArcControl).StartPoint.Y, (control as ArcControl).EndPoint.Y); |
358 |
s_point.Y = Math.Min((control as ArcControl).MidPoint.Y, s_point.Y); |
359 |
e_point.X = Math.Max((control as ArcControl).StartPoint.X, (control as ArcControl).EndPoint.X); |
360 |
e_point.X = Math.Max((control as ArcControl).MidPoint.X, e_point.X); |
361 |
e_point.Y = Math.Max((control as ArcControl).StartPoint.Y, (control as ArcControl).EndPoint.Y); |
362 |
e_point.Y = Math.Max((control as ArcControl).MidPoint.Y, e_point.Y); |
363 |
rectSize = e_point - s_point; |
364 |
} |
365 |
break; |
366 |
#endregion |
367 |
|
368 |
#region Polygon |
369 |
|
370 |
case (ControlType.ChainLine): |
371 |
{ |
372 |
//rectSize |
373 |
|
374 |
foreach (Point A in (control as PolygonControl).PointSet) |
375 |
{ |
376 |
if (s_point == new Point()) |
377 |
{ |
378 |
s_point = A; |
379 |
e_point = A; |
380 |
} |
381 |
s_point.X = Math.Min(s_point.X, A.X); |
382 |
s_point.Y = Math.Min(s_point.Y, A.Y); |
383 |
e_point.X = Math.Max(e_point.X, A.X); |
384 |
e_point.Y = Math.Max(e_point.Y, A.Y); |
385 |
} |
386 |
|
387 |
rectSize = e_point - s_point; |
388 |
} |
389 |
break; |
390 |
|
391 |
case (ControlType.PolygonControl): |
392 |
{ |
393 |
//rectSize |
394 |
|
395 |
foreach (Point A in (control as PolygonControl).PointSet) |
396 |
{ |
397 |
if (s_point == new Point()) |
398 |
{ |
399 |
s_point = A; |
400 |
e_point = A; |
401 |
} |
402 |
s_point.X = Math.Min(s_point.X, A.X); |
403 |
s_point.Y = Math.Min(s_point.Y, A.Y); |
404 |
e_point.X = Math.Max(e_point.X, A.X); |
405 |
e_point.Y = Math.Max(e_point.Y, A.Y); |
406 |
} |
407 |
|
408 |
rectSize = e_point - s_point; |
409 |
} |
410 |
break; |
411 |
case (ControlType.PolygonCloud): |
412 |
{ |
413 |
//rectSize |
414 |
|
415 |
foreach (Point A in (control as CloudControl).PointSet) |
416 |
{ |
417 |
if (s_point == new Point()) |
418 |
{ |
419 |
s_point = A; |
420 |
e_point = A; |
421 |
} |
422 |
s_point.X = Math.Min(s_point.X, A.X); |
423 |
s_point.Y = Math.Min(s_point.Y, A.Y); |
424 |
e_point.X = Math.Max(e_point.X, A.X); |
425 |
e_point.Y = Math.Max(e_point.Y, A.Y); |
426 |
} |
427 |
|
428 |
rectSize = e_point - s_point; |
429 |
} |
430 |
break; |
431 |
#endregion |
432 |
|
433 |
#region Text |
434 |
case (ControlType.TextControl): |
435 |
{ |
436 |
s_point.X = (control as TextControl).CanvasX; |
437 |
s_point.Y = (control as TextControl).CanvasY; |
438 |
|
439 |
e_point.X = s_point.X + (control as TextControl).BoxWidth; |
440 |
e_point.Y = s_point.Y + (control as TextControl).BoxHeight; |
441 |
|
442 |
rectSize = e_point - s_point; |
443 |
} |
444 |
break; |
445 |
|
446 |
case (ControlType.TextBorder): |
447 |
{ |
448 |
|
449 |
s_point.X = (control as TextControl).CanvasX; |
450 |
s_point.Y = (control as TextControl).CanvasY; |
451 |
|
452 |
e_point.X = s_point.X + (control as TextControl).BoxWidth; |
453 |
e_point.Y = s_point.Y + (control as TextControl).BoxHeight; |
454 |
|
455 |
rectSize = e_point - s_point; |
456 |
} |
457 |
break; |
458 |
|
459 |
case (ControlType.TextCloud): |
460 |
{ |
461 |
|
462 |
s_point.X = (control as TextControl).CanvasX; |
463 |
s_point.Y = (control as TextControl).CanvasY; |
464 |
|
465 |
e_point.X = s_point.X + (control as TextControl).BoxWidth; |
466 |
e_point.Y = s_point.Y + (control as TextControl).BoxHeight; |
467 |
|
468 |
rectSize = e_point - s_point; |
469 |
} |
470 |
break; |
471 |
#endregion |
472 |
|
473 |
#region ArrowText |
474 |
|
475 |
case (ControlType.ArrowTextControl): |
476 |
{ |
477 |
s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
478 |
s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
479 |
e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
480 |
e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
481 |
rectSize = e_point - s_point; |
482 |
} |
483 |
break; |
484 |
case (ControlType.ArrowTransTextControl): |
485 |
{ |
486 |
s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
487 |
s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
488 |
e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
489 |
e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
490 |
rectSize = e_point - s_point; |
491 |
} |
492 |
break; |
493 |
case (ControlType.ArrowTextBorderControl): |
494 |
{ |
495 |
s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
496 |
s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
497 |
e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
498 |
e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
499 |
rectSize = e_point - s_point; |
500 |
} |
501 |
break; |
502 |
case (ControlType.ArrowTransTextBorderControl): |
503 |
{ |
504 |
s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
505 |
s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
506 |
e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
507 |
e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
508 |
rectSize = e_point - s_point; |
509 |
} |
510 |
break; |
511 |
case (ControlType.ArrowTextCloudControl): |
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.ArrowTransTextCloudControl): |
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 |
#endregion |
530 |
|
531 |
#region ETC |
532 |
case (ControlType.Date): |
533 |
{ |
534 |
s_point.X = Math.Min((control as DateControl).StartPoint.X, (control as DateControl).EndPoint.X); |
535 |
s_point.Y = Math.Min((control as DateControl).StartPoint.Y, (control as DateControl).EndPoint.Y); |
536 |
e_point.X = Math.Max((control as DateControl).StartPoint.X, (control as DateControl).EndPoint.X); |
537 |
e_point.Y = Math.Max((control as DateControl).StartPoint.Y, (control as DateControl).EndPoint.Y); |
538 |
rectSize = e_point - s_point; |
539 |
} |
540 |
break; |
541 |
case (ControlType.ImgControl): |
542 |
{ |
543 |
s_point.X = Math.Min((control as ImgControl).StartPoint.X, (control as ImgControl).EndPoint.X); |
544 |
s_point.Y = Math.Min((control as ImgControl).StartPoint.Y, (control as ImgControl).EndPoint.Y); |
545 |
e_point.X = Math.Max((control as ImgControl).StartPoint.X, (control as ImgControl).EndPoint.X); |
546 |
e_point.Y = Math.Max((control as ImgControl).StartPoint.Y, (control as ImgControl).EndPoint.Y); |
547 |
rectSize = e_point - s_point; |
548 |
} |
549 |
break; |
550 |
case (ControlType.Sign): |
551 |
{ |
552 |
s_point.X = Math.Min((control as SignControl).StartPoint.X, (control as SignControl).EndPoint.X); |
553 |
s_point.Y = Math.Min((control as SignControl).StartPoint.Y, (control as SignControl).EndPoint.Y); |
554 |
e_point.X = Math.Max((control as SignControl).StartPoint.X, (control as SignControl).EndPoint.X); |
555 |
e_point.Y = Math.Max((control as SignControl).StartPoint.Y, (control as SignControl).EndPoint.Y); |
556 |
rectSize = e_point - s_point; |
557 |
} |
558 |
break; |
559 |
case (ControlType.Symbol): |
560 |
{ |
561 |
s_point.X = Math.Min((control as SymControl).StartPoint.X, (control as SymControl).EndPoint.X); |
562 |
s_point.Y = Math.Min((control as SymControl).StartPoint.Y, (control as SymControl).EndPoint.Y); |
563 |
e_point.X = Math.Max((control as SymControl).StartPoint.X, (control as SymControl).EndPoint.X); |
564 |
e_point.Y = Math.Max((control as SymControl).StartPoint.Y, (control as SymControl).EndPoint.Y); |
565 |
rectSize = e_point - s_point; |
566 |
} |
567 |
break; |
568 |
case (ControlType.Mark): |
569 |
{ |
570 |
s_point.X = Math.Min((control as RectangleControl).StartPoint.X, (control as RectangleControl).EndPoint.X); |
571 |
s_point.Y = Math.Min((control as RectangleControl).StartPoint.Y, (control as RectangleControl).EndPoint.Y); |
572 |
e_point.X = Math.Max((control as RectangleControl).StartPoint.X, (control as RectangleControl).EndPoint.X); |
573 |
e_point.Y = Math.Max((control as RectangleControl).StartPoint.Y, (control as RectangleControl).EndPoint.Y); |
574 |
rectSize = e_point - s_point; |
575 |
} |
576 |
break; |
577 |
case (ControlType.Stamp): |
578 |
{ |
579 |
s_point.X = Math.Min((control as SymControlN).StartPoint.X, (control as SymControlN).EndPoint.X); |
580 |
s_point.Y = Math.Min((control as SymControlN).StartPoint.Y, (control as SymControlN).EndPoint.Y); |
581 |
e_point.X = Math.Max((control as SymControlN).StartPoint.X, (control as SymControlN).EndPoint.X); |
582 |
e_point.Y = Math.Max((control as SymControlN).StartPoint.Y, (control as SymControlN).EndPoint.Y); |
583 |
rectSize = e_point - s_point; |
584 |
} |
585 |
break; |
586 |
|
587 |
#endregion |
588 |
|
589 |
} |
590 |
itemRect = new Rect(s_point.X, s_point.Y, rectSize.X, rectSize.Y); |
591 |
} |
592 |
|
593 |
public Boolean IsSelectionControl(Geometry OverViewPathData) |
594 |
{ |
595 |
if (DragRect.Contains(itemRect)) |
596 |
return true; |
597 |
else |
598 |
return false; |
599 |
} |
600 |
} |
601 |
} |