CodeExamplesAnalyzer Class

Analyzes code examples by executing exemplified code and capturing output and error information.

Definition

Namespace: Novacta.Documentation.CodeExamples
Assembly: Novacta.Documentation.CodeExamples (in Novacta.Documentation.CodeExamples.dll) Version: 2.0.0+d0711904e187765f05e6dc698044fce33381798b
C#
public class CodeExamplesAnalyzer
Inheritance
Object    CodeExamplesAnalyzer

Remarks

This class is responsible for analyzing code examples by executing them and capturing the output and error information.

Syncrhonous and asynchronous code examples are supported, provided that they implement the ICodeExample interface, or the IAsyncCodeExample one, respectively.

  Caution

A class should not implement explicitly the ICodeExample or IAsyncCodeExample interfaces. If so, the code example will not be recognized by CodeExamplesAnalyzer.

To analyze synchronous code examples, method Run(Boolean, Assembly) must be called from a synchronous context; to analyze asynchronous code examples, method RunAsync(Boolean, Assembly) must be called.

Constructors

CodeExamplesAnalyzer Initializes a new instance of the CodeExamplesAnalyzer class with the specified default namespace and code base.

Properties

CodeBase Gets or sets the root path of the directory tree where code example files are stored.
DefaultNamespace Gets or sets the default namespace of the project which includes the example source code files.

Methods

EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Run(Boolean) Runs synchronous code examples defined in the entry assembly for the running application, and writes to files their console outputs together with the corresponding source code, if available.
Obsolete
Run(Boolean, Assembly) Runs synchronous code examples defined in the specified assembly, if any, or in the entry assembly otherwise, and writes to files their console outputs together with the corresponding source code, if available.
RunAsync Runs asynchronous code examples defined in the specified assembly, if any, or in the entry assembly otherwise, and writes to files their console outputs together with the corresponding source code, if available.
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also