using System; using System.Collections.Generic; using System.Text; using Csla; using System.Collections; namespace Volian.CSLA.Library { [Serializable] public class VEReadOnlyBase : ReadOnlyBase, IVEReadOnlyItem where T : ReadOnlyBase { #region Generic methods protected int _id = 0; protected string _name = string.Empty; protected IList _children = null; public IList GetChildren() { if (_children == null)LoadChildren(Id); return _children; } public bool GetChildrenLoaded() { return _children != null; } public virtual bool HasChildren() { return true;//Not sure whether to default this to true or false } public int Id { get { return _id; } } public string Name { get { return _name; } } protected override object GetIdValue() { return _id; } #endregion #region Item Specific public override string ToString() { return _name; } protected virtual void LoadChildren(int id) { } #endregion #region Constructors public VEReadOnlyBase() { /* require use of factory methods */ } #endregion } //public class VERODataPath : VEReadOnlyBase //{ // private VERODataPath() : base() { ;} // public VERODataPath(int id, string name) : base(id, name) { ;} //} //public class VEROPlant : VEReadOnlyBase //{ // private VEROPlant() : base() { ;} // public VEROPlant(int id, string name) : base(id, name) { ;} //} }