本文整理汇总了C#中CalendarService.GetCalendars方法的典型用法代码示例。如果您正苦于以下问题:C# CalendarService.GetCalendars方法的具体用法?C# CalendarService.GetCalendars怎么用?C# CalendarService.GetCalendars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CalendarService
的用法示例。
在下文中一共展示了CalendarService.GetCalendars方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
// Ensure we have at least one calendar. If not, let's move them back to the calendar and explain that this feature is not yet ready.
var service = new CalendarService();
var calendars = service.GetCalendars();
if(calendars.First().CalendarID == 0)
{
Response.Redirect(URL_CALENDAR + "?status=0");
}
// Ensure that, if we are editing an event, it is the backoffice owner's event.
if(CalendarItemID != 0)
{
if(!service.ValidateCalendarItem(CalendarItemID))
{
Response.Redirect(URL_CALENDARDETAILS + "?id=" + CalendarItemID);
}
}
PopulateCalendarOptions();
PopulateCalendarItemRepeatTypeOptions();
PopulateCalendarItemTypeOptions();
PopulateDefaultFormOptions();
PopulateTimeZones();
PopulateExistingData();
}
}
示例2: PopulateCalendarOptions
private void PopulateCalendarOptions()
{
var service = new CalendarService();
var nodes = service.GetCalendars();
lstCalendar.Items.Clear();
foreach(var node in nodes)
{
var item = new ListItem();
item.Text = node.Description;
item.Value = node.CalendarID.ToString();
lstCalendar.Items.Add(item);
}
}