//===================================================================== /// <summary> /// This loads the time zone information from the registry when the form is loaded and sets the form /// defaults. /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event arguments</param> private void EventRecurTestForm_Load(object sender, EventArgs e) { TimeZoneRegInfo.LoadTimeZoneInfo(); // Load the time zone combo box. The first entry will be for no time zone. cboTimeZone.Items.Add("No time zone"); foreach (VTimeZone vtz in VCalendar.TimeZones) { cboTimeZone.Items.Add(vtz.TimeZoneId.Value); } cboTimeZone.SelectedIndex = 0; DateTime dtDate = new DateTime(DateTime.Today.Year, 1, 1); dtpStartDate.Value = dtDate; dtpEndDate.Value = dtDate.AddMonths(3); txtCalendar.Text = String.Format( "BEGIN:VEVENT\r\n" + "DTSTART:{0}\r\n" + "DTEND:{1}\r\n" + "RRULE:FREQ=DAILY;COUNT=10;INTERVAL=5\r\n" + "END:VEVENT\r\n", dtDate.AddHours(9).ToUniversalTime().ToString(ISO8601Format.BasicDateTimeUniversal), dtDate.AddHours(10).ToUniversalTime().ToString(ISO8601Format.BasicDateTimeUniversal)); }
//===================================================================== /// <summary> /// This loads the time zone information from the registry when the form opens /// </summary> /// <param name="sender">The sender of the event</param> /// <param name="e">The event arguments</param> private void VTimeZoneTestForm_Load(object sender, EventArgs e) { TimeZoneRegInfo.LoadTimeZoneInfo(); // VTimeZoneCollection is bindable. Since they will share the same data source, give each combo box // its own binding context. cboSourceTimeZone.BindingContext = new BindingContext(); cboDestTimeZone.BindingContext = new BindingContext(); // To access a child property, separate the child property name from the parent property name with an // underscore. cboSourceTimeZone.DisplayMember = cboDestTimeZone.DisplayMember = cboSourceTimeZone.ValueMember = cboDestTimeZone.DisplayMember = "TimeZoneId_Value"; cboSourceTimeZone.DataSource = cboDestTimeZone.DataSource = VCalendar.TimeZones; dtpSourceDate.Value = new DateTime(DateTime.Today.Year, 1, 1, 10, 0, 0); UpdateTimes(sender, e); }
//===================================================================== /// <summary> /// Constructor /// </summary> public CalendarBrowserForm() { InitializeComponent(); // The string format to use when drawing the status text sf = new StringFormat(StringFormatFlags.NoWrap); sf.Alignment = StringAlignment.Near; sf.LineAlignment = StringAlignment.Center; sf.Trimming = StringTrimming.EllipsisCharacter; dgvCalendar.AutoGenerateColumns = false; // Load the time zone collection with info from the registry TimeZoneRegInfo.LoadTimeZoneInfo(); vCal = new VCalendar(); LoadComponentList(); LoadGridWithItems(true); }