コード例 #1
0
ファイル: Volume.cs プロジェクト: peteward44/auto-usb-backup
 public Volume(VolumeEventController eventController, VolumeDescriptor volumeDesc, XmlNode parentNode)
 {
     mEventController     = eventController;
     mVolumeDesc          = volumeDesc;
     mBackupRestoreObject = new BackupRestoreVolume(parentNode);
     Init();
 }
コード例 #2
0
ファイル: Volume.cs プロジェクト: peteward44/auto-usb-backup
 public Volume( VolumeEventController eventController, VolumeDescriptor volumeDesc, VolumeSource source, BaseArchive archive )
 {
     mEventController = eventController;
     mVolumeDesc = volumeDesc;
     mBackupRestoreObject = new BackupRestoreVolume( mVolumeDesc.VolumeName, source, archive );
     Init();
 }
コード例 #3
0
ファイル: Volume.cs プロジェクト: peteward44/auto-usb-backup
 public Volume( VolumeEventController eventController, VolumeDescriptor volumeDesc, XmlNode parentNode )
 {
     mEventController = eventController;
     mVolumeDesc = volumeDesc;
     mBackupRestoreObject = new BackupRestoreVolume( parentNode );
     Init();
 }
コード例 #4
0
ファイル: Volume.cs プロジェクト: peteward44/auto-usb-backup
 public Volume(VolumeEventController eventController, VolumeDescriptor volumeDesc, VolumeSource source, BaseArchive archive)
 {
     mEventController     = eventController;
     mVolumeDesc          = volumeDesc;
     mBackupRestoreObject = new BackupRestoreVolume(mVolumeDesc.VolumeName, source, archive);
     Init();
 }
コード例 #5
0
 public void InvokeVolumeDescriptorActiveStateChanged(VolumeDescriptor volume, bool isActive)
 {
     if (VolumeDescriptorActiveStateChanged != null)
     {
         VolumeDescriptorActiveStateChanged(volume, isActive);
     }
 }
コード例 #6
0
ファイル: Spine.cs プロジェクト: peteward44/auto-usb-backup
 public void RemoveVolume( VolumeDescriptor desc, bool removeAllData )
 {
     if ( removeAllData && desc.IsAvailable )
     {
         desc.Volume.DeleteAllRevisions();
     }
     VolumeDescriptorList.Instance.RemoveDescriptor( desc );
 }
コード例 #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);
     }
 }
コード例 #8
0
 public void RemoveVolume(VolumeDescriptor desc, bool removeAllData)
 {
     if (removeAllData && desc.IsAvailable)
     {
         desc.Volume.DeleteAllRevisions();
     }
     VolumeDescriptorList.Instance.RemoveDescriptor(desc);
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #11
0
 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;
 }
コード例 #12
0
 public void RemoveDescriptor(VolumeDescriptor vd)
 {
     lock ( mDescriptorList )
     {
         if (mDescriptorList.Contains(vd))
         {
             mDescriptorList.Remove(vd);
         }
     }
 }
コード例 #13
0
        public VolumeDescriptor LoadDescriptor(string volName, string volFilename)
        {
            VolumeDescriptor vd = VolumeDescriptor.LoadFromXml(mEventController, volName, volFilename);

            lock ( mDescriptorList )
            {
                mDescriptorList.Add(vd);
            }
            return(vd);
        }
コード例 #14
0
        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);
        }
コード例 #15
0
 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);
     }
 }
コード例 #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);
            }
        }
コード例 #17
0
ファイル: Volume.cs プロジェクト: peteward44/auto-usb-backup
 public static Volume BuildFromXml(VolumeEventController eventController, VolumeDescriptor volumeDesc, XmlNode parentNode)
 {
     return(new Volume(eventController, volumeDesc, parentNode));
 }
コード例 #18
0
ファイル: Volume.cs プロジェクト: peteward44/auto-usb-backup
 public static Volume BuildFromXml( VolumeEventController eventController, VolumeDescriptor volumeDesc, XmlNode parentNode )
 {
     return new Volume( eventController, volumeDesc, parentNode );
 }
コード例 #19
0
 public void InvokeVolumeDescriptorActiveStateChanged( VolumeDescriptor volume, bool isActive )
 {
     if ( VolumeDescriptorActiveStateChanged != null )
         VolumeDescriptorActiveStateChanged( volume, isActive );
 }
コード例 #20
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 );
 }
コード例 #21
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 );
            }
        }
コード例 #22
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 );
 }
コード例 #23
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 );
     }
 }
コード例 #24
0
 public void RemoveDescriptor( VolumeDescriptor vd )
 {
     lock ( mDescriptorList )
     {
         if ( mDescriptorList.Contains( vd ) )
         {
             mDescriptorList.Remove( vd );
         }
     }
 }