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