/// <summary> /// Gets a copy of the Collection containing all changes made to it /// since it was last loaded, or since ItemList.AcceptChanges() /// was called, filtered by itemState. /// </summary> /// <typeparam name="BaseItem"></typeparam> /// <param name="list"></param> /// <param name="itemState"></param> /// <returns></returns> public static CustomList <BaseItem> GetChanges(this CustomList <BaseItem> list, ItemState itemState) { return(list.FindAll(item => item.State.Equals(itemState))); }
/// <summary> /// Gets a copy of the Collection that contains all changes made to /// it since it was loaded or ItemList.AcceptChanges() was last /// called. /// </summary> /// <typeparam name="BaseItem"></typeparam> /// <param name="list"></param> /// <returns></returns> public static CustomList <BaseItem> GetChanges(this CustomList <BaseItem> list) { return(list.FindAll(item => item.IsAdded || item.IsModified || item.IsDeleted)); }
/// <summary> /// Gets a copy of the Collection containing all changes made to it /// since it was last loaded, or since ItemList.AcceptChanges() /// was called, filtered by itemState. /// </summary> /// <typeparam name="List<T>"></typeparam> /// <param name="list"></param> /// <param name="itemState"></param> /// <returns></returns> public static CustomList <T> GetChanges <T>(this CustomList <T> list, ItemState itemState) { return(list.FindAll(PredicateBuilder.Build <T>("item.State == API.DATA;.ItemState." + itemState.ToString() + ""))); }
/// <summary> /// Clones the structure of the ItemList, including all Collection /// schemas and constraints. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="list"></param> /// <returns></returns> public static CustomList <T> Clone <T>(this CustomList <T> list) { return(new CustomList <T>()); }
/// <summary> /// Gets a copy of the Collection that contains all changes made to /// it since it was loaded or ItemList.AcceptChanges() was last /// called. /// </summary> /// <typeparam name="List<T>"></typeparam> /// <param name="list"></param> /// <returns></returns> public static CustomList <T> GetChanges <T>(this CustomList <T> list) { return(list.FindAll(PredicateBuilder.Build <T>("item.IsAdded || item.IsModified || item.IsDeleted"))); }