public static List<string> GetCSharpRegisterPropertyNames(this IClassLikeDeclaration classLikeDeclaration)
{
Argument.IsNotNull(() => classLikeDeclaration);
return
(from argument in
(from fieldDeclaration in
classLikeDeclaration.Body.FieldDeclarations.Where(
multipleFieldDeclaration => multipleFieldDeclaration != null)
.SelectMany(
multipleFieldDeclaration => multipleFieldDeclaration.Declarators)
.OfType<IFieldDeclaration>()
select fieldDeclaration
into declaration
where declaration.Initial is IExpressionInitializer
select declaration.Initial as IExpressionInitializer
into invocationExpression
where invocationExpression.Value is IInvocationExpression
select invocationExpression.Value as IInvocationExpression
into expression
where expression.InvokedExpression is IReferenceExpression
let referenceExpression = expression.InvokedExpression as IReferenceExpression
where
referenceExpression.NameIdentifier != null
&& referenceExpression.NameIdentifier.GetText()
== RegisterPropertyExpressionHelper.RegisterPropertyMethodName
select expression.Arguments[0].Value).OfType<ICSharpLiteralExpression>()
select argument into sharpLiteralExpression
select sharpLiteralExpression.ConstantValue
into constantValue
where constantValue != null && constantValue.Type.IsString()
select (string)constantValue.Value).ToList();
}