C# Class Rubberduck.Common.DeclarationExtensions

Afficher le fichier Open project: retailcoder/Rubberduck

Méthodes publiques

Свойство Type Description
ProcedureTypes DeclarationType[]

Méthodes publiques

Méthode Description
BitmapImage ( this declaration ) : BitmapImage
CountOfDeclarationsInStatement ( this target ) : int

Returns the number of variable declarations in a single statement.

FindBuiltInEventHandlers ( this declarations ) : IEnumerable
FindEventHandlers ( this declarations, Rubberduck.Parsing.Symbols.Declaration control ) : IEnumerable

Finds all event handler procedures for specified control declaration.

FindEventProcedures ( this declarations, Rubberduck.Parsing.Symbols.Declaration withEventsDeclaration ) : IEnumerable
FindFormEventHandlers ( this declarations ) : IEnumerable
FindFormEventHandlers ( this declarations, Rubberduck.Parsing.Symbols.Declaration userForm ) : IEnumerable
FindHandlersForEvent ( this declarations, Rubberduck.Parsing.Symbols.Declaration eventDeclaration ) : Declaration>>.IEnumerable

Gets a tuple containing the WithEvents declaration and the corresponding handler, for each type implementing this event.

FindInterfaceImplementationMembers ( this declarations ) : IEnumerable

Finds all class members that are interface implementation members.

FindInterfaceImplementationMembers ( this declarations, string interfaceMember ) : IEnumerable
FindInterfaceMember ( this declarations, Rubberduck.Parsing.Symbols.Declaration implementation ) : Rubberduck.Parsing.Symbols.Declaration
FindInterfaceMembers ( this declarations ) : IEnumerable

Finds all interface members.

FindInterfaces ( this declarations ) : IEnumerable
FindSelectedDeclaration ( this declarations, QualifiedSelection selection, DeclarationType type, Selection>.Func selector = null ) : Rubberduck.Parsing.Symbols.Declaration

Gets the Declaration of the specified type, at the specified selection. Returns the declaration if selection is on an identifier reference.

FindSelectedDeclaration ( this declarations, QualifiedSelection selection, IEnumerable types, Selection>.Func selector = null ) : Rubberduck.Parsing.Symbols.Declaration

Gets the Declaration of the specified types, at the specified selection. Returns the declaration if selection is on an identifier reference.

FindTarget ( this declarations, QualifiedSelection selection ) : Rubberduck.Parsing.Symbols.Declaration
FindTarget ( this declarations, QualifiedSelection selection, DeclarationType validDeclarationTypes ) : Rubberduck.Parsing.Symbols.Declaration

Returns the declaration contained in a qualified selection. To get the selection of a variable or field, use FindVariable(QualifiedSelection)

FindVariable ( this declarations, QualifiedSelection selection ) : Rubberduck.Parsing.Symbols.Declaration

Returns the variable which contains the passed-in QualifiedSelection. Returns null if the selection is not on a variable.

GetVariableStmtContext ( this target ) : VBAParser.VariableStmtContext

Returns a VariableStmtContext.

GetVariableStmtContextSelection ( this target ) : Rubberduck.VBEditor.Selection

Returns the Selection of a VariableStmtContext.

HasMultipleDeclarationsInStatement ( this target ) : bool

Returns whether a variable declaration statement contains multiple declarations in a single statement.

