1 | using System;
|
---|
2 | using System.Drawing;
|
---|
3 | using System.IO;
|
---|
4 | using System.Windows.Forms;
|
---|
5 | namespace Netron.Diagramming.Core {
|
---|
6 | #region PaintStyle EventArgs
|
---|
7 |
|
---|
8 | // ----------------------------------------------------------------------
|
---|
9 | /// <summary>
|
---|
10 | /// Provides information about a PaintStyleChanged event.
|
---|
11 | /// </summary>
|
---|
12 | // ----------------------------------------------------------------------
|
---|
13 | public class PaintStyleChangedEventArgs : EventArgs {
|
---|
14 | IPaintStyle mPaintStyle;
|
---|
15 | FillType mFillType;
|
---|
16 |
|
---|
17 | // ------------------------------------------------------------------
|
---|
18 | /// <summary>
|
---|
19 | /// Gets the paint style that changed.
|
---|
20 | /// </summary>
|
---|
21 | // ------------------------------------------------------------------
|
---|
22 | public IPaintStyle PaintStyle {
|
---|
23 | get {
|
---|
24 | return mPaintStyle;
|
---|
25 | }
|
---|
26 | }
|
---|
27 |
|
---|
28 | // ------------------------------------------------------------------
|
---|
29 | /// <summary>
|
---|
30 | /// Gets the new FillType.
|
---|
31 | /// </summary>
|
---|
32 | // ------------------------------------------------------------------
|
---|
33 | public FillType FillType {
|
---|
34 | get {
|
---|
35 | return mFillType;
|
---|
36 | }
|
---|
37 | }
|
---|
38 |
|
---|
39 | // ------------------------------------------------------------------
|
---|
40 | /// <summary>
|
---|
41 | /// Constructor.
|
---|
42 | /// </summary>
|
---|
43 | /// <param name="paintStyle">IPaintStyle: The IPaintStyle that
|
---|
44 | /// changed.</param>
|
---|
45 | /// <param name="newFillType">FillType: The new fill type.</param>
|
---|
46 | // ------------------------------------------------------------------
|
---|
47 | public PaintStyleChangedEventArgs(
|
---|
48 | IPaintStyle paintStyle,
|
---|
49 | FillType newFillType) {
|
---|
50 | mPaintStyle = paintStyle;
|
---|
51 | mFillType = newFillType;
|
---|
52 | }
|
---|
53 | }
|
---|
54 |
|
---|
55 | #endregion
|
---|
56 |
|
---|
57 | #region TextStyle EventArgs
|
---|
58 |
|
---|
59 | // ----------------------------------------------------------------------
|
---|
60 | /// <summary>
|
---|
61 | /// Provides information about a TextStyleChanged event.
|
---|
62 | /// </summary>
|
---|
63 | // ----------------------------------------------------------------------
|
---|
64 | public class TextStyleChangedEventArgs : EventArgs {
|
---|
65 | ITextStyle mTextStyle;
|
---|
66 |
|
---|
67 | // ------------------------------------------------------------------
|
---|
68 | /// <summary>
|
---|
69 | /// Gets the text style that changed.
|
---|
70 | /// </summary>
|
---|
71 | // ------------------------------------------------------------------
|
---|
72 | public ITextStyle TextStyle {
|
---|
73 | get {
|
---|
74 | return mTextStyle;
|
---|
75 | }
|
---|
76 | }
|
---|
77 |
|
---|
78 | // ------------------------------------------------------------------
|
---|
79 | /// <summary>
|
---|
80 | /// Constructor.
|
---|
81 | /// </summary>
|
---|
82 | /// <param name="textStyle">ITextStyle: The ITextStyle that
|
---|
83 | /// changed.</param>
|
---|
84 | // ------------------------------------------------------------------
|
---|
85 | public TextStyleChangedEventArgs(ITextStyle textStyle) {
|
---|
86 | mTextStyle = textStyle;
|
---|
87 | }
|
---|
88 | }
|
---|
89 |
|
---|
90 | #endregion
|
---|
91 |
|
---|
92 | #region ConnectorAttachmentEventArgs
|
---|
93 | /// <summary>
|
---|
94 | /// Event argument on connecting a connection to a connector
|
---|
95 | /// </summary>
|
---|
96 | public sealed class ConnectorAttachmentEventArgs : EventArgs {
|
---|
97 | /// <summary>
|
---|
98 | /// the child connector
|
---|
99 | /// </summary>
|
---|
100 | IConnector child;
|
---|
101 | /// <summary>
|
---|
102 | /// the parent connector
|
---|
103 | /// </summary>
|
---|
104 | IConnector parent;
|
---|
105 | /// <summary>
|
---|
106 | /// the actual connection
|
---|
107 | /// </summary>
|
---|
108 | IConnection connection;
|
---|
109 |
|
---|
110 |
|
---|
111 | /// <summary>
|
---|
112 | /// Gets the child connector.
|
---|
113 | /// </summary>
|
---|
114 | /// <value>The child.</value>
|
---|
115 | public IConnector Child {
|
---|
116 | get {
|
---|
117 | return child;
|
---|
118 | }
|
---|
119 | }
|
---|
120 |
|
---|
121 | /// <summary>
|
---|
122 | /// Gets the parent connector.
|
---|
123 | /// </summary>
|
---|
124 | /// <value>The parent.</value>
|
---|
125 | public IConnector Parent {
|
---|
126 | get {
|
---|
127 | return parent;
|
---|
128 | }
|
---|
129 | }
|
---|
130 |
|
---|
131 | /// <summary>
|
---|
132 | /// Gets the connection.
|
---|
133 | /// </summary>
|
---|
134 | /// <value>The connection.</value>
|
---|
135 | public IConnection Connection {
|
---|
136 | get {
|
---|
137 | return connection;
|
---|
138 | }
|
---|
139 | }
|
---|
140 |
|
---|
141 | /// <summary>
|
---|
142 | /// Initializes a new instance of the <see cref="T:ConnectorAttachmentEventArgs"/> class.
|
---|
143 | /// </summary>
|
---|
144 | /// <param name="child">The child.</param>
|
---|
145 | /// <param name="parent">The parent.</param>
|
---|
146 | /// <param name="connection">The connection.</param>
|
---|
147 | public ConnectorAttachmentEventArgs(IConnector child, IConnector parent, IConnection connection) {
|
---|
148 | this.child = child;
|
---|
149 | this.parent = parent;
|
---|
150 | this.connection = connection;
|
---|
151 | }
|
---|
152 | }
|
---|
153 | #endregion
|
---|
154 |
|
---|
155 | #region EntityMenuEventArgs
|
---|
156 | /// <summary>
|
---|
157 | /// Event argument on creation of the contextmenu f an entity
|
---|
158 | /// </summary>
|
---|
159 | public sealed class EntityMenuEventArgs : EventArgs {
|
---|
160 | #region Fields
|
---|
161 | /// <summary>
|
---|
162 | /// the entity
|
---|
163 | /// </summary>
|
---|
164 | private IDiagramEntity entity;
|
---|
165 | /// <summary>
|
---|
166 | /// the mouse event argument containing location etc.
|
---|
167 | /// </summary>
|
---|
168 | private MouseEventArgs e;
|
---|
169 | /// <summary>
|
---|
170 | /// the additional menu items to add
|
---|
171 | /// </summary>
|
---|
172 | private ToolStripItem[] additionalItems;
|
---|
173 | #endregion;
|
---|
174 |
|
---|
175 | #region Properties
|
---|
176 | /// <summary>
|
---|
177 | /// Gets the entity.
|
---|
178 | /// </summary>
|
---|
179 | /// <value>The entity.</value>
|
---|
180 | public IDiagramEntity Entity {
|
---|
181 | get {
|
---|
182 | return entity;
|
---|
183 | }
|
---|
184 | }
|
---|
185 |
|
---|
186 | /// <summary>
|
---|
187 | /// Gets the mouse event args.
|
---|
188 | /// </summary>
|
---|
189 | /// <value>The mouse event args.</value>
|
---|
190 | public MouseEventArgs MouseEventArgs {
|
---|
191 | get {
|
---|
192 | return e;
|
---|
193 | }
|
---|
194 | }
|
---|
195 |
|
---|
196 | /// <summary>
|
---|
197 | /// Gets the additional items.
|
---|
198 | /// </summary>
|
---|
199 | /// <value>The additional items.</value>
|
---|
200 | public ToolStripItem[] AdditionalItems {
|
---|
201 | get {
|
---|
202 | return additionalItems;
|
---|
203 | }
|
---|
204 | }
|
---|
205 |
|
---|
206 | #endregion
|
---|
207 |
|
---|
208 | #region Constructor
|
---|
209 | /// <summary>
|
---|
210 | /// Initializes a new instance of the <see cref="T:EntityMenuEventArgs"/> class.
|
---|
211 | /// </summary>
|
---|
212 | /// <param name="entity">The entity.</param>
|
---|
213 | /// <param name="e">The <see cref="T:System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
|
---|
214 | /// <param name="additionalItems">The additional items.</param>
|
---|
215 | public EntityMenuEventArgs(
|
---|
216 | IDiagramEntity entity,
|
---|
217 | MouseEventArgs e,
|
---|
218 | ref ToolStripItem[] additionalItems) {
|
---|
219 | this.entity = entity;
|
---|
220 | this.e = e;
|
---|
221 | this.additionalItems = additionalItems;
|
---|
222 | }
|
---|
223 | #endregion
|
---|
224 |
|
---|
225 | }
|
---|
226 | #endregion
|
---|
227 |
|
---|
228 | #region CursorEventArgs
|
---|
229 | /// <summary>
|
---|
230 | /// Cursor event argument
|
---|
231 | /// </summary>
|
---|
232 | public sealed class CursorEventArgs : EventArgs {
|
---|
233 | /// <summary>
|
---|
234 | /// the Empty argument
|
---|
235 | /// </summary>
|
---|
236 | public static readonly new CursorEventArgs Empty = new CursorEventArgs();
|
---|
237 | /// <summary>
|
---|
238 | /// the Tool field
|
---|
239 | /// </summary>
|
---|
240 | private Cursor mCursor;
|
---|
241 | /// <summary>
|
---|
242 | /// Gets or sets the Cursor
|
---|
243 | /// </summary>
|
---|
244 | public Cursor Cursor {
|
---|
245 | get {
|
---|
246 | return mCursor;
|
---|
247 | }
|
---|
248 | set {
|
---|
249 | mCursor = value;
|
---|
250 | }
|
---|
251 | }
|
---|
252 |
|
---|
253 |
|
---|
254 |
|
---|
255 | #region Constructor
|
---|
256 | ///<summary>
|
---|
257 | ///Default constructor
|
---|
258 | ///</summary>
|
---|
259 | public CursorEventArgs(Cursor cursor) {
|
---|
260 | this.mCursor = cursor;
|
---|
261 | }
|
---|
262 | /// <summary>
|
---|
263 | /// Initializes a new instance of the <see cref="T:CursorEventArgs"/> class.
|
---|
264 | /// </summary>
|
---|
265 | public CursorEventArgs() {
|
---|
266 | }
|
---|
267 | #endregion
|
---|
268 |
|
---|
269 | }
|
---|
270 | #endregion
|
---|
271 |
|
---|
272 |
|
---|
273 | #region CursorEventArgs
|
---|
274 | /// <summary>
|
---|
275 | /// Cursor event argument
|
---|
276 | /// </summary>
|
---|
277 | public sealed class ColorEventArgs : EventArgs {
|
---|
278 | /// <summary>
|
---|
279 | /// the Empty argument
|
---|
280 | /// </summary>
|
---|
281 | public static readonly new CursorEventArgs Empty = new CursorEventArgs();
|
---|
282 | /// <summary>
|
---|
283 | /// the Color field
|
---|
284 | /// </summary>
|
---|
285 | private Color mColor;
|
---|
286 | /// <summary>
|
---|
287 | /// Gets or sets the Color
|
---|
288 | /// </summary>
|
---|
289 | public Color Color {
|
---|
290 | get {
|
---|
291 | return mColor;
|
---|
292 | }
|
---|
293 | set {
|
---|
294 | mColor = value;
|
---|
295 | }
|
---|
296 | }
|
---|
297 |
|
---|
298 | #region Constructor
|
---|
299 | ///<summary>
|
---|
300 | ///Default constructor
|
---|
301 | ///</summary>
|
---|
302 | public ColorEventArgs(Color color) {
|
---|
303 | this.mColor = color;
|
---|
304 | }
|
---|
305 | /// <summary>
|
---|
306 | /// Initializes a new instance of the <see cref="T:CursorEventArgs"/> class.
|
---|
307 | /// </summary>
|
---|
308 | public ColorEventArgs() {
|
---|
309 | }
|
---|
310 | #endregion
|
---|
311 |
|
---|
312 | }
|
---|
313 | #endregion
|
---|
314 |
|
---|
315 | #region PageEventArgs
|
---|
316 |
|
---|
317 | // ----------------------------------------------------------------------
|
---|
318 | /// <summary>
|
---|
319 | /// Provides information about a page event (page added, current page
|
---|
320 | /// changed, etc.).
|
---|
321 | /// </summary>
|
---|
322 | // ----------------------------------------------------------------------
|
---|
323 | public sealed class PageEventArgs : EventArgs {
|
---|
324 | // ------------------------------------------------------------------
|
---|
325 | /// <summary>
|
---|
326 | /// The page.
|
---|
327 | /// </summary>
|
---|
328 | // ------------------------------------------------------------------
|
---|
329 | IPage mPage;
|
---|
330 |
|
---|
331 | // ------------------------------------------------------------------
|
---|
332 | /// <summary>
|
---|
333 | /// Gets the page for the event argument.
|
---|
334 | /// </summary>
|
---|
335 | // ------------------------------------------------------------------
|
---|
336 | public IPage Page {
|
---|
337 | get {
|
---|
338 | return mPage;
|
---|
339 | }
|
---|
340 | }
|
---|
341 |
|
---|
342 | // ------------------------------------------------------------------
|
---|
343 | /// <summary>
|
---|
344 | /// Constructor.
|
---|
345 | /// </summary>
|
---|
346 | /// <param name="page">IPage</param>
|
---|
347 | // ------------------------------------------------------------------
|
---|
348 | public PageEventArgs(IPage page) {
|
---|
349 | mPage = page;
|
---|
350 | }
|
---|
351 | }
|
---|
352 |
|
---|
353 | #endregion
|
---|
354 |
|
---|
355 | #region ToolEventArgs
|
---|
356 | /// <summary>
|
---|
357 | /// Tool event argument
|
---|
358 | /// </summary>
|
---|
359 | public sealed class ToolEventArgs : EventArgs {
|
---|
360 |
|
---|
361 | /// <summary>
|
---|
362 | /// the Tool field
|
---|
363 | /// </summary>
|
---|
364 | private ITool mTool;
|
---|
365 | /// <summary>
|
---|
366 | /// Gets or sets the Properties
|
---|
367 | /// </summary>
|
---|
368 | public ITool Properties {
|
---|
369 | get {
|
---|
370 | return mTool;
|
---|
371 | }
|
---|
372 | set {
|
---|
373 | mTool = value;
|
---|
374 | }
|
---|
375 | }
|
---|
376 | /// <summary>
|
---|
377 | /// The empty argument.
|
---|
378 | /// </summary>
|
---|
379 | public static readonly new ToolEventArgs Empty = new ToolEventArgs();
|
---|
380 |
|
---|
381 | #region Constructor
|
---|
382 | ///<summary>
|
---|
383 | ///Default constructor
|
---|
384 | ///</summary>
|
---|
385 | public ToolEventArgs(ITool tool) {
|
---|
386 | this.mTool = tool;
|
---|
387 | }
|
---|
388 | /// <summary>
|
---|
389 | /// Initializes a new instance of the <see cref="T:ToolEventArgs"/> class.
|
---|
390 | /// </summary>
|
---|
391 | public ToolEventArgs() {
|
---|
392 | }
|
---|
393 | #endregion
|
---|
394 |
|
---|
395 | }
|
---|
396 | #endregion
|
---|
397 |
|
---|
398 | #region PropertiesEventArgs
|
---|
399 | /// <summary>
|
---|
400 | /// Properties event argument
|
---|
401 | /// </summary>
|
---|
402 | public sealed class PropertiesEventArgs : EventArgs {
|
---|
403 |
|
---|
404 | /// <summary>
|
---|
405 | /// the Properties field
|
---|
406 | /// </summary>
|
---|
407 | private Document mProperties;
|
---|
408 | /// <summary>
|
---|
409 | /// Gets or sets the Properties
|
---|
410 | /// </summary>
|
---|
411 | public Document Properties {
|
---|
412 | get {
|
---|
413 | return mProperties;
|
---|
414 | }
|
---|
415 | set {
|
---|
416 | mProperties = value;
|
---|
417 | }
|
---|
418 | }
|
---|
419 | /// <summary>
|
---|
420 | /// The empty argument.
|
---|
421 | /// </summary>
|
---|
422 | public static readonly new PropertiesEventArgs Empty = new PropertiesEventArgs();
|
---|
423 |
|
---|
424 | #region Constructor
|
---|
425 | ///<summary>
|
---|
426 | ///Default constructor
|
---|
427 | ///</summary>
|
---|
428 | public PropertiesEventArgs(Document document) {
|
---|
429 | this.mProperties = document;
|
---|
430 | }
|
---|
431 | /// <summary>
|
---|
432 | /// Initializes a new instance of the <see cref="T:PropertiesEventArgs"/> class.
|
---|
433 | /// </summary>
|
---|
434 | public PropertiesEventArgs() {
|
---|
435 | }
|
---|
436 | #endregion
|
---|
437 |
|
---|
438 | }
|
---|
439 | #endregion
|
---|
440 |
|
---|
441 | #region AmbienceEventArgs
|
---|
442 | /// <summary>
|
---|
443 | /// Ambience event argument
|
---|
444 | /// </summary>
|
---|
445 | public sealed class AmbienceEventArgs : EventArgs {
|
---|
446 |
|
---|
447 |
|
---|
448 | /// <summary>
|
---|
449 | /// the Ambience field
|
---|
450 | /// </summary>
|
---|
451 | private Ambience mAmbience;
|
---|
452 | /// <summary>
|
---|
453 | /// Gets or sets the Ambience
|
---|
454 | /// </summary>
|
---|
455 | public Ambience Ambience {
|
---|
456 | get {
|
---|
457 | return mAmbience;
|
---|
458 | }
|
---|
459 | set {
|
---|
460 | mAmbience = value;
|
---|
461 | }
|
---|
462 | }
|
---|
463 |
|
---|
464 | /// <summary>
|
---|
465 | /// The Empty event argument
|
---|
466 | /// </summary>
|
---|
467 | public static readonly new AmbienceEventArgs Empty = new AmbienceEventArgs();
|
---|
468 |
|
---|
469 |
|
---|
470 | #region Constructor
|
---|
471 | ///<summary>
|
---|
472 | ///Default constructor
|
---|
473 | ///</summary>
|
---|
474 | public AmbienceEventArgs() {
|
---|
475 |
|
---|
476 | }
|
---|
477 | /// <summary>
|
---|
478 | /// Initializes a new instance of the <see cref="T:AmbienceEventArgs"/> class.
|
---|
479 | /// </summary>
|
---|
480 | /// <param name="ambience">The ambience.</param>
|
---|
481 | public AmbienceEventArgs(Ambience ambience) {
|
---|
482 | this.mAmbience = ambience;
|
---|
483 | }
|
---|
484 | #endregion
|
---|
485 |
|
---|
486 | }
|
---|
487 | #endregion
|
---|
488 |
|
---|
489 | #region ConnectionCollectionEventArgs
|
---|
490 | /// <summary>
|
---|
491 | /// ConnectionCollection event argument
|
---|
492 | /// </summary>
|
---|
493 | public sealed class ConnectionCollectionEventArgs : EventArgs {
|
---|
494 |
|
---|
495 | /// <summary>
|
---|
496 | /// the Connection field
|
---|
497 | /// </summary>
|
---|
498 | private IConnection mConnection;
|
---|
499 | /// <summary>
|
---|
500 | /// Gets or sets the Connection
|
---|
501 | /// </summary>
|
---|
502 | public IConnection Connection {
|
---|
503 | get {
|
---|
504 | return mConnection;
|
---|
505 | }
|
---|
506 | set {
|
---|
507 | mConnection = value;
|
---|
508 | }
|
---|
509 | }
|
---|
510 |
|
---|
511 | /// <summary>
|
---|
512 | /// The Empty event argument
|
---|
513 | /// </summary>
|
---|
514 | public static readonly new ConnectionCollectionEventArgs Empty = new ConnectionCollectionEventArgs();
|
---|
515 |
|
---|
516 |
|
---|
517 | #region Constructor
|
---|
518 | ///<summary>
|
---|
519 | ///Default constructor
|
---|
520 | ///</summary>
|
---|
521 | public ConnectionCollectionEventArgs() {
|
---|
522 |
|
---|
523 | }
|
---|
524 | /// <summary>
|
---|
525 | /// Initializes a new instance of the <see cref="T:ConnectionCollectionEventArgs"/> class.
|
---|
526 | /// </summary>
|
---|
527 | /// <param name="connection">The connection.</param>
|
---|
528 | public ConnectionCollectionEventArgs(IConnection connection) {
|
---|
529 | this.mConnection = connection;
|
---|
530 | }
|
---|
531 | #endregion
|
---|
532 |
|
---|
533 | }
|
---|
534 | #endregion
|
---|
535 |
|
---|
536 | #region DiagramInformationEventArgs
|
---|
537 | /// <summary>
|
---|
538 | /// Event argument on passing diagram information (metdata)
|
---|
539 | /// </summary>
|
---|
540 | public sealed class DiagramInformationEventArgs : EventArgs {
|
---|
541 |
|
---|
542 | /// <summary>
|
---|
543 | /// the Information field
|
---|
544 | /// </summary>
|
---|
545 | private DocumentInformation mInformation;
|
---|
546 | /// <summary>
|
---|
547 | /// Gets or sets the Information
|
---|
548 | /// </summary>
|
---|
549 | public DocumentInformation Information {
|
---|
550 | get {
|
---|
551 | return mInformation;
|
---|
552 | }
|
---|
553 | set {
|
---|
554 | mInformation = value;
|
---|
555 | }
|
---|
556 | }
|
---|
557 |
|
---|
558 | #region Constructor
|
---|
559 | ///<summary>
|
---|
560 | ///Default constructor
|
---|
561 | ///</summary>
|
---|
562 | private DiagramInformationEventArgs() {
|
---|
563 |
|
---|
564 | }
|
---|
565 | /// <summary>
|
---|
566 | /// Initializes a new instance of the <see cref="T:DiagramInformationEventArgs"/> class.
|
---|
567 | /// </summary>
|
---|
568 | /// <param name="info">The info.</param>
|
---|
569 | public DiagramInformationEventArgs(DocumentInformation info) {
|
---|
570 | this.mInformation = info;
|
---|
571 | }
|
---|
572 | #endregion
|
---|
573 | /// <summary>
|
---|
574 | /// The Empty event argument
|
---|
575 | /// </summary>
|
---|
576 | public static readonly new DiagramInformationEventArgs Empty = new DiagramInformationEventArgs();
|
---|
577 | }
|
---|
578 | #endregion
|
---|
579 |
|
---|
580 | #region CollectionEventArgs
|
---|
581 | /// <summary>
|
---|
582 | /// Event argument to pass <see cref="CollectionBase"/> information via events
|
---|
583 | /// </summary>
|
---|
584 | /// <typeparam name="T"></typeparam>
|
---|
585 | public class CollectionEventArgs<T> : EventArgs {
|
---|
586 | private T item;
|
---|
587 |
|
---|
588 | /// <summary>
|
---|
589 | /// Gets the item.
|
---|
590 | /// </summary>
|
---|
591 | /// <value>The item.</value>
|
---|
592 | public T Item {
|
---|
593 | get { return item; }
|
---|
594 | }
|
---|
595 | /// <summary>
|
---|
596 | /// Initializes a new instance of the <see cref="T:CollectionEventArgs<T>"/> class.
|
---|
597 | /// </summary>
|
---|
598 | /// <param name="item">A parameter of the generics Type T</param>
|
---|
599 | public CollectionEventArgs(T item) {
|
---|
600 | this.item = item;
|
---|
601 | }
|
---|
602 | }
|
---|
603 | #endregion
|
---|
604 |
|
---|
605 | #region RectangleEventArgs
|
---|
606 | /// <summary>
|
---|
607 | /// Event argument to pass <see cref="Rectangle"/> information via events
|
---|
608 | /// </summary>
|
---|
609 | public sealed class RectangleEventArgs : EventArgs {
|
---|
610 | /// <summary>
|
---|
611 | /// the rectangle
|
---|
612 | /// </summary>
|
---|
613 | private Rectangle mRectangle;
|
---|
614 |
|
---|
615 | /// <summary>
|
---|
616 | /// Gets the rectangle.
|
---|
617 | /// </summary>
|
---|
618 | /// <value>The rectangle.</value>
|
---|
619 | public Rectangle Rectangle {
|
---|
620 | get {
|
---|
621 | return mRectangle;
|
---|
622 | }
|
---|
623 | }
|
---|
624 | /// <summary>
|
---|
625 | /// The Empty event argument
|
---|
626 | /// </summary>
|
---|
627 | public static readonly new RectangleEventArgs Empty = new RectangleEventArgs();
|
---|
628 |
|
---|
629 |
|
---|
630 | #region Constructor
|
---|
631 | ///<summary>
|
---|
632 | ///Default constructor
|
---|
633 | ///</summary>
|
---|
634 | public RectangleEventArgs(Rectangle rectangle) {
|
---|
635 | this.mRectangle = rectangle;
|
---|
636 | }
|
---|
637 | /// <summary>
|
---|
638 | /// Initializes a new instance of the <see cref="T:RectangleEventArgs"/> class.
|
---|
639 | /// </summary>
|
---|
640 | private RectangleEventArgs() {
|
---|
641 | }
|
---|
642 | #endregion
|
---|
643 |
|
---|
644 | }
|
---|
645 | #endregion
|
---|
646 |
|
---|
647 | #region EntityEventArgs
|
---|
648 | /// <summary>
|
---|
649 | /// Event argument carrying an item
|
---|
650 | /// </summary>
|
---|
651 | public sealed class EntityEventArgs : EventArgs {
|
---|
652 | /// <summary>
|
---|
653 | /// Gets or sets the entity
|
---|
654 | /// </summary>
|
---|
655 | IDiagramEntity mEntity;
|
---|
656 |
|
---|
657 | /// <summary>
|
---|
658 | /// Gets or sets the entity.
|
---|
659 | /// </summary>
|
---|
660 | /// <value>The entity.</value>
|
---|
661 | public IDiagramEntity Entity {
|
---|
662 | get {
|
---|
663 | return mEntity;
|
---|
664 | }
|
---|
665 | set {
|
---|
666 | mEntity = value;
|
---|
667 | }
|
---|
668 | }
|
---|
669 | /// <summary>
|
---|
670 | /// Default constructor
|
---|
671 | /// </summary>
|
---|
672 | /// <param name="entity"></param>
|
---|
673 | public EntityEventArgs(IDiagramEntity entity) {
|
---|
674 | this.Entity = entity;
|
---|
675 | }
|
---|
676 | }
|
---|
677 | #endregion
|
---|
678 |
|
---|
679 | #region EntityMouseEventArgs
|
---|
680 | /// <summary>
|
---|
681 | /// MouseEvent argument carrying an item
|
---|
682 | /// </summary>
|
---|
683 | public sealed class EntityMouseEventArgs : MouseEventArgs {
|
---|
684 |
|
---|
685 |
|
---|
686 | /// <summary>
|
---|
687 | /// Gets or sets the entity
|
---|
688 | /// </summary>
|
---|
689 | IDiagramEntity mEntity;
|
---|
690 |
|
---|
691 | /// <summary>
|
---|
692 | /// Gets or sets the entity.
|
---|
693 | /// </summary>
|
---|
694 | /// <value>The entity.</value>
|
---|
695 | public IDiagramEntity Entity {
|
---|
696 | get {
|
---|
697 | return mEntity;
|
---|
698 | }
|
---|
699 | set {
|
---|
700 | mEntity = value;
|
---|
701 | }
|
---|
702 | }
|
---|
703 | /// <summary>
|
---|
704 | /// Default constructor
|
---|
705 | /// </summary>
|
---|
706 | /// <param name="entity">The entity.</param>
|
---|
707 | /// <param name="button">The button.</param>
|
---|
708 | /// <param name="clicks">The clicks.</param>
|
---|
709 | /// <param name="x">The x.</param>
|
---|
710 | /// <param name="y">The y.</param>
|
---|
711 | /// <param name="delta">The delta.</param>
|
---|
712 | public EntityMouseEventArgs(IDiagramEntity entity, MouseButtons button, int clicks, int x, int y, int delta)
|
---|
713 | : base(button, clicks, x, y, delta) {
|
---|
714 | this.mEntity = entity;
|
---|
715 | }
|
---|
716 | /// <summary>
|
---|
717 | /// Initializes a new instance of the <see cref="T:EntityMouseEventArgs"/> class.
|
---|
718 | /// </summary>
|
---|
719 | /// <param name="entity">The entity.</param>
|
---|
720 | /// <param name="e">The <see cref="T:System.Windows.Forms.MouseEventArgs"/> instance containing the event data.</param>
|
---|
721 | public EntityMouseEventArgs(IDiagramEntity entity, MouseEventArgs e)
|
---|
722 | : base(e.Button, e.Clicks, e.X, e.Y, e.Delta) {
|
---|
723 | if (e == null)
|
---|
724 | throw new ArgumentNullException("The argument object is 'null'");
|
---|
725 | this.mEntity = entity;
|
---|
726 | }
|
---|
727 | }
|
---|
728 | #endregion
|
---|
729 |
|
---|
730 | #region StringEventArgs
|
---|
731 | /// <summary>
|
---|
732 | /// Contains a string event argument
|
---|
733 | /// </summary>
|
---|
734 | public sealed class StringEventArgs : EventArgs {
|
---|
735 |
|
---|
736 | string mData;
|
---|
737 | /// <summary>
|
---|
738 | /// Gets or sets the string data
|
---|
739 | /// </summary>
|
---|
740 | public string Data {
|
---|
741 | get {
|
---|
742 | return mData;
|
---|
743 | }
|
---|
744 |
|
---|
745 | }
|
---|
746 | /// <summary>
|
---|
747 | /// Default constructor
|
---|
748 | /// </summary>
|
---|
749 | /// <param name="data"></param>
|
---|
750 | public StringEventArgs(string data) {
|
---|
751 | this.mData = data;
|
---|
752 | }
|
---|
753 | }
|
---|
754 | #endregion
|
---|
755 |
|
---|
756 | #region SingleDataEventArgs
|
---|
757 | /// <summary>
|
---|
758 | /// A single-bucket data transfer event argument
|
---|
759 | /// </summary>
|
---|
760 | /// <typeparam name="T"></typeparam>
|
---|
761 | public sealed class SingleDataEventArgs<T> : EventArgs {
|
---|
762 | /// <summary>
|
---|
763 | /// whatever data
|
---|
764 | /// </summary>
|
---|
765 | T mData;
|
---|
766 |
|
---|
767 | /// <summary>
|
---|
768 | /// Gets the data.
|
---|
769 | /// </summary>
|
---|
770 | /// <value>The data.</value>
|
---|
771 | public T Data {
|
---|
772 | get {
|
---|
773 | return mData;
|
---|
774 | }
|
---|
775 | }
|
---|
776 |
|
---|
777 | /// <summary>
|
---|
778 | /// Initializes a new instance of the <see cref="T:SingleDataEventArgs<T>"/> class.
|
---|
779 | /// </summary>
|
---|
780 | /// <param name="data">A parameter of the generics Type T</param>
|
---|
781 | public SingleDataEventArgs(T data) {
|
---|
782 | //if (data is default(T))
|
---|
783 | // throw new ArgumentNullException("The argument does not contain any data.");
|
---|
784 |
|
---|
785 | this.mData = data;
|
---|
786 | }
|
---|
787 | }
|
---|
788 |
|
---|
789 | #endregion
|
---|
790 |
|
---|
791 | #region HistoryChangeEventArgs
|
---|
792 |
|
---|
793 | /// <summary>
|
---|
794 | /// Event argument to communicate history changes in the undo/redo mechanism
|
---|
795 | /// </summary>
|
---|
796 | public sealed class HistoryChangeEventArgs : EventArgs {
|
---|
797 | /// <summary>
|
---|
798 | /// the RedoText field
|
---|
799 | /// </summary>
|
---|
800 | private string mRedoText;
|
---|
801 | /// <summary>
|
---|
802 | /// Gets or sets the RedoText
|
---|
803 | /// </summary>
|
---|
804 | public string RedoText {
|
---|
805 | get {
|
---|
806 | return mRedoText;
|
---|
807 | }
|
---|
808 | set {
|
---|
809 | mRedoText = value;
|
---|
810 | }
|
---|
811 | }
|
---|
812 |
|
---|
813 | /// <summary>
|
---|
814 | /// the UndoText field
|
---|
815 | /// </summary>
|
---|
816 | private string mUndoText;
|
---|
817 | /// <summary>
|
---|
818 | /// Gets or sets the UndoText
|
---|
819 | /// </summary>
|
---|
820 | public string UndoText {
|
---|
821 | get {
|
---|
822 | return mUndoText;
|
---|
823 | }
|
---|
824 | set {
|
---|
825 | mUndoText = value;
|
---|
826 | }
|
---|
827 | }
|
---|
828 |
|
---|
829 | #region Constructor
|
---|
830 | ///<summary>
|
---|
831 | ///Default constructor
|
---|
832 | ///</summary>
|
---|
833 | public HistoryChangeEventArgs(string redoText, string undoText) {
|
---|
834 | this.mRedoText = redoText;
|
---|
835 | this.mUndoText = undoText;
|
---|
836 | }
|
---|
837 |
|
---|
838 | #endregion
|
---|
839 |
|
---|
840 | }
|
---|
841 | #endregion
|
---|
842 |
|
---|
843 | #region SelectionEventArgs
|
---|
844 | /// <summary>
|
---|
845 | /// Properties event argument
|
---|
846 | /// </summary>
|
---|
847 | public sealed class SelectionEventArgs : EventArgs {
|
---|
848 | /// <summary>
|
---|
849 | /// the Properties field
|
---|
850 | /// </summary>
|
---|
851 | private object[] mObjects;
|
---|
852 | /// <summary>
|
---|
853 | /// Gets or sets the selected objects
|
---|
854 | /// </summary>
|
---|
855 | public object[] SelectedObjects {
|
---|
856 | get {
|
---|
857 | return mObjects;
|
---|
858 | }
|
---|
859 | set {
|
---|
860 | mObjects = value;
|
---|
861 | }
|
---|
862 | }
|
---|
863 | /// <summary>
|
---|
864 | /// The empty argument.
|
---|
865 | /// </summary>
|
---|
866 | public static readonly new PropertiesEventArgs Empty = new PropertiesEventArgs();
|
---|
867 |
|
---|
868 | #region Constructor
|
---|
869 | ///<summary>
|
---|
870 | ///Default constructor
|
---|
871 | ///</summary>
|
---|
872 | public SelectionEventArgs(object[] objects) {
|
---|
873 | this.mObjects = objects;
|
---|
874 | }
|
---|
875 | /// <summary>
|
---|
876 | /// Initializes a new instance of the <see cref="T:SelectionEventArgs"/> class.
|
---|
877 | /// </summary>
|
---|
878 | public SelectionEventArgs() {
|
---|
879 | }
|
---|
880 | #endregion
|
---|
881 |
|
---|
882 | }
|
---|
883 | #endregion
|
---|
884 |
|
---|
885 | #region CancelableEntityEventArgs
|
---|
886 | /// <summary>
|
---|
887 | /// Event argument carrying an item
|
---|
888 | /// </summary>
|
---|
889 | public sealed class CancelableEntityEventArgs : EventArgs {
|
---|
890 |
|
---|
891 | /// <summary>
|
---|
892 | /// the Cancel field
|
---|
893 | /// </summary>
|
---|
894 | private bool mCancel;
|
---|
895 | /// <summary>
|
---|
896 | /// Gets or sets the Cancel
|
---|
897 | /// </summary>
|
---|
898 | public bool Cancel {
|
---|
899 | get {
|
---|
900 | return mCancel;
|
---|
901 | }
|
---|
902 | set {
|
---|
903 | mCancel = value;
|
---|
904 | }
|
---|
905 | }
|
---|
906 |
|
---|
907 |
|
---|
908 | /// <summary>
|
---|
909 | /// Gets or sets the entity
|
---|
910 | /// </summary>
|
---|
911 | IDiagramEntity mEntity;
|
---|
912 |
|
---|
913 | /// <summary>
|
---|
914 | /// Gets or sets the entity.
|
---|
915 | /// </summary>
|
---|
916 | /// <value>The entity.</value>
|
---|
917 | public IDiagramEntity Entity {
|
---|
918 | get {
|
---|
919 | return mEntity;
|
---|
920 | }
|
---|
921 | set {
|
---|
922 | mEntity = value;
|
---|
923 | }
|
---|
924 | }
|
---|
925 | /// <summary>
|
---|
926 | /// Default constructor
|
---|
927 | /// </summary>
|
---|
928 | /// <param name="entity"></param>
|
---|
929 | public CancelableEntityEventArgs(IDiagramEntity entity) {
|
---|
930 | this.Entity = entity;
|
---|
931 | }
|
---|
932 | }
|
---|
933 | #endregion
|
---|
934 |
|
---|
935 | #region FileEventArgs
|
---|
936 | /// <summary>
|
---|
937 | /// Contains a string event argument
|
---|
938 | /// </summary>
|
---|
939 | public sealed class FileEventArgs : EventArgs {
|
---|
940 |
|
---|
941 |
|
---|
942 | /// <summary>
|
---|
943 | /// the File field
|
---|
944 | /// </summary>
|
---|
945 | private FileInfo mFile;
|
---|
946 | /// <summary>
|
---|
947 | /// Gets or sets the file information
|
---|
948 | /// </summary>
|
---|
949 | public FileInfo File {
|
---|
950 | get {
|
---|
951 | return mFile;
|
---|
952 | }
|
---|
953 | }
|
---|
954 |
|
---|
955 | /// <summary>
|
---|
956 | /// Default constructor
|
---|
957 | /// </summary>
|
---|
958 | /// <param name="info">The info.</param>
|
---|
959 | public FileEventArgs(FileInfo info) {
|
---|
960 | this.mFile = info;
|
---|
961 | }
|
---|
962 | }
|
---|
963 | #endregion
|
---|
964 | }
|
---|