예제 #1
0
        public RecoveryDatabase(RecoveryVersion version)
        {
            _version = version;

            string RecoveryFile = "\\Autorecover_" + _version.ToString() + ".dat";

            AppointmentRecoveryFile = AppointmentDatabase.AppointmentsAppData + RecoveryFile;
            ContactRecoveryFile     = ContactDatabase.ContactsAppData + RecoveryFile;
            TaskRecoveryFile        = TaskDatabase.TasksAppData + RecoveryFile;
        }
예제 #2
0
        public void SetToLastRun()
        {
            if (_version == RecoveryVersion.LastRun)
            {
                return;
            }

            _version = RecoveryVersion.LastRun;

            string lastApptRecovery = AppointmentDatabase.AppointmentsAppData + "\\Autorecover_" + RecoveryVersion.LastRun.ToString() + ".dat";

            if (File.Exists(lastApptRecovery))
            {
                File.Delete(lastApptRecovery);
            }
            if (File.Exists(AppointmentRecoveryFile))
            {
                File.Move(AppointmentRecoveryFile, lastApptRecovery);
            }

            string lastContactRecovery = ContactDatabase.ContactsAppData + "\\Autorecover_" + RecoveryVersion.LastRun.ToString() + ".dat";

            if (File.Exists(lastContactRecovery))
            {
                File.Delete(lastContactRecovery);
            }
            if (File.Exists(ContactRecoveryFile))
            {
                File.Move(ContactRecoveryFile, lastContactRecovery);
            }

            string lastTaskRecovery = TaskDatabase.TasksAppData + "\\Autorecover_" + RecoveryVersion.LastRun.ToString() + ".dat";

            if (File.Exists(lastTaskRecovery))
            {
                File.Delete(lastTaskRecovery);
            }
            if (File.Exists(TaskRecoveryFile))
            {
                File.Move(TaskRecoveryFile, lastTaskRecovery);
            }

            string RecoveryFile = "\\Autorecover_" + _version.ToString() + ".dat";

            AppointmentRecoveryFile = AppointmentDatabase.AppointmentsAppData + RecoveryFile;
            ContactRecoveryFile     = ContactDatabase.ContactsAppData + RecoveryFile;
            TaskRecoveryFile        = TaskDatabase.TasksAppData + RecoveryFile;
        }