Пример #1
0
        /// <summary>
        /// Gets an object that consists of the id, calendar name, and account name.
        /// </summary>
        /// <returns> An object containing the user's calendar info. </returns>
        public UserCalendarInfo GetUserCalendarInfo()
        {
            var userCalendar = new UserCalendarInfo();

            userCalendar.Id          = CalendarContract.Calendars.InterfaceConsts.Id;
            userCalendar.DisplayName = CalendarContract.Calendars.InterfaceConsts.CalendarDisplayName;
            userCalendar.AccountName = CalendarContract.Calendars.InterfaceConsts.AccountName;

            return(userCalendar);
        }
Пример #2
0
        /// <summary>
        /// Gets the ICursor for a calendar. Enables read/write access to the database.
        /// </summary>
        /// <param name="uri"> The current Uniform Resource Locator. </param>
        /// <param name="info"> The current user's calendar info. </param>
        /// <returns></returns>
        public ICursor GetCalendarIcursor(Android.Net.Uri uri, UserCalendarInfo info)
        {
            string[] calendarInfo =
            {
                info.Id,
                info.DisplayName,
                info.AccountName
            };

            return(Application.Context.ContentResolver.Query(uri, calendarInfo, null, null, null));
        }