private static Calendar GetCalendar(ICursor cursor)
        {
            var accessLevel = cursor.GetInt(CalendarContract.Calendars.InterfaceConsts.CalendarAccessLevel);
            var accountType = cursor.GetString(CalendarContract.Calendars.InterfaceConsts.AccountType);
            var colorInt    = cursor.GetInt(CalendarContract.Calendars.InterfaceConsts.CalendarColor);
            var colorString = string.Format("#{0:x8}", colorInt);
            var visible     = cursor.GetInt(CalendarContract.Calendars.InterfaceConsts.Visible);

            return(new Calendar
            {
                Name = cursor.GetString(CalendarContract.Calendars.InterfaceConsts.CalendarDisplayName),
                ExternalID = cursor.GetString(CalendarContract.Calendars.InterfaceConsts.Id),
                CanEditCalendar = accountType == CalendarContract.AccountTypeLocal || accountType == AccountType,
                CanEditEvents = IsCalendarWriteable(accessLevel),
                Color = colorString,
                AccountName = cursor.GetString(CalendarContract.Calendars.InterfaceConsts.AccountName),
                AccountType = accountType,
                OwnerAccount = cursor.GetString(CalendarContract.Calendars.InterfaceConsts.OwnerAccount),
                IsPrimary = cursor.GetBoolean(cursor.ColumnCount - 1, true) //ToDo: Hardcoded Col-Index could be quite bad on changes!!!
            });
        }