Пример #1
0
        /// <summary>
        /// Saves Contacts in memory to persistent storage.
        /// </summary>
        protected void SaveContacts(PeriodicAppointment appointment, VariableLengthRecord record)
        {
            Relation1M <Contact> contacts = appointment.GetContacts();

            record.AppendValue(contacts.GetChildCount());   //#4  //might be a 0
            for (int contactIndex = 0; contactIndex < contacts.GetChildCount(); ++contactIndex)
            {
                record.AppendValue(contacts.GetChild(contactIndex).GetObjectId());   //#5 - N
            }
        }
Пример #2
0
        /// <summary>
        /// Saves Reminders in memory to persistent storage.
        /// </summary>
        public override void Save()
        {
            // Step through any previously loaded records and save to file.
            for (int childIndex = 0; childIndex < mReminders.GetChildCount(); ++childIndex)
            {
                Reminder reminder = mReminders.GetChild(childIndex);

                var record = new VariableLengthRecord();
                record.AppendValue(reminder.GetLabel());
                record.AppendValue(reminder.GetDate());
                record.AppendValue(reminder.GetDetails());

                Write(reminder.GetObjectId(), record);
            }
        }
Пример #3
0
        /// <summary>
        /// Saves Contacts in memory to persistent storage.
        /// </summary>
        public override void Save()
        {
            // Step through any previously loaded records and save to file.
            for (int childIndex = 0; childIndex < mContacts.GetChildCount(); ++childIndex)
            {
                Contact contact = mContacts.GetChild(childIndex);

                var      record = new VariableLengthRecord();
                String[] names  = contact.GetName();
                record.AppendValue(names[0]);
                record.AppendValue(names[1]);
                record.AppendValue(contact.GetContactInfo());

                Write(contact.GetObjectId(), record);
            }
        }
Пример #4
0
        /// <summary>
        /// Saves Appointments in memory to persistent storage.
        /// </summary>
        public override void Save()
        {
            // Step through any previously loaded records and save to file.
            for (int childIndex = 0; childIndex < mAppointments.GetChildCount(); ++childIndex)
            {
                Appointment appointment = mAppointments.GetChild(childIndex);

                var record = new VariableLengthRecord();
                record.AppendValue(appointment.GetLabel());           //#1
                record.AppendValue(appointment.GetDetails());         //#2
                record.AppendValue(appointment.GetStartTime());       //#3
                record.AppendValue(appointment.GetDurationMinutes()); //#4

                // Now take care of contacts appointment might be related to
                SaveContacts(appointment, record);

                Write(appointment.GetObjectId(), record);
            }
        }