namespace Inspectron.Settings
{
public abstract class ItemInfo
{
///
/// Constructor for items with no associated images to be drawn
public ItemInfo()
{
CheckBoxEnabled = true;
}
///
/// Gets or sets item's label
/// Default is empty string if item has no label
public string Label
{
get { return m_label; }
set { m_label = value; }
}
///
/// Gets or sets item's description
/// Default is empty string if item has no description
public string Description
{
get { return m_description; }
set { m_description = value; }
}
///
/// Gets or sets whether item should have a check box control
/// Default is false
public bool HasCheck
{
get { return m_hasCheck; }
set { m_hasCheck = value; }
}
///
/// Gets or sets whether check box is enabled
/// Default is true.
/// This property makes sense only if HasCheck is true
public bool CheckBoxEnabled
{
get;
set;
}
///
/// Gets or sets whether item is checked
/// Default is false
public abstract bool Checked
{
get;
set;
}
///
/// Gets or sets whether item is a leaf (has no sub-items)
/// Used by tree controls to inhibit drawing the node expander; default
/// is false
public bool IsLeaf
{
get { return m_isLeaf; }
set { m_isLeaf = value; }
}
///
/// Gets or sets a value indicating whether the label is editable
/// Used by tree controls to inhibit editing the node label; default
/// is true
public bool AllowLabelEdit
{
get { return m_allowLabelEdit; }
set { m_allowLabelEdit = value; }
}
///
/// Gets or sets whether the item is selectable
/// Used by tree controls to inhibit selecting the node; default
/// is true
public bool AllowSelect
{
get { return m_allowSelect; }
set { m_allowSelect = value; }
}
///
/// Gets or sets whether this item is expanded in the view. Set by
/// Control adapters - client code shouldn't set this value.
public bool IsExpandedInView
{
get { return m_isExpandedInView; }
set { m_isExpandedInView = value; }
}
///
/// Gets or sets index of item's image in image list
/// Default is -1 if item has no image.
/// DAN: This is not required by WPF so could be moved to WinFormsItemInfo
public int ImageIndex
{
get { return m_imageIndex; }
set { m_imageIndex = value; }
}
///
/// Gets or sets index of item's "State" image in image list
/// Default is -1 if item has no "State" image.
/// DAN: This is not required by WPF so could be moved to WinFormsItemInfo
public int StateImageIndex
{
get { return m_stateImageIndex; }
set { m_stateImageIndex = value; }
}
///
/// Gets or sets item's properties for lists and tree lists
/// Default is an empty array if item has no properties
public object[] Properties
{
get { return m_properties; }
set { m_properties = value; }
}
///
/// Gets or sets item's mouse hover over text
public string HoverText
{
get { return m_hoverText; }
set { m_hoverText = value; }
}
private string m_label = string.Empty;
private string m_description = string.Empty;
private int m_imageIndex = -1;
private int m_stateImageIndex = -1;
private object[] m_properties = new object[0];
private bool m_hasCheck;
private bool m_isLeaf;
private bool m_allowLabelEdit = true;
private bool m_allowSelect = true;
private bool m_isExpandedInView;
private string m_hoverText = string.Empty;
}
}