Class FileReaderContext
- Namespace
- MES.MQC.DataSourceLibrary.Context
- Assembly
- MES.MQC.DataSourceLibrary.dll
public class FileReaderContext : ContextBase, IDisposable
- Inheritance
-
FileReaderContext
- Implements
- Inherited Members
Properties
Content
File content of the report file.
public string Content { get; }
Property Value
DateTime
Date of the report file.
public DateTime DateTime { get; }
Property Value
DateTimeIsReportDate
Should the DateTime of the FileContent be used as the report date?
public bool DateTimeIsReportDate { get; }
Property Value
DirectoryPath
Directory path of the report file.
public string DirectoryPath { get; }
Property Value
ExtractFindings
Should the adapter import findings?
public bool ExtractFindings { get; }
Property Value
FileExtension
File extension of the report file.
public string FileExtension { get; }
Property Value
FileName
File name of the report file.
public string FileName { get; }
Property Value
FileNameWithoutExtension
File name without extension of the report file.
public string FileNameWithoutExtension { get; }
Property Value
FilePath
File Path of the report file.
public string FilePath { get; }
Property Value
RelatedContents
public List<IFileContent> RelatedContents { 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()
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()
Returns
- HtmlDocument
HtmlDocument (HtmlAgilityPack)
AsXDocument(bool)
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(bool throwWarning = true)
Parameters
throwWarningbool
Returns
- XDocument
XDocument (System.Xml)
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetDataFromBag<T>(string, out T)
public bool GetDataFromBag<T>(string key, out T value)
Parameters
keystringvalueT
Returns
Type Parameters
T
LoadHtmlDocument(Stream)
public HtmlDocument LoadHtmlDocument(Stream stream)
Parameters
streamStream
Returns
- HtmlDocument
LoadHtmlDocument(string)
public HtmlDocument LoadHtmlDocument(string content)
Parameters
contentstring
Returns
- HtmlDocument
SetDataToBag<T>(string, T)
public void SetDataToBag<T>(string key, T value)
Parameters
keystringvalueT
Type Parameters
T