Beispiel #1
0
        void OnWorkerRestore(object userObject)
        {
            QueuedRestoreInfo restoreInfo = (QueuedRestoreInfo)userObject;

            Log.WriteLine(LogType.TextLogVerbose, "Processing QueuedRestore (" + restoreInfo.mDescriptor.VolumeName + ")");
            if (restoreInfo.mDescriptor.IsAvailable)
            {
                restoreInfo.mDescriptor.Volume.Restore(restoreInfo.mVolumeRevision, restoreInfo.mDiskPath);
            }
        }
Beispiel #2
0
        public void RestoreVolume(VolumeDescriptor vid, VolumeSnapshotRevision revision, string onDiskPath)
        {
            if (vid.ReadyForRestore)
            {
                Log.WriteLine(LogType.TextLogVerbose, "Adding QueuedRestore (" + vid.VolumeName + ")");

                QueuedRestoreInfo restoreInfo = new QueuedRestoreInfo();
                restoreInfo.mDescriptor     = vid;
                restoreInfo.mVolumeRevision = revision;
                restoreInfo.mDiskPath       = onDiskPath;
                mWorkerThread.RegisterOneShotTask(new PWLib.BackgroundWorkerThread.TaskPredicate(OnWorkerPredicate),
                                                  new PWLib.BackgroundWorkerThread.Task(OnWorkerRestore), new PWLib.BackgroundWorkerThread.TaskError(OnWorkerError), restoreInfo);
            }
        }
        public void RestoreVolume( VolumeDescriptor vid, VolumeSnapshotRevision revision, string onDiskPath )
        {
            if ( vid.ReadyForRestore )
            {
                Log.WriteLine( LogType.TextLogVerbose, "Adding QueuedRestore (" + vid.VolumeName + ")" );

                QueuedRestoreInfo restoreInfo = new QueuedRestoreInfo();
                restoreInfo.mDescriptor = vid;
                restoreInfo.mVolumeRevision = revision;
                restoreInfo.mDiskPath = onDiskPath;
                mWorkerThread.RegisterOneShotTask( new PWLib.BackgroundWorkerThread.TaskPredicate( OnWorkerPredicate ),
                    new PWLib.BackgroundWorkerThread.Task( OnWorkerRestore ), new PWLib.BackgroundWorkerThread.TaskError( OnWorkerError ), restoreInfo );
            }
        }