Skip to content

Instantly share code, notes, and snippets.

@controlflow
Last active December 11, 2019 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save controlflow/e854699c076e02e4a60efd4ceeaaf610 to your computer and use it in GitHub Desktop.
Save controlflow/e854699c076e02e4a60efd4ceeaaf610 to your computer and use it in GitHub Desktop.
var indexerDeclaration = declaration as IIndexerDeclaration;
if (indexerDeclaration != null)
{
var arrowClause = indexerDeclaration.ArrowClause;
if (arrowClause != null)
{
var property = indexerDeclaration.DeclaredElement;
if (property != null)
{
...
if (declaration is IIndexerDeclaration { ArrowClause: { DeclaredElement: {/*notnull*/} property } })
{
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment