2007-11-20 20:12:45 +00:00

94 lines
2.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using Csla;
using Csla.Data;
namespace VEPROMS.CSLA.Library
{
public partial class ContentPart
{
public override string ToString()
{
return string.Format("{0} {1}", MyItem.MyContent.Number, MyItem.MyContent.Text);
}
}
public partial class ItemPart
{
public override string ToString()
{
return string.Format("{0} {1}", _MyContent.Number, MyContent.Text);
}
}
public partial class Part
{
public override string ToString()
{
return string.Format("{0} {1}", MyItem.MyContent.Number, MyItem.MyContent.Text);
}
}
public partial class PartInfo : IVEDrillDownReadOnly
{
public E_FromType PartType
{ get { return (E_FromType)_FromType; } }
public E_FromTypes PartTypes
{ get { return (E_FromTypes)_FromType; } }
public override string ToString()
{
return string.Format("{0}", PartTypes);
}
//public string ToString(string str, System.IFormatProvider ifp)
//{
// return ToString();
//}
#region IVEDrillDownReadOnly
public ItemInfoList _MyItems;
public ItemInfoList MyItems
{ get { return (_MyItems != null? _MyItems : _MyItems = ItemInfoList.GetList(_ItemID,_FromType)); } }
public System.Collections.IList GetChildren()
{
return (_MyItems != null ? _MyItems : _MyItems = ItemInfoList.GetList(_ItemID, _FromType));
}
//public bool ChildrenAreLoaded
//{
// get { return _MyItems == null; }
//}
public bool HasChildren
{
get { return this.MyContent.ContentPartCount > 0; }
}
public IVEDrillDownReadOnly ActiveParent
{
get
{
ContentInfo parentContent = MyContent;
if (parentContent == null || parentContent.ContentItemCount == 0) return null;
return parentContent.ContentItems[0];
}
}
public FormatInfo ActiveFormat
{
get { return ActiveParent.ActiveFormat; }
}
public FormatInfo LocalFormat
{
get { return null; }
}
public DynamicTypeDescriptor MyConfig
{
get { return null; }
}
//public bool HasStandardSteps()
//{ return false; }
#endregion
}
public enum E_FromType : int
{
Procedure = 1, Section = 2, Caution = 3, Note = 4, RNO = 5, Step = 6, Table = 7
}
public enum E_FromTypes : int
{
Procedures = 1, Sections = 2, Cautions = 3, Notes = 4, RNOs = 5, Steps = 6, Tables = 7
}
}