private static async Task<InconsistentAccessibilityInfo> GetInconsistentAccessibilityInfoAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken)
        {
            InconsistentAccessibilityInfoProvider inconsistentAccessibilityProvider = null;

            switch (diagnostic.Id)
            {
                case InconsistentAccessibilityInMethodReturnTypeCompilerErrorNumber:
                    inconsistentAccessibilityProvider = new InconsistentAccessibilityInMethodReturnType();
                    break;
                case InconsistentAccessibilityInMethodParameterCompilerErrorNumber:
                    inconsistentAccessibilityProvider = new InconsistentAccessibilityInMethodParameter();
                    break;
                case InconsistentAccessibilityInFieldTypeCompilerErrorNumber:
                    inconsistentAccessibilityProvider = new InconsistentAccessibilityInFieldType();
                    break;
                case InconsistentAccessibilityInPropertyTypeCompilerErrorNumber:
                    inconsistentAccessibilityProvider = new InconsistentAccessibilityInPropertyType();
                    break;
                case InconsistentAccessibilityInIndexerReturnTypeCompilerErrorNumber:
                    inconsistentAccessibilityProvider = new InconsistentAccessibilityInIndexerReturnType();
                    break;
                case InconsistentAccessibilityInIndexerParameterCompilerErrorNumber:
                    inconsistentAccessibilityProvider = new InconsistentAccessibilityInIndexerParameter();
                    break;
            }

            return await inconsistentAccessibilityProvider.GetInconsistentAccessibilityInfoAsync(document, diagnostic, cancellationToken).ConfigureAwait(false);
        }
Exemplo n.º 2
0
        private static async Task <InconsistentAccessibilityInfo> GetInconsistentAccessibilityInfoAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken)
        {
            InconsistentAccessibilityInfoProvider inconsistentAccessibilityProvider = null;

            switch (diagnostic.Id)
            {
            case InconsistentAccessibilityInMethodReturnTypeCompilerErrorNumber:
                inconsistentAccessibilityProvider = new InconsistentAccessibilityInMethodReturnType();
                break;

            case InconsistentAccessibilityInMethodParameterCompilerErrorNumber:
                inconsistentAccessibilityProvider = new InconsistentAccessibilityInMethodParameter();
                break;

            case InconsistentAccessibilityInFieldTypeCompilerErrorNumber:
                inconsistentAccessibilityProvider = new InconsistentAccessibilityInFieldType();
                break;

            case InconsistentAccessibilityInPropertyTypeCompilerErrorNumber:
                inconsistentAccessibilityProvider = new InconsistentAccessibilityInPropertyType();
                break;

            case InconsistentAccessibilityInIndexerReturnTypeCompilerErrorNumber:
                inconsistentAccessibilityProvider = new InconsistentAccessibilityInIndexerReturnType();
                break;

            case InconsistentAccessibilityInIndexerParameterCompilerErrorNumber:
                inconsistentAccessibilityProvider = new InconsistentAccessibilityInIndexerParameter();
                break;
            }

            return(await inconsistentAccessibilityProvider.GetInconsistentAccessibilityInfoAsync(document, diagnostic, cancellationToken).ConfigureAwait(false));
        }