示例#1
0
        /// <summary>
        /// Gets the ICursor for the users reminders
        /// </summary>
        /// <param name="uri"> The current uniform resource identifier. </param>
        /// <param name="userInfo"> The current user reminder information. </param>
        /// <param name="calId"> The current user's calendar Id. </param>
        /// <returns></returns>
        public ICursor GetReminderICusor(Android.Net.Uri uri, UserReminderInfo userInfo, int calId)
        {
            string[] info =
            {
                userInfo.Id,
                userInfo.EventId,
                userInfo.Title,
                userInfo.StartTime.ToString()
            };

            return(Application.Context.ContentResolver.Query(uri, info, String.Format("calendar_id={0}", calId), null, "dtstart ASC"));
        }
示例#2
0
        /// <summary>
        /// Gets the info for user reminders.
        /// </summary>
        /// <returns></returns>
        public UserReminderInfo GetUserCalendarReminders()
        {
            var userReminders = new UserReminderInfo();

            userReminders.Id      = CalendarContract.Reminders.InterfaceConsts.Id;
            userReminders.EventId = CalendarContract.Reminders.InterfaceConsts.EventId;

            // TODO Set these to try parse methods.
            //userReminders.StartTime = Convert.ToDateTime(CalendarContract.Reminders.InterfaceConsts.Dtstart);
            //userReminders.EndTime = Convert.ToDateTime(CalendarContract.Reminders.InterfaceConsts.Dtend);
            userReminders.Description = CalendarContract.Reminders.InterfaceConsts.Description;
            userReminders.Count       = CalendarContract.Reminders.InterfaceConsts.Count;
            userReminders.Title       = CalendarContract.Reminders.InterfaceConsts.Title;
            userReminders.HasAlarm    = CalendarContract.Reminders.InterfaceConsts.HasAlarm;

            return(userReminders);
        }
示例#3
0
文件: Main.cs 项目: emperorbyl/HMHY
        public static UserReminderInfo addNewReminder(string message, DateTime remindTime, string phoneConnection)
        {
            // Open the connection for the query.
            SQLiteDatabase db    = SQLiteDatabase.OpenDatabase(phoneConnection, null, DatabaseOpenFlags.OpenReadwrite);
            string         query = @"INSERT INTO Reminder
            Values(id, @message, @startTime)";

            // Add the values passed in to a Content Vales
            Android.Content.ContentValues values = new Android.Content.ContentValues(3);
            values.Put("0", "0");
            values.Put("1", message);
            values.Put("2", remindTime.ToString());
            // Execute the query to inset into the phone database.
            db.Insert(query, "id, messageText, reminderTime", values);
            // Create the reminder.
            UserReminderInfo info = new UserReminderInfo();

            info.Title     = message;
            info.StartTime = remindTime;
            info.Id        = "0";
            return(info);
        }