Beispiel #1
0
        private IdentifierTooltipContent TryGetAdditionalIdentifierContent(
            [CanBeNull] DeclaredElementInfo info,
            [NotNull] IContextBoundSettingsStore settings,
            out bool replacesStandardContent)
        {
            replacesStandardContent = false;

            if (info == null)
            {
                return(null);
            }

            var          constructor = info.DeclaredElement as IConstructor;
            ITypeElement typeElement = constructor?.GetContainingType();

            if (typeElement == null)
            {
                return(null);
            }

            ConstructorReferenceDisplay display = settings.GetValue(GetConstructorSettingsKey(typeElement.IsAttribute()));

            switch (display)
            {
            case ConstructorReferenceDisplay.TypeOnly:
                replacesStandardContent = true;
                return(TryGetTypeIdentifierContentFromConstructor(constructor, info, settings));

            case ConstructorReferenceDisplay.Both:
                return(TryGetTypeIdentifierContentFromConstructor(constructor, info, settings));

            default:
                return(null);
            }
        }