Class FileReaderContext
- Namespace
- MES.MQC.DataSourceLibrary.Adapters
- Assembly
- MES.MQC.DataSourceLibrary.dll
public class FileReaderContext : AdapterContextBase, IDisposable
- Inheritance
-
FileReaderContext
- Implements
- Derived
- Inherited Members
Constructors
FileReaderContext(string, bool)
public FileReaderContext(string filePath, bool importFindings = false)
Parameters
Properties
Content
File content of the report file.
public string Content { get; }
Property Value
CreationDate
Modified date of the report file.
public DateTime CreationDate { get; }
Property Value
DirectoryPath
Directory path of the report file.
public string DirectoryPath { get; }
Property Value
Extension
File extension of the report file.
public string Extension { get; }
Property Value
Name
File name of the report file.
public string Name { get; }
Property Value
NameWithoutExtension
File name without extension of the report file.
public string NameWithoutExtension { get; }
Property Value
Path
File Path of the report file.
public string Path { get; }
Property Value
Methods
AsDataSet(int)
AsDataSet is a Utility method. It loads the file path as an DataSet. The DataSet is stored in a property and returned. The reading of the file is therefore only done once.
public DataSet AsDataSet(int removeRows = 0)
Parameters
removeRowsintNumber of rows to remove before parsing (e.g. invalid/merged rows above the header)
Returns
- DataSet
DataSet (with DataTables, System.Data)
AsHtmlDocument(string)
AsHtmlDocument is a Utility method. It loads the file path as an HtmlDocument (HtmlAgilityPack). See https://html-agility-pack.net/ for documentation. The document is stored in a property and returned. The reading of the file is therefore only done once.
public HtmlDocument AsHtmlDocument(string content = null)
Parameters
contentstringContent of a html file, optional
Returns
- HtmlDocument
HtmlDocument (HtmlAgilityPack)
AsXDocument()
It loads the file path as an XDocument, which can be traversed via XPath. See https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/linq-to-xml-overview for documentation. The document is stored in a property and returned. The reading of the file is therefore only done once.
public XDocument AsXDocument()
Returns
- XDocument
XDocument (System.Xml)
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()