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); }
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) { if (value != null) { HeaderStyle h = (HeaderStyle)value; ConstructorInfo cInfo = typeof(HeaderStyle).GetConstructor(new Type[] { typeof(Font), typeof(Color), typeof(Color), typeof(int) }); return(new InstanceDescriptor(cInfo, new object[] { h.Font, h.ForeColor, h.BackColor, h.Height }, true)); } } return(base.ConvertTo(context, culture, value, destinationType)); }