#if FRAMEWORK20 using System.Drawing; using System.Windows.Forms; namespace DevComponents.DotNetBar.Schedule { /// /// DayRect array management class /// public class ItemRects { #region Private variables private ItemRect[] _ItemRects; #endregion /// /// Constructor /// /// /// Rectangle array length public ItemRects(BaseItem baseItem, int length) { _ItemRects = new ItemRect[length]; for (int i = 0; i < length; i++) _ItemRects[i] = new ItemRect(baseItem); } #region Public properties /// /// Gets the Rectangle array /// public ItemRect[] Rects { get { return (_ItemRects); } } /// /// Gets and sets a specific array Rectangle /// /// Rectangle index to get /// Rectangle public ItemRect this[int index] { get { return (_ItemRects[index]); } set { _ItemRects[index] = value; } } #endregion } /// /// Simple DayRect class /// public class ItemRect { #region Private variables private BaseItem _BaseItem; // BaseItem private Rectangle _Bounds; // Bounds private bool _IsSelected; // Rect selection #endregion /// /// Constructor /// /// BaseItem public ItemRect(BaseItem baseItem) { _BaseItem = baseItem; } #region Public properties /// /// Gets and sets the bounding rect /// public Rectangle Bounds { get { return (_Bounds); } set { _Bounds = value; } } /// /// Gets and sets the rect selection status /// public bool IsSelected { get { return (_IsSelected); } set { if (_IsSelected != value) { _IsSelected = value; Invalidate(); } } } #endregion #region Public methods /// /// Invalidates the given rectangle /// public void Invalidate() { if (_BaseItem != null) { Control c = (Control)_BaseItem.GetContainerControl(true); if (c != null) c.Invalidate(_Bounds); } } #endregion } } #endif