public override IEnumerable <FilteredRegistrationBase> GetBasedOnRegistrations(ITreeNode registrationRootElement) { IStructuralMatchResult match = Match(registrationRootElement); if (match.Matched) { var argument = match.GetMatchedElement("argument") as ICSharpArgument; if (argument == null) { yield break; } var typeofExpression = argument.Value as ITypeofExpression; if (typeofExpression != null) { var declaredType = typeofExpression.ArgumentType as IDeclaredType; if (declaredType != null) { ITypeElement typeElement = declaredType.GetTypeElement(); if (typeElement != null) { yield return(registrationCreator.Create(registrationRootElement, typeElement)); } } } } }
public override IEnumerable <BasedOnRegistrationBase> GetBasedOnRegistrations(ITreeNode registrationRootElement) { IStructuralMatchResult match = Match(registrationRootElement); if (match.Matched) { var declarationsCache = registrationRootElement.GetPsiServices().CacheManager.GetDeclarationsCache(DeclarationCacheLibraryScope.FULL, false); ITypeElement objectTypeElement = declarationsCache.GetTypeElementByCLRName("System.Object"); if (objectTypeElement != null) { yield return(registrationCreator.Create(registrationRootElement, objectTypeElement)); } } }
public override IEnumerable <FilteredRegistrationBase> GetBasedOnRegistrations(ITreeNode registrationRootElement) { IStructuralMatchResult match = Match(registrationRootElement); if (match.Matched) { ITypeElement objectTypeElement = registrationRootElement.GetPsiModule() .GetPredefinedType() .Object.GetTypeElement(); if (objectTypeElement != null) { yield return(registrationCreator.Create(registrationRootElement, objectTypeElement)); } } }
public override IEnumerable <FilteredRegistrationBase> GetBasedOnRegistrations(ITreeNode registrationRootElement) { IStructuralMatchResult match = Match(registrationRootElement); if (match.Matched) { var matchedType = match.GetMatchedType("type") as IDeclaredType; if (matchedType != null) { ITypeElement typeElement = matchedType.GetTypeElement(); if (typeElement != null) { yield return(registrationCreator.Create(registrationRootElement, typeElement)); } } } }