TableCollection.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using FastReport.Utils;
  2. namespace FastReport.Data
  3. {
  4. /// <summary>
  5. /// Represents the collection of <see cref="TableDataSource"/> objects.
  6. /// </summary>
  7. public class TableCollection : FRCollectionBase
  8. {
  9. /// <summary>
  10. /// Gets or sets a data table.
  11. /// </summary>
  12. /// <param name="index">The index of a data table in this collection.</param>
  13. /// <returns>The data table with specified index.</returns>
  14. public TableDataSource this[int index]
  15. {
  16. get { return List[index] as TableDataSource; }
  17. set { List[index] = value; }
  18. }
  19. /// <summary>
  20. /// Sorts tables by their names.
  21. /// </summary>
  22. public void Sort()
  23. {
  24. InnerList.Sort(new DataSourceComparer());
  25. }
  26. /// <summary>
  27. /// Initializes a new instance of the <see cref="TableCollection"/> class with default settings.
  28. /// </summary>
  29. /// <param name="owner">The owner of this collection.</param>
  30. public TableCollection(Base owner) : base(owner)
  31. {
  32. }
  33. }
  34. }