CellEventArgs.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. //#########################################################################################
  2. //★★★★★★★ http://www.cnpopsoft.com [华普软件] ★★★★★★★
  3. //★★★★★★★ 华普软件 - VB & C#.NET 专业论文与源码荟萃! ★★★★★★★
  4. //#########################################################################################
  5. /*
  6. * Copyright ?2005, Mathew Hall
  7. * All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without modification,
  10. * are permitted provided that the following conditions are met:
  11. *
  12. * - Redistributions of source code must retain the above copyright notice,
  13. * this list of conditions and the following disclaimer.
  14. *
  15. * - Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  20. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  21. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  22. * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  23. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  24. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  25. * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  26. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  27. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  28. * OF SUCH DAMAGE.
  29. */
  30. using System;
  31. using XPTable.Models;
  32. namespace XPTable.Events
  33. {
  34. #region Delegates
  35. /// <summary>
  36. /// Represents the methods that will handle the PropertyChanged event of a Cell
  37. /// </summary>
  38. public delegate void CellEventHandler(object sender, CellEventArgs e);
  39. #endregion
  40. #region CellEventArgs
  41. /// <summary>
  42. /// Provides data for a Cell's PropertyChanged event
  43. /// </summary>
  44. public class CellEventArgs : CellEventArgsBase
  45. {
  46. #region Class Data
  47. /// <summary>
  48. /// The type of event
  49. /// </summary>
  50. private CellEventType eventType;
  51. /// <summary>
  52. /// The old value of the property
  53. /// </summary>
  54. private object oldValue;
  55. #endregion
  56. #region Constructor
  57. /// <summary>
  58. /// Initializes a new instance of the CellEventArgs class with
  59. /// the specified Cell source and event type
  60. /// </summary>
  61. /// <param name="source">The Cell that Raised the event</param>
  62. /// <param name="eventType">The type of event</param>
  63. /// <param name="oldValue">The old value of the property</param>
  64. public CellEventArgs(Cell source, CellEventType eventType, object oldValue) : this(source, -1, -1, eventType, oldValue)
  65. {
  66. }
  67. /// <summary>
  68. /// Initializes a new instance of the CellEventArgs class with
  69. /// the specified Cell source, column index, row index and event type
  70. /// </summary>
  71. /// <param name="source">The Cell that Raised the event</param>
  72. /// <param name="column">The Column index of the Cell</param>
  73. /// <param name="row">The Row index of the Cell</param>
  74. /// <param name="eventType">The type of event</param>
  75. /// <param name="oldValue">The old value of the property</param>
  76. public CellEventArgs(Cell source, int column, int row, CellEventType eventType, object oldValue) : base(source, column, row)
  77. {
  78. this.eventType = eventType;
  79. this.oldValue = oldValue;
  80. }
  81. #endregion
  82. #region Properties
  83. /// <summary>
  84. /// Gets or sets the type of event
  85. /// </summary>
  86. public CellEventType EventType
  87. {
  88. get
  89. {
  90. return this.eventType;
  91. }
  92. }
  93. /// <summary>
  94. /// Gets the old value of the property
  95. /// </summary>
  96. public object OldValue
  97. {
  98. get
  99. {
  100. return this.oldValue;
  101. }
  102. }
  103. #endregion
  104. }
  105. #endregion
  106. }