예제 #1
0
 public DayStyle(Font font, DayCellStyle inactiveCell, DayCellStyle normalCell, DayCellStyle selectionCell, DayCellStyle activeCell, DayCellStyle todayCell)
 {
     m_dayFont          = font;
     m_dayFontSmall     = new Font(font.FontFamily, font.Size / FONT_SMALL_RATIO);
     m_dayInactiveCell  = inactiveCell;
     m_dayNormalCell    = normalCell;
     m_daySelectionCell = selectionCell;
     m_dayActiveCell    = activeCell;
     m_dayTodayCell     = todayCell;
 }
예제 #2
0
 public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
 {
     if (destinationType == typeof(InstanceDescriptor))
     {
         if (value != null)
         {
             DayCellStyle    d     = (DayCellStyle)value;
             ConstructorInfo cInfo = typeof(DayCellStyle).GetConstructor(new Type[] { typeof(Color), typeof(Color), typeof(Color) });
             return(new InstanceDescriptor(cInfo, new object[] { d.ForeColor, d.BackColor, d.LineColor }, true));
         }
     }
     return(base.ConvertTo(context, culture, value, destinationType));
 }