Beispiel #1
0
 public Volume(VolumeEventController eventController, VolumeDescriptor volumeDesc, XmlNode parentNode)
 {
     mEventController     = eventController;
     mVolumeDesc          = volumeDesc;
     mBackupRestoreObject = new BackupRestoreVolume(parentNode);
     Init();
 }
Beispiel #2
0
 public Volume( VolumeEventController eventController, VolumeDescriptor volumeDesc, VolumeSource source, BaseArchive archive )
 {
     mEventController = eventController;
     mVolumeDesc = volumeDesc;
     mBackupRestoreObject = new BackupRestoreVolume( mVolumeDesc.VolumeName, source, archive );
     Init();
 }
Beispiel #3
0
 public Volume( VolumeEventController eventController, VolumeDescriptor volumeDesc, XmlNode parentNode )
 {
     mEventController = eventController;
     mVolumeDesc = volumeDesc;
     mBackupRestoreObject = new BackupRestoreVolume( parentNode );
     Init();
 }
Beispiel #4
0
 public Volume(VolumeEventController eventController, VolumeDescriptor volumeDesc, VolumeSource source, BaseArchive archive)
 {
     mEventController     = eventController;
     mVolumeDesc          = volumeDesc;
     mBackupRestoreObject = new BackupRestoreVolume(mVolumeDesc.VolumeName, source, archive);
     Init();
 }
 public void InvokeVolumeDescriptorActiveStateChanged(VolumeDescriptor volume, bool isActive)
 {
     if (VolumeDescriptorActiveStateChanged != null)
     {
         VolumeDescriptorActiveStateChanged(volume, isActive);
     }
 }
Beispiel #6
0
 public void RemoveVolume( VolumeDescriptor desc, bool removeAllData )
 {
     if ( removeAllData && desc.IsAvailable )
     {
         desc.Volume.DeleteAllRevisions();
     }
     VolumeDescriptorList.Instance.RemoveDescriptor( desc );
 }
Beispiel #7
0
 void mVolumeEventController_VolumeDescriptorActiveStateChanged(VolumeDescriptor desc, bool isActive)
 {
     if (desc.ReadyForBackup)
     {
         Log.WriteLine(LogType.TextLogVerbose, "Backing up volume as the descriptor (.vol) file state has recently changed");
         ForceBackup(desc.Volume);
     }
 }
Beispiel #8
0
 public void RemoveVolume(VolumeDescriptor desc, bool removeAllData)
 {
     if (removeAllData && desc.IsAvailable)
     {
         desc.Volume.DeleteAllRevisions();
     }
     VolumeDescriptorList.Instance.RemoveDescriptor(desc);
 }
Beispiel #9
0
        public void RemoveVolume(VolumeDescriptor desc, bool removeAllData)
        {
            QueuedRemoveInfo removeInfo = new QueuedRemoveInfo();

            removeInfo.mDescriptor    = desc;
            removeInfo.mDeleteAllData = removeAllData;
            mWorkerThread.RegisterOneShotTask(new PWLib.BackgroundWorkerThread.TaskPredicate(OnWorkerPredicate),
                                              new PWLib.BackgroundWorkerThread.Task(OnWorkerRemove), new PWLib.BackgroundWorkerThread.TaskError(OnWorkerError), removeInfo);
        }
