markus / KCOM / Events / Move.cs @ 787a4489
이력 | 보기 | 이력해설 | 다운로드 (30.7 KB)
1 | 787a4489 | KangIngu | 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 | |||
371 | case (ControlType.Ink): |
||
372 | { |
||
373 | s_point.X = Math.Min((control as PolygonControl).StartPoint.X, (control as PolygonControl).EndPoint.X); |
||
374 | s_point.Y = Math.Min((control as PolygonControl).StartPoint.Y, (control as PolygonControl).EndPoint.Y); |
||
375 | e_point.X = Math.Max((control as PolygonControl).StartPoint.X, (control as PolygonControl).EndPoint.X); |
||
376 | e_point.Y = Math.Max((control as PolygonControl).StartPoint.Y, (control as PolygonControl).EndPoint.Y); |
||
377 | |||
378 | rectSize = e_point - s_point; |
||
379 | } |
||
380 | break; |
||
381 | |||
382 | case (ControlType.ChainLine): |
||
383 | { |
||
384 | //rectSize |
||
385 | |||
386 | foreach (Point A in (control as PolygonControl).PointSet) |
||
387 | { |
||
388 | if (s_point == new Point()) |
||
389 | { |
||
390 | s_point = A; |
||
391 | e_point = A; |
||
392 | } |
||
393 | s_point.X = Math.Min(s_point.X, A.X); |
||
394 | s_point.Y = Math.Min(s_point.Y, A.Y); |
||
395 | e_point.X = Math.Max(e_point.X, A.X); |
||
396 | e_point.Y = Math.Max(e_point.Y, A.Y); |
||
397 | } |
||
398 | |||
399 | rectSize = e_point - s_point; |
||
400 | } |
||
401 | break; |
||
402 | |||
403 | case (ControlType.PolygonControl): |
||
404 | { |
||
405 | //rectSize |
||
406 | |||
407 | foreach (Point A in (control as PolygonControl).PointSet) |
||
408 | { |
||
409 | if (s_point == new Point()) |
||
410 | { |
||
411 | s_point = A; |
||
412 | e_point = A; |
||
413 | } |
||
414 | s_point.X = Math.Min(s_point.X, A.X); |
||
415 | s_point.Y = Math.Min(s_point.Y, A.Y); |
||
416 | e_point.X = Math.Max(e_point.X, A.X); |
||
417 | e_point.Y = Math.Max(e_point.Y, A.Y); |
||
418 | } |
||
419 | |||
420 | rectSize = e_point - s_point; |
||
421 | } |
||
422 | break; |
||
423 | case (ControlType.PolygonCloud): |
||
424 | { |
||
425 | //rectSize |
||
426 | |||
427 | foreach (Point A in (control as CloudControl).PointSet) |
||
428 | { |
||
429 | if (s_point == new Point()) |
||
430 | { |
||
431 | s_point = A; |
||
432 | e_point = A; |
||
433 | } |
||
434 | s_point.X = Math.Min(s_point.X, A.X); |
||
435 | s_point.Y = Math.Min(s_point.Y, A.Y); |
||
436 | e_point.X = Math.Max(e_point.X, A.X); |
||
437 | e_point.Y = Math.Max(e_point.Y, A.Y); |
||
438 | } |
||
439 | |||
440 | rectSize = e_point - s_point; |
||
441 | } |
||
442 | break; |
||
443 | #endregion |
||
444 | |||
445 | #region Text |
||
446 | case (ControlType.TextControl): |
||
447 | { |
||
448 | s_point.X = (control as TextControl).CanvasX; |
||
449 | s_point.Y = (control as TextControl).CanvasY; |
||
450 | |||
451 | e_point.X = s_point.X + (control as TextControl).BoxWidth; |
||
452 | e_point.Y = s_point.Y + (control as TextControl).BoxHeight; |
||
453 | |||
454 | rectSize = e_point - s_point; |
||
455 | } |
||
456 | break; |
||
457 | |||
458 | case (ControlType.TextBorder): |
||
459 | { |
||
460 | |||
461 | s_point.X = (control as TextControl).CanvasX; |
||
462 | s_point.Y = (control as TextControl).CanvasY; |
||
463 | |||
464 | e_point.X = s_point.X + (control as TextControl).BoxWidth; |
||
465 | e_point.Y = s_point.Y + (control as TextControl).BoxHeight; |
||
466 | |||
467 | rectSize = e_point - s_point; |
||
468 | } |
||
469 | break; |
||
470 | |||
471 | case (ControlType.TextCloud): |
||
472 | { |
||
473 | |||
474 | s_point.X = (control as TextControl).CanvasX; |
||
475 | s_point.Y = (control as TextControl).CanvasY; |
||
476 | |||
477 | e_point.X = s_point.X + (control as TextControl).BoxWidth; |
||
478 | e_point.Y = s_point.Y + (control as TextControl).BoxHeight; |
||
479 | |||
480 | rectSize = e_point - s_point; |
||
481 | } |
||
482 | break; |
||
483 | #endregion |
||
484 | |||
485 | #region ArrowText |
||
486 | |||
487 | case (ControlType.ArrowTextControl): |
||
488 | { |
||
489 | s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
490 | s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
491 | e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
492 | e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
493 | rectSize = e_point - s_point; |
||
494 | } |
||
495 | break; |
||
496 | case (ControlType.ArrowTransTextControl): |
||
497 | { |
||
498 | s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
499 | s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
500 | e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
501 | e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
502 | rectSize = e_point - s_point; |
||
503 | } |
||
504 | break; |
||
505 | case (ControlType.ArrowTextBorderControl): |
||
506 | { |
||
507 | s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
508 | s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
509 | e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
510 | e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
511 | rectSize = e_point - s_point; |
||
512 | } |
||
513 | break; |
||
514 | case (ControlType.ArrowTransTextBorderControl): |
||
515 | { |
||
516 | s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
517 | s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
518 | e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
519 | e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
520 | rectSize = e_point - s_point; |
||
521 | } |
||
522 | break; |
||
523 | case (ControlType.ArrowTextCloudControl): |
||
524 | { |
||
525 | s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
526 | s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
527 | e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
528 | e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
529 | rectSize = e_point - s_point; |
||
530 | } |
||
531 | break; |
||
532 | case (ControlType.ArrowTransTextCloudControl): |
||
533 | { |
||
534 | s_point.X = Math.Min((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
535 | s_point.Y = Math.Min((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
536 | e_point.X = Math.Max((control as ArrowTextControl).StartPoint.X, (control as ArrowTextControl).EndPoint.X); |
||
537 | e_point.Y = Math.Max((control as ArrowTextControl).StartPoint.Y, (control as ArrowTextControl).EndPoint.Y); |
||
538 | rectSize = e_point - s_point; |
||
539 | } |
||
540 | break; |
||
541 | #endregion |
||
542 | |||
543 | #region ETC |
||
544 | case (ControlType.Date): |
||
545 | { |
||
546 | s_point.X = Math.Min((control as DateControl).StartPoint.X, (control as DateControl).EndPoint.X); |
||
547 | s_point.Y = Math.Min((control as DateControl).StartPoint.Y, (control as DateControl).EndPoint.Y); |
||
548 | e_point.X = Math.Max((control as DateControl).StartPoint.X, (control as DateControl).EndPoint.X); |
||
549 | e_point.Y = Math.Max((control as DateControl).StartPoint.Y, (control as DateControl).EndPoint.Y); |
||
550 | rectSize = e_point - s_point; |
||
551 | } |
||
552 | break; |
||
553 | case (ControlType.ImgControl): |
||
554 | { |
||
555 | s_point.X = Math.Min((control as ImgControl).StartPoint.X, (control as ImgControl).EndPoint.X); |
||
556 | s_point.Y = Math.Min((control as ImgControl).StartPoint.Y, (control as ImgControl).EndPoint.Y); |
||
557 | e_point.X = Math.Max((control as ImgControl).StartPoint.X, (control as ImgControl).EndPoint.X); |
||
558 | e_point.Y = Math.Max((control as ImgControl).StartPoint.Y, (control as ImgControl).EndPoint.Y); |
||
559 | rectSize = e_point - s_point; |
||
560 | } |
||
561 | break; |
||
562 | case (ControlType.Sign): |
||
563 | { |
||
564 | s_point.X = Math.Min((control as SignControl).StartPoint.X, (control as SignControl).EndPoint.X); |
||
565 | s_point.Y = Math.Min((control as SignControl).StartPoint.Y, (control as SignControl).EndPoint.Y); |
||
566 | e_point.X = Math.Max((control as SignControl).StartPoint.X, (control as SignControl).EndPoint.X); |
||
567 | e_point.Y = Math.Max((control as SignControl).StartPoint.Y, (control as SignControl).EndPoint.Y); |
||
568 | rectSize = e_point - s_point; |
||
569 | } |
||
570 | break; |
||
571 | case (ControlType.Symbol): |
||
572 | { |
||
573 | s_point.X = Math.Min((control as SymControl).StartPoint.X, (control as SymControl).EndPoint.X); |
||
574 | s_point.Y = Math.Min((control as SymControl).StartPoint.Y, (control as SymControl).EndPoint.Y); |
||
575 | e_point.X = Math.Max((control as SymControl).StartPoint.X, (control as SymControl).EndPoint.X); |
||
576 | e_point.Y = Math.Max((control as SymControl).StartPoint.Y, (control as SymControl).EndPoint.Y); |
||
577 | rectSize = e_point - s_point; |
||
578 | } |
||
579 | break; |
||
580 | case (ControlType.Mark): |
||
581 | { |
||
582 | s_point.X = Math.Min((control as RectangleControl).StartPoint.X, (control as RectangleControl).EndPoint.X); |
||
583 | s_point.Y = Math.Min((control as RectangleControl).StartPoint.Y, (control as RectangleControl).EndPoint.Y); |
||
584 | e_point.X = Math.Max((control as RectangleControl).StartPoint.X, (control as RectangleControl).EndPoint.X); |
||
585 | e_point.Y = Math.Max((control as RectangleControl).StartPoint.Y, (control as RectangleControl).EndPoint.Y); |
||
586 | rectSize = e_point - s_point; |
||
587 | } |
||
588 | break; |
||
589 | case (ControlType.Stamp): |
||
590 | { |
||
591 | s_point.X = Math.Min((control as SymControlN).StartPoint.X, (control as SymControlN).EndPoint.X); |
||
592 | s_point.Y = Math.Min((control as SymControlN).StartPoint.Y, (control as SymControlN).EndPoint.Y); |
||
593 | e_point.X = Math.Max((control as SymControlN).StartPoint.X, (control as SymControlN).EndPoint.X); |
||
594 | e_point.Y = Math.Max((control as SymControlN).StartPoint.Y, (control as SymControlN).EndPoint.Y); |
||
595 | rectSize = e_point - s_point; |
||
596 | } |
||
597 | break; |
||
598 | |||
599 | #endregion |
||
600 | |||
601 | } |
||
602 | itemRect = new Rect(s_point.X, s_point.Y, rectSize.X, rectSize.Y); |
||
603 | } |
||
604 | |||
605 | public Boolean IsSelectionControl(Geometry OverViewPathData) |
||
606 | { |
||
607 | if (DragRect.Contains(itemRect)) |
||
608 | return true; |
||
609 | else |
||
610 | return false; |
||
611 | } |
||
612 | } |
||
613 | } |