Exemple #1
0
 public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
 {
     if (destinationType == typeof(InstanceDescriptor))
     {
         if (value != null)
         {
             DayStyle        d     = (DayStyle)value;
             ConstructorInfo cInfo = typeof(DayStyle).GetConstructor(new Type[] {
                 typeof(Font), typeof(DayCellStyle), typeof(DayCellStyle), typeof(DayCellStyle), typeof(DayCellStyle), typeof(DayCellStyle)
             });
             return(new InstanceDescriptor(cInfo, new object[] { d.Font, d.InactiveDay, d.NormalDay, d.SelectionDay, d.ActiveDay, d.TodayDay }, true));
         }
     }
     return(base.ConvertTo(context, culture, value, destinationType));
 }
Exemple #2
0
 public CalendarStyle(Color gridColor, HeaderStyle calendarHeader, HeaderStyle weekHeader, DayStyle dayStyle, MonthText [] monthText, WeekText [] weekText) : this()
 {
     this.GridColor      = gridColor;
     this.CalendarHeader = calendarHeader;
     this.WeekHeader     = weekHeader;
     this.DayStyle       = dayStyle;
     m_monthText         = new MonthTextCollection();
     m_monthText.AddRange(monthText);
     m_weekText = new WeekTextCollection();
     m_weekText.AddRange(weekText);
 }