Table of Contents

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

filePath string
importFindings bool

Properties

Content

File content of the report file.

public string Content { get; }

Property Value

string

CreationDate

Modified date of the report file.

public DateTime CreationDate { get; }

Property Value

DateTime

DirectoryPath

Directory path of the report file.

public string DirectoryPath { get; }

Property Value

string

Extension

File extension of the report file.

public string Extension { get; }

Property Value

string

Name

File name of the report file.

public string Name { get; }

Property Value

string

NameWithoutExtension

File name without extension of the report file.

public string NameWithoutExtension { get; }

Property Value

string

Path

File Path of the report file.

public string Path { get; }

Property Value

string

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

removeRows int

Number 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

content string

Content 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()