C# Class ReSharper.Exceptional.Utilities.CodeElementFactory

Provides services to create various code elements.
ファイルを表示 Open project: CSharpAnalyzers/ExceptionalReSharper

Public Methods

Method Description
CodeElementFactory ( CSharpElementFactory factory ) : System

Initializes a new instance of the CodeElementFactory class.

CreateArgument ( string value ) : ICSharpArgument

Creates an argument that may be passed to invocations.

CreateBlock ( ITreeNode node ) : IBlock

Creates a block with the content of the given node.

CreateCatchVariableDeclarationNode ( IDeclaredType exceptionType, ITreeNode context ) : ICatchVariableDeclaration

Creates a variable declaration for catch clause.

CreateSpecificCatchClause ( IDeclaredType exceptionType, IBlock catchBody, string variableName ) : ISpecificCatchClause

Creates a specific catch clause with given exceptionType and catchBody.

CreateTryStatement ( IDeclaredType exceptionType, string exceptionVariableName, ITreeNode context ) : ITryStatement

Creates a try statement for the given exception type and variable name.

Method Details

CodeElementFactory() public method

Initializes a new instance of the CodeElementFactory class.
public CodeElementFactory ( CSharpElementFactory factory ) : System
factory CSharpElementFactory The element factory.
return System

CreateArgument() public method

Creates an argument that may be passed to invocations.
public CreateArgument ( string value ) : ICSharpArgument
value string A value for an argument.
return ICSharpArgument

CreateBlock() public method

Creates a block with the content of the given node.
public CreateBlock ( ITreeNode node ) : IBlock
node ITreeNode The node which is used as content.
return IBlock

CreateCatchVariableDeclarationNode() public method

Creates a variable declaration for catch clause.
public CreateCatchVariableDeclarationNode ( IDeclaredType exceptionType, ITreeNode context ) : ICatchVariableDeclaration
exceptionType IDeclaredType The type of a created variable.
context ITreeNode The context.
return ICatchVariableDeclaration

CreateSpecificCatchClause() public method

Creates a specific catch clause with given exceptionType and catchBody.
public CreateSpecificCatchClause ( IDeclaredType exceptionType, IBlock catchBody, string variableName ) : ISpecificCatchClause
exceptionType IDeclaredType Type of the exception to catch.
catchBody IBlock Body of the created catch.
variableName string A name for catch variable.
return ISpecificCatchClause

CreateTryStatement() public method

Creates a try statement for the given exception type and variable name.
public CreateTryStatement ( IDeclaredType exceptionType, string exceptionVariableName, ITreeNode context ) : ITryStatement
exceptionType IDeclaredType The exception type.
exceptionVariableName string The exception variable name.
context ITreeNode The context.
return ITryStatement