Beispiel #10
0
        public void TransferVolume(VolumeDescriptor vid, PWLib.UsbDrive.UsbDriveInfo newDrive)
        {
            QueuedTransferInfo transferInfo = new QueuedTransferInfo();

            transferInfo.mDescriptor = vid;
            transferInfo.mNewDrive   = newDrive;
            mWorkerThread.RegisterOneShotTask(new PWLib.BackgroundWorkerThread.TaskPredicate(OnWorkerPredicate),
                                              new PWLib.BackgroundWorkerThread.Task(OnWorkerTransfer), new PWLib.BackgroundWorkerThread.TaskError(OnWorkerError), transferInfo);
        }
 public VolumeDescriptor AddNewDescriptor( string volName, string volFilename, VolumeSource source, BaseArchive archive )
 {
     VolumeDescriptor vd = new VolumeDescriptor( mEventController, volName, volFilename, source, archive );
     lock ( mDescriptorList )
     {
         mDescriptorList.Add( vd );
     }
     Config.Active.Save();
     return vd;
 }
 public void RemoveDescriptor(VolumeDescriptor vd)
 {
     lock ( mDescriptorList )
     {
         if (mDescriptorList.Contains(vd))
         {
             mDescriptorList.Remove(vd);
         }
     }
 }
        public VolumeDescriptor LoadDescriptor(string volName, string volFilename)
        {
            VolumeDescriptor vd = VolumeDescriptor.LoadFromXml(mEventController, volName, volFilename);

            lock ( mDescriptorList )
            {
                mDescriptorList.Add(vd);
            }
            return(vd);
        }
        public VolumeDescriptor AddNewDescriptor(string volName, string volFilename, VolumeSource source, BaseArchive archive)
        {
            VolumeDescriptor vd = new VolumeDescriptor(mEventController, volName, volFilename, source, archive);

            lock ( mDescriptorList )
            {
                mDescriptorList.Add(vd);
            }
            Config.Active.Save();
            return(vd);
        }
 public override bool Equals(object obj)
 {
     if (obj is VolumeDescriptor)
     {
         VolumeDescriptor vd = (VolumeDescriptor)obj;
         return(string.Compare(vd.mName, this.mName, false) == 0);
     }
     else
     {
         return(false);
     }
 }
Beispiel #16
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);
            }
        }
Beispiel #17
0
 public static Volume BuildFromXml(VolumeEventController eventController, VolumeDescriptor volumeDesc, XmlNode parentNode)
 {
     return(new Volume(eventController, volumeDesc, parentNode));
 }
Beispiel #18
0
 public static Volume BuildFromXml( VolumeEventController eventController, VolumeDescriptor volumeDesc, XmlNode parentNode )
 {
     return new Volume( eventController, volumeDesc, parentNode );
 }
 public void InvokeVolumeDescriptorActiveStateChanged( VolumeDescriptor volume, bool isActive )
 {
     if ( VolumeDescriptorActiveStateChanged != null )
         VolumeDescriptorActiveStateChanged( volume, isActive );
 }
 public void RemoveVolume( VolumeDescriptor desc, bool removeAllData )
 {
     QueuedRemoveInfo removeInfo = new QueuedRemoveInfo();
     removeInfo.mDescriptor = desc;
     removeInfo.mDeleteAllData = removeAllData;
     mWorkerThread.RegisterOneShotTask( new PWLib.BackgroundWorkerThread.TaskPredicate( OnWorkerPredicate ),
         new PWLib.BackgroundWorkerThread.Task( OnWorkerRemove ), new PWLib.BackgroundWorkerThread.TaskError( OnWorkerError ), removeInfo );
 }
        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 TransferVolume( VolumeDescriptor vid, PWLib.UsbDrive.UsbDriveInfo newDrive )
 {
     QueuedTransferInfo transferInfo = new QueuedTransferInfo();
     transferInfo.mDescriptor = vid;
     transferInfo.mNewDrive = newDrive;
     mWorkerThread.RegisterOneShotTask( new PWLib.BackgroundWorkerThread.TaskPredicate( OnWorkerPredicate ),
         new PWLib.BackgroundWorkerThread.Task( OnWorkerTransfer ), new PWLib.BackgroundWorkerThread.TaskError( OnWorkerError ), transferInfo );
 }
 void mVolumeEventController_VolumeDescriptorActiveStateChanged( VolumeDescriptor desc, bool isActive )
 {
     if ( desc.ReadyForBackup )
     {
         Log.WriteLine( LogType.TextLogVerbose, "Backing up volume as the descriptor (.vol) file state has recently changed" );
         ForceBackup( desc.Volume );
     }
 }
 public void RemoveDescriptor( VolumeDescriptor vd )
 {
     lock ( mDescriptorList )
     {
         if ( mDescriptorList.Contains( vd ) )
         {
             mDescriptorList.Remove( vd );
         }
     }
 }