ICellEditor.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 System.Drawing;
  32. using XPTable.Models;
  33. namespace XPTable.Editors
  34. {
  35. /// <summary>
  36. /// Exposes common methods provided by Cell editors
  37. /// </summary>
  38. public interface ICellEditor
  39. {
  40. /// <summary>
  41. /// Prepares the ICellEditor to edit the specified Cell
  42. /// </summary>
  43. /// <param name="cell">The Cell to be edited</param>
  44. /// <param name="table">The Table that contains the Cell</param>
  45. /// <param name="cellPos">A CellPos representing the position of the Cell</param>
  46. /// <param name="cellRect">The Rectangle that represents the Cells location and size</param>
  47. /// <param name="userSetEditorValues">Specifies whether the ICellEditors
  48. /// starting value has already been set by the user</param>
  49. /// <returns>true if the ICellEditor can continue editing the Cell, false otherwise</returns>
  50. bool PrepareForEditing(Cell cell, Table table, CellPos cellPos, Rectangle cellRect, bool userSetEditorValues);
  51. /// <summary>
  52. /// Starts editing the Cell
  53. /// </summary>
  54. void StartEditing();
  55. /// <summary>
  56. /// Stops editing the Cell and commits any changes
  57. /// </summary>
  58. void StopEditing();
  59. /// <summary>
  60. /// Stops editing the Cell and ignores any changes
  61. /// </summary>
  62. void CancelEditing();
  63. }
  64. }