Class FileRefSource<T>
A class that combines an XML-serializable data object with its source file path.
public class FileRefSource<T> : ISourceFile where T : class, IMakeXmlSource
Type Parameters
TThe type of data object that can be serialized to XML
- Inheritance
-
FileRefSource<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
FileRefSource()
Initializes a new instance of the XmlSource class.
public FileRefSource()
FileRefSource(string, T)
Initializes a new instance of the XmlSource class with data and optional file path.
public FileRefSource(string file, T data)
Parameters
filestringOptional path to the XML source file
dataTThe data object to store
Properties
Data
Gets or sets the main data object being stored.
public T Data { get; set; }
Property Value
- T
SourceFile
Gets or sets the path to the source file.
public string SourceFile { get; set; }
Property Value
Methods
MakeXmlSourceToFileRef(string)
Creates an XML representation of the data object with the file path rebased to the specified directory.
public XElement MakeXmlSourceToFileRef(string baseDirectory)
Parameters
baseDirectorystringThe base directory for resolving relative paths
Returns
- XElement
An XML element representing the data object's state
Set(FileRefSource<T>)
Copies data from another XmlSource instance.
public void Set(FileRefSource<T> src)
Parameters
srcFileRefSource<T>The source XmlSource to copy from