Class DebugContext
This class can be used to create debug files for the report engine.
Inheritance
System.Object
DebugContext
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sartorius.SAF.ReportGenerator
Assembly: Sartorius.SAF.ReportGenerator.dll
Syntax
public class DebugContext
Examples
The following example shows how to use the DebugContext to create debug output files.
using (DebugContext.UseContext(tempDirectory))
{
using (var stream = File.OpenWrite(path))
{
using (var output = await reportInstance.CreateReportAsync())
{
await stream.CopyToAsync(stream);
}
}
Console.WriteLine("The following files have been created:");
foreach (var fileName in DebugContext.Current.Files)
{
Console.WriteLine(fileName);
}
}
Properties
View SourceCurrent
Gets the current debug context
Declaration
public static DebugContext Current { get; }
Property Value
Type | Description |
---|---|
DebugContext |
Directory
Gets or set the working directory for the debug output files
Declaration
public string Directory { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Files
Gets the files created by the reporting debug output.
Declaration
public ICollection<string> Files { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.ICollection<System.String> |
Methods
View SourceUseContext(String)
Create a new debug context using the specified directory.
Declaration
public static IDisposable UseContext(string directory)
Parameters
Type | Name | Description |
---|---|---|
System.String | directory | The working directory for the debug output files |
Returns
Type | Description |
---|---|
System.IDisposable | An System.IDisposable that defines the lifetime of the debug context. |