Table of Contents

Class FileRefSource<T>

Namespace
Hi.Common.XmlUtils
Assembly
HiGeom.dll

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

T

The 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

file string

Optional path to the XML source file

data T

The 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

string

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

baseDirectory string

The 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

src FileRefSource<T>

The source XmlSource to copy from