Class FileDataConnector
A base class for file based data connectors.
public abstract class FileDataConnector : DataConnector, IDisposable
- Inheritance
-
FileDataConnector
- Implements
- Derived
- Inherited Members
Constructors
FileDataConnector(XmlNode)
Initializes a new instance of the FileDataConnector class.
public FileDataConnector(XmlNode xmlNode)
Parameters
xmlNodeXmlNodeAn XML node containing the definition of the source.
FileDataConnector(string, bool)
Initializes a new instance of the FileDataConnector class.
public FileDataConnector(string name, bool readOnly)
Parameters
namestringThe name of the source.
readOnlyboolSets the value of the IsReadOnly property.
Properties
FileName
Gets or sets the name of the file.
public string FileName { get; set; }
Property Value
- string
The name of the file.
Remarks
The file name may be relative.
IncludeFile
Gets or sets a value specifying whether the file should be included into the associated project.
public abstract CheckState IncludeFile { get; set; }
Property Value
- CheckState
A value specifying whether to include the file into the associated project.
ResolvedFileName
Gets the name of the resolved file that takes relative paths into account.
public string ResolvedFileName { get; }
Property Value
- string
The name of the resolved file.
Methods
LoadDataImpl(out ColumnCollection, out RowCollection)
Sets up a file watcher on the data file and creates instances for the
columns and rows arguments.
protected override void LoadDataImpl(out ColumnCollection columns, out RowCollection rows)
Parameters
columnsColumnCollectionWhen this method returns, contains a new ColumnCollection instance.
rowsRowCollectionWhen this method returns, contains a new RowCollection instance that is bound to
columns.
OnFileNameChanged(string)
Called when the filename changes
protected virtual void OnFileNameChanged(string oldFileName)
Parameters
oldFileNamestringThe filename before the filename was changed.
ResolveFilename(string)
Resolves the specified file name taking relative paths into account.
public static string ResolveFilename(string fileName)
Parameters
fileNamestringThe (relative) name of a file.
Returns
- string
The resolved file name.
ResolveFilename(string, bool)
Resolves the specified file name taking relative paths into account.
public static string ResolveFilename(string fileName, bool useNameFallback)
Parameters
fileNamestringThe (relative) name of a file.
useNameFallbackboolif set to
true[use name fallback].
Returns
- string
The resolved file name.