using System; using System.Collections.Generic; using System.Text; using System.Collections; using FastReport.Utils; namespace FastReport.Data { /// /// Represents the collection of objects. /// public class CubeSourceCollection : FRCollectionBase { /// /// Gets or sets a data source. /// /// The index of a data source in this collection. /// The data source with specified index. public CubeSourceBase this[int index] { get { return List[index] as CubeSourceBase; } set { List[index] = value; } } /// /// Finds a CubeSource by its name. /// /// The name of a CubeSource. /// The object if found; otherwise null. public CubeSourceBase FindByName(string name) { foreach (CubeSourceBase c in this) { if (c.Name == name) return c; } return null; } /// /// Finds a CubeSource by its alias. /// /// The alias of a CubeSource. /// The object if found; otherwise null. public CubeSourceBase FindByAlias(string alias) { foreach (CubeSourceBase c in this) { if (c.Alias == alias) return c; } return null; } /// /// Initializes a new instance of the class with default settings. /// /// The owner of this collection. public CubeSourceCollection(Base owner) : base(owner) { } } }