public IReference[] GetReferences(ITreeNode element, IReference[] oldReferences) { var expression = element as ICSharpExpression; if (expression != null) { if (oldReferences != null && oldReferences.Length > 0) { if (oldReferences .Select(reference => reference as IReflectedReference) .All(reference => reference != null && reference.GetTreeNode() == expression && reference.IsInternalValid)) { return oldReferences; } } expression.AssertIsValid("element is not valid"); if (expression.ConstantValue.IsString()) { var argument = expression.GetContainingNode<IArgument>(); if (argument != null && argument.Expression == expression) { var argumentsOwner = argument.Invocation as IInvocationExpression; if (argumentsOwner != null) { var invokedExpression = argumentsOwner.InvokedExpression as IReferenceExpression; if (invokedExpression != null && invokedExpression.QualifierExpression != null) { var declaredType = invokedExpression.QualifierExpression.Type() as IDeclaredType; if (declaredType != null && declaredType.GetClrName().FullName == "System.Type") { var kind = GetMemberKind(argumentsOwner); if (kind != null) { var parameter = argument .IfNotNull(d => d.MatchingParameter) .IfNotNull(p => p.Element); if (parameter != null && parameter.ShortName == "name") { return new IReference[] { new ReflectedMemberReference(kind.Value, expression, argumentsOwner) }; } } } } } } } } return EmptyArray<IReference>.Instance; }