Daniel's XL Toolbox NG
XLToolbox.Backup.BackupFile Class Reference

Represents a backup file with a date stamp in the file name. More...

Public Member Functions

bool Delete ()
 Deletes the physical file that is represented by the BackupFile object. More...
 
void Open ()
 Opens the workbook represented by this BackupFile. More...
 
 BackupFile (string path)
 Creates a new BackupFile object from a given backup file path. More...
 

Static Public Member Functions

static BackupFile CreateBackup (string fileToBackUp, string backupDir)
 Creates a new backup by copying the file to backup to the backup dir and inserting a time stamp with the last write time into the file name. More...
 

Protected Member Functions

 BackupFile ()
 
 BackupFile (Exception exception)
 

Properties

bool IsDeleted [get]
 
string Path [get, set]
 Gets or sets the path of the backup file. More...
 
TimeStamp TimeStamp [get]
 Gets the TimeStamp object that contains the date and time extracted from the Path. If the Path does not contain a valid time stamp, the TimeStamp's HasValue property is false. More...
 
int Year [get]
 
int Month [get]
 
int Day [get]
 
bool IsOfToday [get]
 Gets whether the file's time stamp equals today's date. If the file does not have a valid time stamp, it returns false. More...
 
bool IsValidBackup [get]
 
Exception Exception [get]
 

Detailed Description

Represents a backup file with a date stamp in the file name.

Constructor & Destructor Documentation

◆ BackupFile() [1/3]

XLToolbox.Backup.BackupFile.BackupFile ( )
inlineprotected

◆ BackupFile() [2/3]

XLToolbox.Backup.BackupFile.BackupFile ( string  path)
inline

Creates a new BackupFile object from a given backup file path.

Parameters
path

◆ BackupFile() [3/3]

XLToolbox.Backup.BackupFile.BackupFile ( Exception  exception)
inlineprotected

Member Function Documentation

◆ CreateBackup()

static BackupFile XLToolbox.Backup.BackupFile.CreateBackup ( string  fileToBackUp,
string  backupDir 
)
inlinestatic

Creates a new backup by copying the file to backup to the backup dir and inserting a time stamp with the last write time into the file name.

Parameters
fileToBackUpFile to back up.
backupDirBackup directory; this must not be rooted.
Returns
BackupFile object representing the newly created backup file, or null if an I/O error occurred.

◆ Delete()

bool XLToolbox.Backup.BackupFile.Delete ( )
inline

Deletes the physical file that is represented by the BackupFile object.

Returns
True if the file was deleted, false if not.

◆ Open()

void XLToolbox.Backup.BackupFile.Open ( )
inline

Opens the workbook represented by this BackupFile.

Property Documentation

◆ Day

int XLToolbox.Backup.BackupFile.Day
get

◆ Exception

Exception XLToolbox.Backup.BackupFile.Exception
get

◆ IsDeleted

bool XLToolbox.Backup.BackupFile.IsDeleted
get

◆ IsOfToday

bool XLToolbox.Backup.BackupFile.IsOfToday
get

Gets whether the file's time stamp equals today's date. If the file does not have a valid time stamp, it returns false.

◆ IsValidBackup

bool XLToolbox.Backup.BackupFile.IsValidBackup
get

◆ Month

int XLToolbox.Backup.BackupFile.Month
get

◆ Path

string XLToolbox.Backup.BackupFile.Path
getset

Gets or sets the path of the backup file.

◆ TimeStamp

TimeStamp XLToolbox.Backup.BackupFile.TimeStamp
get

Gets the TimeStamp object that contains the date and time extracted from the Path. If the Path does not contain a valid time stamp, the TimeStamp's HasValue property is false.

◆ Year

int XLToolbox.Backup.BackupFile.Year
get

The documentation for this class was generated from the following file: