Column.DesignExt.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Windows.Forms;
  5. using System.ComponentModel;
  6. using System.Drawing.Design;
  7. using System.Drawing;
  8. using FastReport.Utils;
  9. using FastReport.TypeEditors;
  10. using FastReport.TypeConverters;
  11. using FastReport.Format;
  12. using FastReport.Controls;
  13. namespace FastReport.Data
  14. {
  15. partial class Column
  16. {
  17. #region Public Methods
  18. /// <inheritdoc/>
  19. public override void Delete()
  20. {
  21. if (Calculated)
  22. Dispose();
  23. else
  24. base.Delete();
  25. }
  26. internal int GetImageIndex()
  27. {
  28. if (Calculated)
  29. return 230;
  30. if (this is DataSourceBase)
  31. return 222;
  32. if (Columns.Count > 0)
  33. return 233;
  34. return DataTreeHelper.GetTypeImageIndex(DataType);
  35. }
  36. internal Type GetBindableControlType()
  37. {
  38. switch (BindableControl)
  39. {
  40. case ColumnBindableControl.Text:
  41. return typeof(TextObject);
  42. case ColumnBindableControl.Picture:
  43. return typeof(PictureObject);
  44. case ColumnBindableControl.CheckBox:
  45. return typeof(CheckBoxObject);
  46. case ColumnBindableControl.RichText:
  47. return typeof(RichObject);
  48. case ColumnBindableControl.Custom:
  49. Type controlType = RegisteredObjects.FindType(CustomBindableControl);
  50. if (controlType == null)
  51. return typeof(TextObject);
  52. return controlType;
  53. }
  54. return null;
  55. }
  56. #endregion
  57. }
  58. }