Show / Hide Table of Contents

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 Source

Current

Gets the current debug context

Declaration
public static DebugContext Current { get; }
Property Value
Type Description
DebugContext
View Source

Directory

Gets or set the working directory for the debug output files

Declaration
public string Directory { get; set; }
Property Value
Type Description
System.String
View Source

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 Source

UseContext(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.

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX