/// <summary> /// Initializes a new instance of the <see cref="NuGenDateItemCollection"/> class. /// </summary> /// <exception cref="ArgumentNullException"> /// <para><paramref name="owner"/> is <see langword="false"/>.</para> /// </exception> public NuGenDateItemCollection(NuGenCalendar owner) : base() { if (owner == null) { throw new ArgumentNullException("owner"); } _owner = owner; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenSelectedDatesCollection"/> class. /// </summary> /// <exception cref="ArgumentNullException"><para><paramref name="owner"/> is <see langword="null"/>.</para></exception> public NuGenSelectedDatesCollection(NuGenCalendar owner) : base() { if (owner == null) { throw new ArgumentNullException("owner"); } this.owner = owner; }
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(string)) { NuGenCalendar cal = (NuGenCalendar)context.Instance; DateTime date = (DateTime)value; return(date.ToString(cal._dateTimeFormat.ShortDatePattern)); } return(base.ConvertTo(context, culture, value, destinationType)); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenCalendarActionList"/> class. /// </summary> /// <param name="component">A component related to the <see cref="T:System.ComponentModel.Design.DesignerActionList"></see>.</param> public NuGenCalendarActionList(IComponent component) : base(component) { this.calendar = component as NuGenCalendar; // Cache a reference to DesignerActionUIService, so the // DesigneractionList can be refreshed. this.designerActionUISvc = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService; }
/// <summary> /// </summary> protected override object CreateInstance(Type itemType) { object dateItem = base.CreateInstance(itemType); NuGenCalendar originalControl = (NuGenCalendar) m_context.Instance; m_calendar = originalControl; ((NuGenDateItem) dateItem).Date = DateTime.Today; ((NuGenDateItem) dateItem).Calendar = m_calendar; return dateItem; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenWeeknumber"/> class. /// </summary> public NuGenWeeknumber(NuGenCalendar calendar) { m_calendar = calendar; m_backColor1 = Color.White; m_backColor2 = Color.White; m_gradientMode = NuGenGradientMode.None; m_textColor = Color.FromArgb(0, 84, 227); m_borderColor = Color.Black; m_font = new Font("Microsoft Sans Serif", (float)8.25); m_align = NuGenWeeknumberAlign.Top; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenWeekday"/> class. /// </summary> public NuGenWeekday(NuGenCalendar calendar) { m_calendar = calendar; m_backColor1 = Color.White; m_backColor2 = Color.White; m_gradientMode = NuGenGradientMode.None; m_textColor = Color.FromArgb(0, 84, 227); m_font = new Font("Microsoft Sans Serif", (float)8.25); m_dayFormat = NuGenDayFormat.Short; m_align = StringAlignment.Center; m_borderColor = Color.Black; }
/// <summary> /// </summary> protected override object CreateInstance(Type itemType) { object dateItem = base.CreateInstance(itemType); NuGenCalendar originalControl = (NuGenCalendar)m_context.Instance; m_calendar = originalControl; ((NuGenDateItem)dateItem).Date = DateTime.Today; ((NuGenDateItem)dateItem).Calendar = m_calendar; return(dateItem); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenFooter"/> class. /// </summary> public NuGenFooter(NuGenCalendar calendar) { m_calendar = calendar; m_backColor1 = Color.White; m_backColor2 = Color.White; m_gradientMode = NuGenGradientMode.None; m_textColor = Color.Black; m_font = new Font("Microsoft Sans Serif", (float)8.25, FontStyle.Bold); m_format = NuGenTodayFormat.Short; m_text = ""; m_showToday = true; m_align = StringAlignment.Near; }
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { int ret; if (value.GetType() == typeof(string)) { NuGenCalendar m = (NuGenCalendar)context.Instance; ret = m.DayNumber(value.ToString()); if ((ret >= 0) && (ret <= 7)) { return(ret); } } return(base.ConvertFrom(context, culture, value)); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenHeader"/> class. /// </summary> /// <param name="calendar"></param> /// <param name="serviceProvider"> /// <para>Requires:</para> /// <para><see cref="INuGenCalendarRenderer"/></para> /// </param> /// <exception cref="ArgumentNullException"> /// <para> /// <paramref name="calendar"/> is <see langword="null"/>. /// </para> /// -or- /// <para> /// <paramref name="serviceProvider"/> is <see langword="null"/>. /// </para> /// </exception> public NuGenHeader(NuGenCalendar calendar, INuGenServiceProvider serviceProvider) { if (calendar == null) { throw new ArgumentNullException("calendar"); } if (serviceProvider == null) { throw new ArgumentNullException("serviceProvider"); } _calendar = calendar; _serviceProvider = serviceProvider; _backColor1 = Color.FromArgb(0, 84, 227); _backColor2 = Color.White; _gradientMode = NuGenGradientMode.None; _textColor = Color.White; _font = new Font("Microsoft Sans Serif", (float)8.25, FontStyle.Bold); _showMonth = true; _monthSelector = true; _text = ""; _contextMenu = true; _align = StringAlignment.Center; _prevBtnState = HeaderButtonState.Normal; _nextBtnState = HeaderButtonState.Normal; _prevYearBtnState = HeaderButtonState.Normal; _nextYearBtnState = HeaderButtonState.Normal; // create monthContext menu and setup event handlers for (int k = 0; k < 12; k++) { _monthMenu.MenuItems.Add(_monthMenu.MenuItems.Count, new MenuItem("")); _monthMenu.MenuItems[_monthMenu.MenuItems.Count - 1].Click += new EventHandler(MonthContextMenu_Click); } Setup(); }
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { if (value.GetType() == typeof(string)) { // Parse property string string[] ss = value.ToString().Split(new char[] { ';' }, 2); if (ss.Length == 2) { // Create new ActiveMonth NuGenActiveMonth item; NuGenCalendar m = (NuGenCalendar)context.Instance; item = m.ActiveMonth; // Set properties item.Month = item.Calendar.MonthNumber(ss[0]); if (item.Calendar.IsYearValid(ss[1].Trim())) { item.Year = Convert.ToInt32(ss[1].Trim()); return(item); } } } return(base.ConvertFrom(context, culture, value)); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenActiveMonth"/> class. /// </summary> public NuGenActiveMonth(NuGenCalendar calendar) { m_calendar = calendar; m_year = DateTime.Now.Year; m_month = DateTime.Now.Month; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenSelectedDatesCollection"/> class. /// </summary> /// <exception cref="ArgumentNullException"><para><paramref name="owner"/> is <see langword="null"/>.</para></exception> public NuGenSelectedDatesCollection(NuGenCalendar owner, NuGenSelectedDatesCollection dates) : this(owner) { this.Add(dates); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenMonth"/> class. /// </summary> public NuGenMonth(NuGenCalendar calendar) { m_calendar = calendar; m_dateFont = new Font("Microsoft Sans Serif", (float)8.25); m_textFont = new Font("Microsoft Sans Serif", (float)8.25); m_dayInFocus = -1; m_selArea.Clear(); m_formatTrailing = true; m_imageAlign = ContentAlignment.TopLeft; m_dateAlign = ContentAlignment.MiddleCenter; m_textAlign = ContentAlignment.BottomLeft; m_imageClick = false; // we need 42 (7 * 6) days for display m_days = new Day[42]; for (int i = 0; i < 42; i++) { m_days[i] = new Day(); m_days[i].Month = this; m_days[i].Calendar = m_calendar; } m_colors = new MonthColors(this); m_borderStyles = new MonthBorderStyles(this); m_padding = new MonthPadding(this); m_transparency = new TransparencyCollection(this); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenDateItemCollection"/> class. /// </summary> /// <exception cref="ArgumentNullException"> /// <para><paramref name="owner"/> is <see langword="null"/>.</para> /// -or- /// <para><paramref name="dateItems"/> is <see langword="null"/>.</para> /// </exception> public NuGenDateItemCollection(NuGenCalendar owner, NuGenDateItemCollection dateItems) : this(owner) { this.Add(dateItems); }
GetStandardValues(ITypeDescriptorContext context) { NuGenCalendar m = (NuGenCalendar)context.Instance; return(new StandardValuesCollection(m.DayNames())); }