using System.Collections.Generic;
using System.Collections;
namespace umbraco.Linq.Core
{
///
/// Represents a collection within DataProvider of a DocType
///
///
/// Similar to the implementation of ,
/// providing a single collection which represents all instances of the given type within the DataProvider.
///
/// Implementers of this type will need to provide a manner of retrieving the TDocType from the DataProvider
///
/// The type of the DocType.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
public abstract class Tree : IContentTree, IEnumerable, IEnumerable
where TDocType : DocTypeBase, new()
{
#region IContentTree Members
///
/// Gets the Provider associated with this instance
///
/// The provider.
public abstract UmbracoDataProvider Provider { get; protected set; }
///
/// Gets a value indicating whether this instance is read only. The collection is not ReadOnly by default
///
///
/// false to indicate that this collection isn't read-only
///
public virtual bool IsReadOnly
{
get
{
return false;
}
}
public abstract void ReloadCache();
#endregion
#region IEnumerable Members
///
/// Returns an enumerator that iterates through the collection.
///
///
/// A that can be used to iterate through the collection.
///
public abstract IEnumerator GetEnumerator();
#endregion
#region IEnumerable Members
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
#endregion
///
/// Insert an item on submit of the DataContext
///
/// The item.
public abstract void InsertOnSubmit(TDocType item);
///
/// Insert a collection of items on submit of the DataContext
///
/// The items.
public abstract void InsertAllOnSubmit(IEnumerable items);
///
/// Deletes an item on submit of the DataContext
///
/// The itemm.
public abstract void DeleteOnSubmit(TDocType itemm);
///
/// Deletes a collection of items on submit of the DataContext
///
/// The items.
public abstract void DeleteAllOnSubmit(IEnumerable items);
}
}