InScope ( this declarations, [ parent ) : IEnumerable

Gets the declaration for all identifiers declared in or below the specified scope.

InScope ( this declarations, string scope ) : IEnumerable

Gets the declaration for all identifiers declared in or below the specified scope.

IndexOfVariableDeclarationInStatement ( this target ) : int

Returns the number of variable declarations in a single statement. Adjusted to be 1-indexed rather than 0-indexed.

Named ( this declarations, string name ) : IEnumerable
OfType ( this declarations ) : IEnumerable

Gets all declarations of any one of the specified DeclarationType values.

OfType ( this declarations, DeclarationType declarationType ) : IEnumerable

Gets all declarations of the specified DeclarationType.

ToLocalizedString ( this type ) : string

Private Methods

Méthode Description
FindInterface ( this declarations, QualifiedSelection selection ) : Rubberduck.Parsing.Symbols.Declaration
GetTypeMembers ( this declarations, Rubberduck.Parsing.Symbols.Declaration type ) : IEnumerable

Method Details

BitmapImage() public static méthode

public static BitmapImage ( this declaration ) : BitmapImage
declaration this
Résultat System.Windows.Media.Imaging.BitmapImage

CountOfDeclarationsInStatement() public static méthode

Returns the number of variable declarations in a single statement.
Throws when target's DeclarationType is not Variable.
public static CountOfDeclarationsInStatement ( this target ) : int
target this
Résultat int

FindBuiltInEventHandlers() public static méthode

public static FindBuiltInEventHandlers ( this declarations ) : IEnumerable
declarations this
Résultat IEnumerable

FindEventHandlers() public static méthode

Finds all event handler procedures for specified control declaration.
public static FindEventHandlers ( this declarations, Rubberduck.Parsing.Symbols.Declaration control ) : IEnumerable
declarations this
control Rubberduck.Parsing.Symbols.Declaration
Résultat IEnumerable

FindEventProcedures() public static méthode

public static FindEventProcedures ( this declarations, Rubberduck.Parsing.Symbols.Declaration withEventsDeclaration ) : IEnumerable
declarations this
withEventsDeclaration Rubberduck.Parsing.Symbols.Declaration
Résultat IEnumerable

FindFormEventHandlers() public static méthode

public static FindFormEventHandlers ( this declarations ) : IEnumerable
declarations this
Résultat IEnumerable

FindFormEventHandlers() public static méthode

public static FindFormEventHandlers ( this declarations, Rubberduck.Parsing.Symbols.Declaration userForm ) : IEnumerable
declarations this
userForm Rubberduck.Parsing.Symbols.Declaration
Résultat IEnumerable

FindHandlersForEvent() public static méthode

Gets a tuple containing the WithEvents declaration and the corresponding handler, for each type implementing this event.
public static FindHandlersForEvent ( this declarations, Rubberduck.Parsing.Symbols.Declaration eventDeclaration ) : Declaration>>.IEnumerable
declarations this
eventDeclaration Rubberduck.Parsing.Symbols.Declaration
Résultat Declaration>>.IEnumerable

FindInterfaceImplementationMembers() public static méthode

Finds all class members that are interface implementation members.
public static FindInterfaceImplementationMembers ( this declarations ) : IEnumerable
declarations this
Résultat IEnumerable

FindInterfaceImplementationMembers() public static méthode

public static FindInterfaceImplementationMembers ( this declarations, string interfaceMember ) : IEnumerable
declarations this
interfaceMember string
Résultat IEnumerable

FindInterfaceMember() public static méthode

public static FindInterfaceMember ( this declarations, Rubberduck.Parsing.Symbols.Declaration implementation ) : Rubberduck.Parsing.Symbols.Declaration
declarations this
implementation Rubberduck.Parsing.Symbols.Declaration
Résultat Rubberduck.Parsing.Symbols.Declaration

FindInterfaceMembers() public static méthode

Finds all interface members.
public static FindInterfaceMembers ( this declarations ) : IEnumerable
declarations this
Résultat IEnumerable

FindInterfaces() public static méthode

public static FindInterfaces ( this declarations ) : IEnumerable
declarations this
Résultat IEnumerable

FindSelectedDeclaration() public static méthode

Gets the Declaration of the specified type, at the specified selection. Returns the declaration if selection is on an identifier reference.
public static FindSelectedDeclaration ( this declarations, QualifiedSelection selection, DeclarationType type, Selection>.Func selector = null ) : Rubberduck.Parsing.Symbols.Declaration
declarations this
selection Rubberduck.VBEditor.QualifiedSelection
type DeclarationType
selector Selection>.Func
Résultat Rubberduck.Parsing.Symbols.Declaration

FindSelectedDeclaration() public static méthode

Gets the Declaration of the specified types, at the specified selection. Returns the declaration if selection is on an identifier reference.
public static FindSelectedDeclaration ( this declarations, QualifiedSelection selection, IEnumerable types, Selection>.Func selector = null ) : Rubberduck.Parsing.Symbols.Declaration
declarations this
selection Rubberduck.VBEditor.QualifiedSelection
types IEnumerable
selector Selection>.Func
Résultat Rubberduck.Parsing.Symbols.Declaration

FindTarget() public static méthode

public static FindTarget ( this declarations, QualifiedSelection selection ) : Rubberduck.Parsing.Symbols.Declaration
declarations this
selection Rubberduck.VBEditor.QualifiedSelection
Résultat Rubberduck.Parsing.Symbols.Declaration

FindTarget() public static méthode

Returns the declaration contained in a qualified selection. To get the selection of a variable or field, use FindVariable(QualifiedSelection)
public static FindTarget ( this declarations, QualifiedSelection selection, DeclarationType validDeclarationTypes ) : Rubberduck.Parsing.Symbols.Declaration
declarations this
selection Rubberduck.VBEditor.QualifiedSelection
validDeclarationTypes DeclarationType
Résultat Rubberduck.Parsing.Symbols.Declaration

FindVariable() public static méthode

Returns the variable which contains the passed-in QualifiedSelection. Returns null if the selection is not on a variable.
public static FindVariable ( this declarations, QualifiedSelection selection ) : Rubberduck.Parsing.Symbols.Declaration
declarations this
selection Rubberduck.VBEditor.QualifiedSelection
Résultat Rubberduck.Parsing.Symbols.Declaration

GetVariableStmtContext() public static méthode

Returns a VariableStmtContext.
Throws when target's DeclarationType is not Variable.
public static GetVariableStmtContext ( this target ) : VBAParser.VariableStmtContext
target this
Résultat VBAParser.VariableStmtContext

GetVariableStmtContextSelection() public static méthode

Returns the Selection of a VariableStmtContext.
Throws when target's DeclarationType is not Variable.
public static GetVariableStmtContextSelection ( this target ) : Rubberduck.VBEditor.Selection
target this
Résultat Rubberduck.VBEditor.Selection

HasMultipleDeclarationsInStatement() public static méthode

Returns whether a variable declaration statement contains multiple declarations in a single statement.
Throws when target's DeclarationType is not Variable.
public static HasMultipleDeclarationsInStatement ( this target ) : bool
target this
Résultat bool

InScope() public static méthode

Gets the declaration for all identifiers declared in or below the specified scope.
public static InScope ( this declarations, [ parent ) : IEnumerable
declarations this
parent [
Résultat IEnumerable

InScope() public static méthode

Gets the declaration for all identifiers declared in or below the specified scope.
public static InScope ( this declarations, string scope ) : IEnumerable
declarations this
scope string
Résultat IEnumerable

IndexOfVariableDeclarationInStatement() public static méthode

Returns the number of variable declarations in a single statement. Adjusted to be 1-indexed rather than 0-indexed.
Throws when target's DeclarationType is not Variable.
public static IndexOfVariableDeclarationInStatement ( this target ) : int
target this
Résultat int

Named() public static méthode

public static Named ( this declarations, string name ) : IEnumerable
declarations this
name string
Résultat IEnumerable

OfType() public static méthode

Gets all declarations of any one of the specified DeclarationType values.
public static OfType ( this declarations ) : IEnumerable
declarations this
Résultat IEnumerable

OfType() public static méthode

Gets all declarations of the specified DeclarationType.
public static OfType ( this declarations, DeclarationType declarationType ) : IEnumerable
declarations this
declarationType DeclarationType
Résultat IEnumerable

ToLocalizedString() public static méthode

public static ToLocalizedString ( this type ) : string
type this
Résultat string

Property Details

ProcedureTypes public_oe static_oe property

public static DeclarationType[] ProcedureTypes
Résultat DeclarationType[]