Exemplo n.º 1
0
        void ICalendarCellStyleProvider.UpdateAppearance(CalendarCellStyle cell)
        {
            MyCustomCellData cellInfo = GetCell(cell.Date);

            if (cellInfo == null)
            {
                return;
            }

            cell.Description = cellInfo.Description;
            if (cell.Description != null)
            {
                cell.DescriptionAppearance      = (AppearanceObject)cell.Appearance.Clone();
                cell.DescriptionAppearance.Font = new Font(cell.Appearance.Font.FontFamily, 7.0f, FontStyle.Bold);
                cell.DescriptionAppearance.TextOptions.WordWrap = WordWrap.Wrap;
            }
            if (!cellInfo.ForeColor.IsEmpty)
            {
                cell.Appearance.ForeColor = cellInfo.ForeColor;
            }
            if (!cellInfo.BackColor.IsEmpty)
            {
                cell.Appearance.BackColor = cellInfo.BackColor;
            }
            if (cellInfo.SpecialDate)
            {
                cell.Appearance.Font = new Font(cell.Appearance.Font.FontFamily, 7.0f, FontStyle.Bold);
            }
        }
Exemplo n.º 2
0
        void Calendar_ContextButtonClick(object sender, ContextItemClickEventArgs e)
        {
            MyCustomCellData data = (MyCustomCellData)e.Item.Tag;

            if (data == null)
            {
                return;
            }
            this.memoEdit1.Text = data.InfoText;
            this.flyoutPanel1.ShowBeakForm(new Point(e.ScreenBounds.X + e.ScreenBounds.Width / 2, e.ScreenBounds.Top - 5));
        }
Exemplo n.º 3
0
        void Calendar_ContextButtonCustomize(object sender, CalendarContextButtonCustomizeEventArgs e)
        {
            PopupCalendarControl popupCalendarControl = (PopupCalendarControl)sender;

            MyCellStyleProvider provider = (MyCellStyleProvider)popupCalendarControl.CellStyleProvider;
            MyCustomCellData    data     = ((MyCellStyleProvider)popupCalendarControl.CellStyleProvider).GetCell(e.Cell.Date);

            if (data == null || string.IsNullOrEmpty(data.InfoText))
            {
                e.Item.Visibility = ContextItemVisibility.Hidden;
                return;
            }
            e.Item.Tag   = data;
            e.Item.Glyph = data.InfoGlyph;
        }