C# Class Projbook.Extension.CSharpExtractor.CSharpSnippetExtractor

Extractor in charge of browsing source directories. load file content and extract requested member.
Inheritance: DefaultSnippetExtractor
ファイルを表示 Open project: FransBouma/DocNet Class Usage Examples

Public Methods

Method Description
Extract ( string fullFilename, string memberPattern ) : string

Extracts a snippet from a given rule pattern.

Private Methods

Method Description
BuildSnippet ( Microsoft.CodeAnalysis.SyntaxNode nodes, CSharpExtractionMode extractionMode ) : string

Builds a snippet from extracted syntax nodes.

DetermineContentPosition ( Microsoft.CodeAnalysis.SyntaxNode node ) : int

Determines the content's block position depending on the node type.

WriteAndCleanupSnippet ( StringBuilder stringBuilder, string lines, CSharpExtractionMode extractionMode, int contentPosition ) : void

Writes and cleanup line snippets. Snippets are moved out of their context, for this reason we need to trim lines aroung and remove a part of the indentation.

Method Details

Extract() public method

Extracts a snippet from a given rule pattern.
public Extract ( string fullFilename, string memberPattern ) : string
fullFilename string The full filename (with path) to load and to extract the snippet from.
memberPattern string The member pattern to extract.
return string