/// <summary> /// Remove item from collection /// </summary> /// <param name="item">data source item</param> public void Remove(DataSourceItem item) { if (item != null) { item.SetCollection(null); } list.Remove(item); }
/// <summary> /// Create a new instance of field item collection /// </summary> /// <param name="item">owner of collection</param> public FieldItemCollection(DataSourceItem item) { owner = item; }
/// <summary> /// Insert a item into collection /// </summary> /// <param name="index"></param> /// <param name="item"></param> public void Insert(int index, DataSourceItem item) { if (item != null) { item.SetCollection(this); } list.Insert(index, item); }
/// <summary> /// Get index of item in collection /// </summary> /// <param name="item">datasource item</param> /// <returns>index of item</returns> public int IndexOf(DataSourceItem item) { return list.IndexOf(item); }
/// <summary> /// Determines whether collection contains the item /// </summary> /// <param name="item">report item</param> /// <returns>true if collection contains item, otherwise false</returns> public bool Contains(DataSourceItem item) { return list.Contains(item); }
/// <summary> /// Add a datasource item to collection /// </summary> /// <param name="item">datasource item</param> /// <returns>index of item</returns> public int Add(DataSourceItem item) { if (item != null) { item.SetCollection(this); } return list.Add(item); }
/// <summary> /// Create a new copy of datasource item /// </summary> /// <returns>a new copy of datasource item</returns> public DataSourceItem Copy() { DataSourceItem dataSourceItem = new DataSourceItem(); foreach (FieldItem field in this.Fields) { dataSourceItem.Fields.Add(field.Copy()); } dataSourceItem.CaptionStyle = this.CaptionStyle; dataSourceItem.GroupGap = this.GroupGap; dataSourceItem.GroupTotal = this.GroupTotal; return dataSourceItem; }