SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
Seci.Definitions.AssociatedFile Class Reference

This class is used for storing files as part of a configuration. Typically, the files stored are ini files from a LabVIEW VIs, which are usually less than 100k in size. The files are stored in the configuration as a byte array, which is converted back into the "real" file when the configuration is loaded. The file is only intended to be converted at the point of saving the configuration otherwise it just wastes memory. More...

Collaboration diagram for Seci.Definitions.AssociatedFile:
Collaboration graph

Public Member Functions

 AssociatedFile ()
 Default constructor More...
 
 AssociatedFile (String fileName)
 Recommended constructor for use in code. More...
 
Boolean ConvertFileToByteArray ()
 Method for converting a file to a byte array. More...
 
void CreateFile ()
 Method for creating a file from the saved byte array. Will back-up the existing version of the file and replace it with the new version. If the write fails then it won't automatically roll back as this could be disastrous! If the file is corrupted in any way, LabVIEW will not be able to load it. More...
 
Boolean HasBeenModified ()
 Method for checking whether the file was modified. More...
 
void RestoreOriginal ()
 Restores the on disk copy of the associated file to what was originally in the configuration. In other words, it overwrites the file with the .orig file. More...
 

Properties

Byte[] FileData [get, set]
 
String FileLocation [get, set]
 
String OwningComponent [get, set]
 

Private Member Functions

void CreateOriginal ()
 Creates a copy of the file but with the .orig extension More...
 
DateTime getLastModifiedDateTime ()
 Method for getting the last time when the file was modified. More...
 
void updateModifiedTime ()
 Method for updating the last modified time. More...
 

Private Attributes

Byte[] _fileData
 
String _fileLocation
 
DateTime _lastModifiedTime
 
String _owningComponent
 

Detailed Description

This class is used for storing files as part of a configuration. Typically, the files stored are ini files from a LabVIEW VIs, which are usually less than 100k in size. The files are stored in the configuration as a byte array, which is converted back into the "real" file when the configuration is loaded. The file is only intended to be converted at the point of saving the configuration otherwise it just wastes memory.

Definition at line 18 of file AssociatedFile.cs.

Constructor & Destructor Documentation

Seci.Definitions.AssociatedFile.AssociatedFile ( )
inline

Default constructor

Definition at line 37 of file AssociatedFile.cs.

Seci.Definitions.AssociatedFile.AssociatedFile ( String  fileName)
inline

Recommended constructor for use in code.

Parameters
fileNameThe full filepath of the file to save

Definition at line 45 of file AssociatedFile.cs.

Member Function Documentation

Boolean Seci.Definitions.AssociatedFile.ConvertFileToByteArray ( )
inline

Method for converting a file to a byte array.

Returns
False if there is an error

Definition at line 55 of file AssociatedFile.cs.

void Seci.Definitions.AssociatedFile.CreateFile ( )
inline

Method for creating a file from the saved byte array. Will back-up the existing version of the file and replace it with the new version. If the write fails then it won't automatically roll back as this could be disastrous! If the file is corrupted in any way, LabVIEW will not be able to load it.

Definition at line 93 of file AssociatedFile.cs.

void Seci.Definitions.AssociatedFile.CreateOriginal ( )
inlineprivate

Creates a copy of the file but with the .orig extension

Definition at line 136 of file AssociatedFile.cs.

DateTime Seci.Definitions.AssociatedFile.getLastModifiedDateTime ( )
inlineprivate

Method for getting the last time when the file was modified.

Returns
Last modified datetime

Definition at line 212 of file AssociatedFile.cs.

Boolean Seci.Definitions.AssociatedFile.HasBeenModified ( )
inline

Method for checking whether the file was modified.

Returns
True if modified

Definition at line 190 of file AssociatedFile.cs.

void Seci.Definitions.AssociatedFile.RestoreOriginal ( )
inline

Restores the on disk copy of the associated file to what was originally in the configuration. In other words, it overwrites the file with the .orig file.

Definition at line 155 of file AssociatedFile.cs.

void Seci.Definitions.AssociatedFile.updateModifiedTime ( )
inlineprivate

Method for updating the last modified time.

Definition at line 173 of file AssociatedFile.cs.

Member Data Documentation

Byte [] Seci.Definitions.AssociatedFile._fileData
private

Definition at line 23 of file AssociatedFile.cs.

String Seci.Definitions.AssociatedFile._fileLocation
private

Definition at line 21 of file AssociatedFile.cs.

DateTime Seci.Definitions.AssociatedFile._lastModifiedTime
private

Definition at line 25 of file AssociatedFile.cs.

String Seci.Definitions.AssociatedFile._owningComponent
private

Definition at line 27 of file AssociatedFile.cs.

Property Documentation

Byte [] Seci.Definitions.AssociatedFile.FileData
getset

Definition at line 31 of file AssociatedFile.cs.

String Seci.Definitions.AssociatedFile.FileLocation
getset

Definition at line 30 of file AssociatedFile.cs.

Referenced by Seci.Managers.AssocFileMgr.RestoreFile().

String Seci.Definitions.AssociatedFile.OwningComponent
getset

Definition at line 32 of file AssociatedFile.cs.


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