예제 #1
0
 /// <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);
 }
예제 #2
0
 /// <summary>
 /// Create a new instance of field item collection
 /// </summary>
 /// <param name="item">owner of collection</param>
 public FieldItemCollection(DataSourceItem item)
 {
     owner = item;
 }
예제 #3
0
 /// <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);
 }
예제 #4
0
 /// <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);
 }
예제 #5
0
 /// <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);
 }
예제 #6
0
 /// <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);
 }
예제 #7
0
 /// <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;
 }