C# Класс Rubberduck.Common.DeclarationExtensions

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
ProcedureTypes DeclarationType[]

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
FindInterface ( this declarations, QualifiedSelection selection ) : Rubberduck.Parsing.Symbols.Declaration
GetTypeMembers ( this declarations, Rubberduck.Parsing.Symbols.Declaration type ) : IEnumerable

Описание методов

BitmapImage() публичный статический Метод

public static BitmapImage ( this declaration ) : BitmapImage
declaration this
Результат System.Windows.Media.Imaging.BitmapImage

CountOfDeclarationsInStatement() публичный статический Метод

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
Результат int

FindBuiltInEventHandlers() публичный статический Метод

public static FindBuiltInEventHandlers ( this declarations ) : IEnumerable
declarations this
Результат IEnumerable

FindEventHandlers() публичный статический Метод

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
Результат IEnumerable

FindEventProcedures() публичный статический Метод

public static FindEventProcedures ( this declarations, Rubberduck.Parsing.Symbols.Declaration withEventsDeclaration ) : IEnumerable
declarations this
withEventsDeclaration Rubberduck.Parsing.Symbols.Declaration
Результат IEnumerable

FindFormEventHandlers() публичный статический Метод

public static FindFormEventHandlers ( this declarations ) : IEnumerable
declarations this
Результат IEnumerable

FindFormEventHandlers() публичный статический Метод

public static FindFormEventHandlers ( this declarations, Rubberduck.Parsing.Symbols.Declaration userForm ) : IEnumerable
declarations this
userForm Rubberduck.Parsing.Symbols.Declaration
Результат IEnumerable

FindHandlersForEvent() публичный статический Метод

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
Результат Declaration>>.IEnumerable

FindInterfaceImplementationMembers() публичный статический Метод

Finds all class members that are interface implementation members.
public static FindInterfaceImplementationMembers ( this declarations ) : IEnumerable
declarations this
Результат IEnumerable

FindInterfaceImplementationMembers() публичный статический Метод

public static FindInterfaceImplementationMembers ( this declarations, string interfaceMember ) : IEnumerable
declarations this
interfaceMember string
Результат IEnumerable

FindInterfaceMember() публичный статический Метод

public static FindInterfaceMember ( this declarations, Rubberduck.Parsing.Symbols.Declaration implementation ) : Rubberduck.Parsing.Symbols.Declaration
declarations this
implementation Rubberduck.Parsing.Symbols.Declaration
Результат Rubberduck.Parsing.Symbols.Declaration

FindInterfaceMembers() публичный статический Метод

Finds all interface members.
public static FindInterfaceMembers ( this declarations ) : IEnumerable
declarations this
Результат IEnumerable

FindInterfaces() публичный статический Метод

public static FindInterfaces ( this declarations ) : IEnumerable
declarations this
Результат IEnumerable

FindSelectedDeclaration() публичный статический Метод

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
Результат Rubberduck.Parsing.Symbols.Declaration

FindSelectedDeclaration() публичный статический Метод

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
Результат Rubberduck.Parsing.Symbols.Declaration

FindTarget() публичный статический Метод

public static FindTarget ( this declarations, QualifiedSelection selection ) : Rubberduck.Parsing.Symbols.Declaration
declarations this
selection Rubberduck.VBEditor.QualifiedSelection
Результат Rubberduck.Parsing.Symbols.Declaration

FindTarget() публичный статический Метод

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
Результат Rubberduck.Parsing.Symbols.Declaration

FindVariable() публичный статический Метод

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
Результат Rubberduck.Parsing.Symbols.Declaration

GetVariableStmtContext() публичный статический Метод

Returns a VariableStmtContext.
Throws when target's DeclarationType is not Variable.
public static GetVariableStmtContext ( this target ) : VBAParser.VariableStmtContext
target this
Результат VBAParser.VariableStmtContext

GetVariableStmtContextSelection() публичный статический Метод

Returns the Selection of a VariableStmtContext.
Throws when target's DeclarationType is not Variable.
public static GetVariableStmtContextSelection ( this target ) : Rubberduck.VBEditor.Selection
target this
Результат Rubberduck.VBEditor.Selection

HasMultipleDeclarationsInStatement() публичный статический Метод

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
Результат bool

InScope() публичный статический Метод

Gets the declaration for all identifiers declared in or below the specified scope.
public static InScope ( this declarations, [ parent ) : IEnumerable
declarations this
parent [
Результат IEnumerable

InScope() публичный статический Метод

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
Результат IEnumerable

IndexOfVariableDeclarationInStatement() публичный статический Метод

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
Результат int

Named() публичный статический Метод

public static Named ( this declarations, string name ) : IEnumerable
declarations this
name string
Результат IEnumerable

OfType() публичный статический Метод

Gets all declarations of any one of the specified DeclarationType values.
public static OfType ( this declarations ) : IEnumerable
declarations this
Результат IEnumerable

OfType() публичный статический Метод

Gets all declarations of the specified DeclarationType.
public static OfType ( this declarations, DeclarationType declarationType ) : IEnumerable
declarations this
declarationType DeclarationType
Результат IEnumerable

ToLocalizedString() публичный статический Метод

public static ToLocalizedString ( this type ) : string
type this
Результат string

Описание свойств

ProcedureTypes публичное статическое свойство

public static DeclarationType[] ProcedureTypes
Результат DeclarationType[]