4399 references to Accessibility
ConfigurationSchemaGenerator (8)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (2)
610if (candidate.DeclaredAccessibility is not Accessibility.Public) 852type.InstanceConstructors.SingleOrDefault(ctor => ctor.DeclaredAccessibility is Accessibility.Public && ctor.Parameters.Length is 0) is not null;
RuntimeSource\Configuration.Binder\Specs\Members\PropertySpec.cs (2)
14bool setterIsPublic = setMethod?.DeclaredAccessibility is Accessibility.Public; 20CanGet = property.GetMethod?.DeclaredAccessibility is Accessibility.Public;
RuntimeSource\Roslyn\GetBestTypeByMetadataName.cs (4)
120case Accessibility.NotApplicable: 121case Accessibility.Private: 126case Accessibility.Internal: 127case Accessibility.ProtectedAndInternal:
ILLink.CodeFixProvider (3)
BaseAttributeCodeFixProvider.cs (3)
136 if (m is not { DeclaredAccessibility: Accessibility.Public or Accessibility.Protected }) { 140 if (t.DeclaredAccessibility != Accessibility.Public) {
ILLink.RoslynAnalyzer (28)
CompilationExtensions.cs (4)
102 case Accessibility.NotApplicable: 103 case Accessibility.Private: 108 case Accessibility.Internal: 109 case Accessibility.ProtectedAndInternal:
DataFlow\DynamicallyAccessedMembersBinder.cs (23)
45 foreach (var c in typeDefinition.GetConstructorsOnType (filter: m => (m.DeclaredAccessibility == Accessibility.Public) && m.Parameters.Length == 0)) 136 if ((bindingFlags & (BindingFlags.Public | BindingFlags.NonPublic)) == BindingFlags.Public && method.DeclaredAccessibility != Accessibility.Public) 139 if ((bindingFlags & (BindingFlags.Public | BindingFlags.NonPublic)) == BindingFlags.NonPublic && method.DeclaredAccessibility == Accessibility.Public) 158 if (onBaseType && method.DeclaredAccessibility == Accessibility.Private) 172 if ((bindingFlags & (BindingFlags.Public | BindingFlags.NonPublic)) == BindingFlags.Public && method.DeclaredAccessibility != Accessibility.Public) 175 if ((bindingFlags & (BindingFlags.Public | BindingFlags.NonPublic)) == BindingFlags.NonPublic && method.DeclaredAccessibility == Accessibility.Public) 197 if (onBaseType && field.DeclaredAccessibility == Accessibility.Private) 211 if ((bindingFlags & (BindingFlags.Public | BindingFlags.NonPublic)) == BindingFlags.Public && field.DeclaredAccessibility != Accessibility.Public) 214 if ((bindingFlags & (BindingFlags.Public | BindingFlags.NonPublic)) == BindingFlags.NonPublic && field.DeclaredAccessibility == Accessibility.Public) 235 if (nestedType.DeclaredAccessibility != Accessibility.Public) 240 if (nestedType.DeclaredAccessibility == Accessibility.Public) 258 (property.GetMethod == null || property.GetMethod.DeclaredAccessibility == Accessibility.Private) && 259 (property.SetMethod == null || property.SetMethod.DeclaredAccessibility == Accessibility.Private)) 276 if ((property.GetMethod == null || (property.GetMethod.DeclaredAccessibility != Accessibility.Public)) 277 && (property.SetMethod == null || (property.SetMethod.DeclaredAccessibility != Accessibility.Public))) 282 if ((property.GetMethod != null) && (property.GetMethod.DeclaredAccessibility == Accessibility.Public)) continue; 283 if ((property.SetMethod != null) && (property.SetMethod.DeclaredAccessibility == Accessibility.Public)) continue; 308 (@event.AddMethod == null || @event.AddMethod.DeclaredAccessibility == Accessibility.Private) && 309 (@event.RemoveMethod == null || @event.RemoveMethod.DeclaredAccessibility == Accessibility.Private)) 326 if ((@event.AddMethod == null || (@event.AddMethod.DeclaredAccessibility != Accessibility.Public)) 327 && (@event.RemoveMethod == null || (@event.RemoveMethod.DeclaredAccessibility != Accessibility.Public))) 332 if ((@event.AddMethod != null) && @event.AddMethod.DeclaredAccessibility == Accessibility.Public) continue; 333 if ((@event.RemoveMethod != null) && @event.RemoveMethod.DeclaredAccessibility == Accessibility.Public) continue;
TrimAnalysis\ReflectionAccessAnalyzer.cs (1)
82 foreach (var c in typeSymbol.GetConstructorsOnType (filter: m => (m.DeclaredAccessibility == Accessibility.Public) && m.Parameters.Length == 0))
Microsoft.Analyzers.Extra (7)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (1)
589accessibility: Accessibility.Internal,
MakeExeTypesInternalAnalyzer.cs (1)
94if (type.DeclaredAccessibility == Accessibility.Public && type.ContainingType == null)
MakeExeTypesInternalFixer.cs (1)
40editor.SetAccessibility(decl, Accessibility.Internal);
Utilities\SymbolExtensions.cs (4)
44case Accessibility.NotApplicable: 45case Accessibility.Private: 50case Accessibility.Internal: 51case Accessibility.ProtectedAndInternal:
Microsoft.Analyzers.Local (4)
Utilities\SymbolExtensions.cs (4)
20case Accessibility.NotApplicable: 21case Accessibility.Private: 26case Accessibility.Internal: 27case Accessibility.ProtectedAndInternal:
Microsoft.AspNetCore.Analyzers (2)
StartupFacts.cs (2)
60if (symbol.DeclaredAccessibility != Accessibility.Public) 98if (symbol.DeclaredAccessibility != Accessibility.Public)
Microsoft.AspNetCore.App.Analyzers (6)
src\Shared\Roslyn\MvcFacts.cs (2)
28if (type.DeclaredAccessibility != Accessibility.Public) 98return method.DeclaredAccessibility == Accessibility.Public;
src\Shared\RoslynUtils\ParsabilityHelper.cs (4)
96return methodSymbol.DeclaredAccessibility == Accessibility.Public && 106return methodSymbol.DeclaredAccessibility == Accessibility.Public && 136return methodSymbol.DeclaredAccessibility == Accessibility.Public && 147return methodSymbol.DeclaredAccessibility == Accessibility.Public &&
Microsoft.AspNetCore.App.SourceGenerators (1)
PublicTopLevelProgramGenerator.cs (1)
26.Select(static (symbol, _) => symbol?.DeclaredAccessibility == Accessibility.Public ? null : symbol)
Microsoft.AspNetCore.Components.Analyzers (2)
ComponentParameterAnalyzer.cs (2)
82if (property.DeclaredAccessibility != Accessibility.Public) 89else if (property.SetMethod?.DeclaredAccessibility != Accessibility.Public)
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
ComponentParameterAnalyzer.cs (2)
76if (property.DeclaredAccessibility != Accessibility.Public) 83else if (property.SetMethod?.DeclaredAccessibility != Accessibility.Public)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (12)
src\Shared\RoslynUtils\ParsabilityHelper.cs (4)
96return methodSymbol.DeclaredAccessibility == Accessibility.Public && 106return methodSymbol.DeclaredAccessibility == Accessibility.Public && 136return methodSymbol.DeclaredAccessibility == Accessibility.Public && 147return methodSymbol.DeclaredAccessibility == Accessibility.Public &&
StaticRouteHandlerModel\Emitters\DiagnosticEmitter.cs (6)
19if (response.ResponseType?.DeclaredAccessibility is Accessibility.Private or Accessibility.Protected) 40if (typeSymbol.DeclaredAccessibility is Accessibility.Private or Accessibility.Protected || 43typeArg.DeclaredAccessibility is Accessibility.Private or Accessibility.Protected))
StaticRouteHandlerModel\EndpointParameter.cs (2)
469var constructors = type.Constructors.Where(constructor => constructor.DeclaredAccessibility == Accessibility.Public && !constructor.IsStatic); 473var properties = type.GetMembers().OfType<IPropertySymbol>().Where(property => property.DeclaredAccessibility == Accessibility.Public);
Microsoft.AspNetCore.Mvc.Analyzers (4)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
72method.DeclaredAccessibility == Accessibility.Public;
src\Shared\Roslyn\MvcFacts.cs (2)
28if (type.DeclaredAccessibility != Accessibility.Public) 98return method.DeclaredAccessibility == Accessibility.Public;
TopLevelParameterNameAnalyzer.cs (1)
110if (member.DeclaredAccessibility != Accessibility.Public ||
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
src\Shared\Roslyn\MvcFacts.cs (2)
28if (type.DeclaredAccessibility != Accessibility.Public) 98return method.DeclaredAccessibility == Accessibility.Public;
SymbolApiResponseMetadataProvider.cs (2)
111.FirstOrDefault(m => m.Kind == SymbolKind.Method && m.IsStatic && m.DeclaredAccessibility == Accessibility.Public); 125if (!conventionMethod.IsStatic || conventionMethod.DeclaredAccessibility != Accessibility.Public)
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (6)
GeneratorHelpers.cs (6)
10public static string GetAccessibilityString(Accessibility accessibility) 14case Accessibility.Private: 16case Accessibility.ProtectedAndInternal: 18case Accessibility.Protected: 20case Accessibility.Internal: 22case Accessibility.Public:
Microsoft.CodeAnalysis (6)
Symbols\ISymbol.cs (2)
199/// Gets a <see cref="Accessibility"/> indicating the declared accessibility for the symbol. 202Accessibility DeclaredAccessibility { get; }
Symbols\ISymbolExtensions.cs (2)
152if (scopeType is not INamedTypeSymbol { Name: WellKnownMemberNames.LockScopeTypeName, Arity: 0, IsValueType: true, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public } || 183DeclaredAccessibility: Accessibility.Public,
Symbols\ISymbolInternal.cs (2)
124/// Gets a <see cref="Accessibility"/> indicating the declared accessibility for the symbol. 127Accessibility DeclaredAccessibility { get; }
Microsoft.CodeAnalysis.CodeStyle (128)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
161DeclaredAccessibility: Accessibility.Private,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
762if (memberSymbol.DeclaredAccessibility == Accessibility.Private &&
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (3)
135DeclaredAccessibility: Accessibility.Private, 399if (getterField.DeclaredAccessibility != Accessibility.Private) 569if (result.Property.DeclaredAccessibility != Accessibility.Private &&
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
39.FirstOrDefault(m => m.DeclaredAccessibility == Accessibility.Public &&
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
98.FirstOrDefault(m => m is { DeclaredAccessibility: Accessibility.Public, Parameters.Length: 2 });
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (1)
184DeclaredAccessibility: Accessibility.Private,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\NamingStyles\NamingStyleOption.cs (1)
38EditorConfigOption<ImmutableArray<Accessibility>> Accessibilities,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AccessibilityUtilities.cs (19)
9public static Accessibility Minimum(Accessibility accessibility1, Accessibility accessibility2) 11if (accessibility1 == Accessibility.Private || accessibility2 == Accessibility.Private) 13return Accessibility.Private; 16if (accessibility1 == Accessibility.ProtectedAndInternal || accessibility2 == Accessibility.ProtectedAndInternal) 18return Accessibility.ProtectedAndInternal; 21if (accessibility1 == Accessibility.Protected || accessibility2 == Accessibility.Protected) 23return Accessibility.Protected; 26if (accessibility1 == Accessibility.Internal || accessibility2 == Accessibility.Internal) 28return Accessibility.Internal; 31if (accessibility1 == Accessibility.ProtectedOrInternal || accessibility2 == Accessibility.ProtectedOrInternal) 33return Accessibility.ProtectedOrInternal; 36return Accessibility.Public;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (3)
199m => m.DeclaredAccessibility is Accessibility.Public or Accessibility.Protected && 223return accessor != null && IsImplementable(accessor) && accessor.DeclaredAccessibility != Accessibility.Public;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (14)
55case Accessibility.NotApplicable: 56case Accessibility.Private: 61case Accessibility.Internal: 62case Accessibility.ProtectedAndInternal: 565public static Accessibility ComputeResultantAccessibility(this ISymbol? symbol, ITypeSymbol finalDestination) 569return Accessibility.Private; 576case Accessibility.ProtectedAndInternal: 578? Accessibility.ProtectedAndInternal 579: Accessibility.Internal; 580case Accessibility.ProtectedOrInternal: 582? Accessibility.ProtectedOrInternal 583: Accessibility.Protected; 718.Where(x => x.DeclaredAccessibility == Accessibility.Public) 758.Where(x => x.DeclaredAccessibility == Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (16)
211Accessibility declaredAccessibility, 220case Accessibility.NotApplicable: 221case Accessibility.Public: 225case Accessibility.Private: 226case Accessibility.Protected: 227case Accessibility.ProtectedAndInternal: 231case Accessibility.Internal: 232case Accessibility.ProtectedOrInternal: 246Accessibility declaredAccessibility, 268case Accessibility.NotApplicable: 275case Accessibility.Public: 279case Accessibility.Private: 292case Accessibility.Internal: 297case Accessibility.ProtectedAndInternal: 308case Accessibility.ProtectedOrInternal: 320case Accessibility.Protected:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
310public static Accessibility DetermineMinimalAccessibility(this ITypeSymbol typeSymbol) 700hasPrivateField |= fieldSymbol.DeclaredAccessibility == Accessibility.Private;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (14)
11private sealed class MinimalAccessibilityVisitor : SymbolVisitor<Accessibility> 13public static readonly SymbolVisitor<Accessibility> Instance = new MinimalAccessibilityVisitor(); 15public override Accessibility DefaultVisit(ISymbol node) 18public override Accessibility VisitAlias(IAliasSymbol symbol) 21public override Accessibility VisitArrayType(IArrayTypeSymbol symbol) 24public override Accessibility VisitDynamicType(IDynamicTypeSymbol symbol) 25=> Accessibility.Public; 27public override Accessibility VisitFunctionPointerType(IFunctionPointerTypeSymbol symbol) 29var accessibility = symbol.DeclaredAccessibility; 48public override Accessibility VisitNamedType(INamedTypeSymbol symbol) 50var accessibility = symbol.DeclaredAccessibility; 65public override Accessibility VisitPointerType(IPointerTypeSymbol symbol) 68public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol) 71return Accessibility.Public;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (28)
73(ImmutableArray<Accessibility> accessibilities, TData data), 208private static (ImmutableArray<Accessibility> accessibilities, TData data) GetSymbolsApplicableAccessibilities<T, TData>( 223private static readonly ImmutableArray<Accessibility> s_allAccessibility = 225Accessibility.NotApplicable, 226Accessibility.Public, 227Accessibility.Internal, 228Accessibility.Private, 229Accessibility.Protected, 230Accessibility.ProtectedAndInternal, 231Accessibility.ProtectedOrInternal, 234private static ImmutableArray<Accessibility> ParseAccessibilityKindList(string symbolSpecApplicableAccessibilities) 246var builder = ArrayBuilder<Accessibility>.GetInstance(); 252builder.Add(Accessibility.Public); 256builder.Add(Accessibility.Internal); 259builder.Add(Accessibility.Private); 262builder.Add(Accessibility.Protected); 266builder.Add(Accessibility.ProtectedOrInternal); 269builder.Add(Accessibility.ProtectedAndInternal); 272builder.Add(Accessibility.NotApplicable); 444public static string ToEditorConfigString(this ImmutableArray<Accessibility> accessibilities, string languageName) 459private static string ToEditorConfigString(this Accessibility accessibility, string languageName) 463case Accessibility.NotApplicable: 466case Accessibility.Private: 469case Accessibility.ProtectedAndInternal: 472case Accessibility.Protected: 475case Accessibility.Internal: 485case Accessibility.ProtectedOrInternal: 495case Accessibility.Public:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
84if (symbol.DeclaredAccessibility != Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (20)
32ImmutableArray<Accessibility> accessibilityList = default, 47public ImmutableArray<Accessibility> ApplicableAccessibilityList { get; } = accessibilityList.IsDefault ? DefaultSymbolSpecificationTemplate.ApplicableAccessibilityList : accessibilityList; 85Accessibility.NotApplicable, 86Accessibility.Public, 87Accessibility.Internal, 88Accessibility.Private, 89Accessibility.Protected, 90Accessibility.ProtectedAndInternal, 91Accessibility.ProtectedOrInternal, 101public bool AppliesTo(SymbolKind symbolKind, Accessibility accessibility) 104public bool AppliesTo(SymbolKindOrTypeKind kind, DeclarationModifiers modifiers, Accessibility? accessibility) 158private static Accessibility GetAccessibility(ISymbol symbol) 165return Accessibility.Public; 177return Accessibility.NotApplicable; 188return Accessibility.NotApplicable; 242reader.ReadArray(r => (Accessibility)r.ReadInt32()), 311private static ImmutableArray<Accessibility> GetAccessibilityListFromXElement(XElement accessibilityListElement) 314private static Accessibility ParseAccessibility(XElement accessibilityElement) 315=> (Accessibility)Enum.Parse(typeof(Accessibility), accessibilityElement.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\IAccessibilityFacts.cs (1)
15Accessibility GetAccessibility(SyntaxNode declaration);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (1)
68(method2 == null || method2.DeclaredAccessibility != Accessibility.Public);
Microsoft.CodeAnalysis.CodeStyle.Fixes (145)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (8)
19var preferredAccessibility = GetPreferredAccessibility(symbol); 29SyntaxNode UpdateAccessibility(SyntaxNode declaration, Accessibility preferredAccessibility) 35return generator.GetAccessibility(declaration) == Accessibility.NotApplicable 37: generator.WithAccessibility(declaration, Accessibility.NotApplicable); 41private static Accessibility GetPreferredAccessibility(ISymbol symbol) 53return Accessibility.Public; 56return Accessibility.Protected; 59return Accessibility.Public;
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
54if (method.DeclaredAccessibility != Accessibility.Public)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (5)
143case Accessibility.ProtectedOrInternal: 144case Accessibility.Protected: 145case Accessibility.Public: 147case Accessibility.ProtectedAndInternal: 148case Accessibility.Internal:
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (4)
79var parameterNamingRule = await document.Document.GetApplicableNamingRuleAsync(SymbolKind.Parameter, Accessibility.NotApplicable, cancellationToken).ConfigureAwait(false); 445accessibility: Accessibility.Public, 509TypeToGenerateIn.IsAbstractClass() ? Accessibility.Protected : Accessibility.Public,
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (13)
67case Accessibility.ProtectedOrInternal: 68case Accessibility.Protected: 69case Accessibility.Public: 71case Accessibility.ProtectedAndInternal: 72case Accessibility.Internal: 143var fieldNamingRule = await document.Document.GetApplicableNamingRuleAsync(SymbolKind.Field, Accessibility.Private, cancellationToken).ConfigureAwait(false); 144var propertyNamingRule = await document.Document.GetApplicableNamingRuleAsync(SymbolKind.Property, Accessibility.Public, cancellationToken).ConfigureAwait(false); 145var parameterNamingRule = await document.Document.GetApplicableNamingRuleAsync(SymbolKind.Parameter, Accessibility.NotApplicable, cancellationToken).ConfigureAwait(false); 332case Accessibility.ProtectedOrInternal: 333case Accessibility.Protected: 334case Accessibility.Public: 336case Accessibility.ProtectedAndInternal: 337case Accessibility.Internal:
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (10)
62var accessibility = DetermineAccessibility(baseConstructor, classType); 80private static Accessibility DetermineAccessibility(IMethodSymbol baseConstructor, INamedTypeSymbol classType) 85return Accessibility.Public; 89if (classType.IsAbstractClass() && baseConstructor.DeclaredAccessibility == Accessibility.Public) 90return Accessibility.Protected; 97case Accessibility.Protected: 98return Accessibility.Public; 99case Accessibility.ProtectedAndInternal: 100case Accessibility.ProtectedOrInternal: 101return Accessibility.Internal;
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
42accessibility: Accessibility.Public,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (8)
75var accessibility = DetermineAccessibility(isAbstract); 229private Accessibility DetermineAccessibility(bool isAbstract) 240return isAbstract ? Accessibility.Protected : Accessibility.Private; 262return Accessibility.Protected; 266return Accessibility.Internal; 271return Accessibility.Public; 275return Accessibility.NotApplicable;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (8)
106private IMethodSymbol CreateAccessor(Accessibility accessibility) 126private Accessibility DetermineMinimalAccessibility(State state) 130return Accessibility.NotApplicable; 138return Accessibility.Public; 142return Accessibility.Private; 162return Accessibility.Protected; 166return Accessibility.Internal; 171return Accessibility.Public;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (3)
116Document document, State state, SymbolKind kind, Accessibility accessibility, CancellationToken cancellationToken) 182document, state, SymbolKind.Local, Accessibility.NotApplicable, cancellationToken).ConfigureAwait(false)) 198document, state, SymbolKind.Parameter, Accessibility.NotApplicable, cancellationToken).ConfigureAwait(false))
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (4)
83public Accessibility DetermineMaximalAccessibility() 86return Accessibility.NotApplicable; 88var accessibility = Accessibility.Public;
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (4)
178DeclarationModifiers modifiers, Accessibility accessibility) 200Accessibility accessibility, 239IEventSymbol @event, ISymbol? throughMember, Accessibility accessibility, DeclarationModifiers modifiers) 263accessibility: Accessibility.NotApplicable,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (4)
125if (first.DeclaredAccessibility <= Accessibility.NotApplicable || 126second.DeclaredAccessibility <= Accessibility.NotApplicable) 193if (first.DeclaredAccessibility <= Accessibility.NotApplicable || 194second.DeclaredAccessibility <= Accessibility.NotApplicable)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (6)
299var accessibility = member.Name == memberName || generateAbstractly 300? Accessibility.Public 301: Accessibility.Private; 312private ISymbol GenerateEvent(Compilation compilation, string memberName, bool generateInvisibly, SyntaxGenerator factory, DeclarationModifiers modifiers, bool useExplicitInterfaceSymbol, Accessibility accessibility, IEventSymbol @event) 316accessibility: Accessibility.NotApplicable, 342accessibility: Accessibility.NotApplicable,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (9)
140var accessibility = State.ClassOrStructType.IsSealed 141? Accessibility.Private 142: Accessibility.Protected; 225accessibility: Explicitly ? Accessibility.NotApplicable : Accessibility.Public, 240SymbolKind.Field, Accessibility.Private, cancellationToken).ConfigureAwait(false); 245var accessibilityLevel = options.AccessibilityModifiersRequired is AccessibilityModifiersRequired.Never or AccessibilityModifiersRequired.OmitIfDefault 246? Accessibility.NotApplicable 247: Accessibility.Private;
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (1)
28Accessibility accessibility,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Property.cs (3)
33Accessibility accessibility, 97Accessibility accessibility, 131Accessibility accessibility,
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
88Accessibility.Private,
src\Analyzers\Core\CodeFixes\Naming\NamingExtensions.cs (1)
18this Document document, SymbolKind symbolKind, Accessibility accessibility, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (2)
110public TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 139public abstract TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (20)
34ImmutableArray<AttributeData> attributes, Accessibility accessibility, 50Accessibility accessibility, 83ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, 109Accessibility accessibility, 126Accessibility accessibility, 155Accessibility accessibility, 178ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, 198Accessibility accessibility, 235accessibility: Accessibility.Public, 251Accessibility accessibility, 364Accessibility? accessibility = null, 389Accessibility accessibility, 421Accessibility accessibility, 440Accessibility accessibility, 466Accessibility accessibility, 477accessibility: Accessibility.Public, 518Accessibility? accessibility = null, 549Accessibility? accessibility = null, 576Accessibility? accessibility = null, 597Accessibility? accessibility = null,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (1)
114TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
30Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
31Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (1)
10internal sealed class CodeGenerationArrayTypeSymbol(ITypeSymbol elementType, int rank, NullableAnnotation nullableAnnotation) : CodeGenerationTypeSymbol(null, null, default, Accessibility.NotApplicable, default, string.Empty, SpecialType.None, nullableAnnotation), IArrayTypeSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (1)
20Accessibility accessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (1)
20Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (1)
15Accessibility.NotApplicable,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationEventSymbol.cs (1)
18Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationFieldSymbol.cs (1)
20Accessibility accessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
30Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
31Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
23Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceSymbol.cs (1)
14internal sealed class CodeGenerationNamespaceSymbol(string name, IList<INamespaceOrTypeSymbol> members) : CodeGenerationNamespaceOrTypeSymbol(null, null, default, Accessibility.NotApplicable, default, name), INamespaceSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (1)
21Accessibility accessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationParameterSymbol.cs (1)
26object defaultValue) : CodeGenerationSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, new DeclarationModifiers(), name), IParameterSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (1)
9internal sealed class CodeGenerationPointerTypeSymbol(ITypeSymbol pointedAtType) : CodeGenerationTypeSymbol(null, null, default, Accessibility.NotApplicable, default, string.Empty, SpecialType.None, NullableAnnotation.None), IPointerTypeSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertySymbol.cs (1)
20Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
29public Accessibility DeclaredAccessibility { get; } 38Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
21Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
303accessibility: Accessibility.Private, 325accessibility: Accessibility.Public,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (3)
53accessibility: Accessibility.Public, 445method.DeclaredAccessibility == Accessibility.Public && 463Accessibility accessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
207method.DeclaredAccessibility == Accessibility.Public &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (2)
133.FirstOrDefault(m => m is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, ReturnType: var returnType, Parameters.Length: 0 } && 149.FirstOrDefault(m => m is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, ReturnsVoid: true, Parameters.Length: 0 }) is IMethodSymbol disposeMethodFromPattern)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (4)
src\Features\DiagnosticsTestUtilities\NamingStyles\NamingStylesTestOptionSets.cs (4)
95internal OptionsCollection MethodNamesWithAccessibilityArePascalCase(ImmutableArray<Accessibility> accessibilities) 125internal OptionsCollection AccessibilitiesArePascalCase(ImmutableArray<Accessibility> accessibilities) 323private static NamingStylePreferences MethodNamesArePascalCaseOption(ImmutableArray<Accessibility> accessibilities) 385private static NamingStylePreferences AccessibilitiesArePascalCaseOption(ImmutableArray<Accessibility> accessibilities)
Microsoft.CodeAnalysis.CSharp (383)
Binder\Binder_Attributes.cs (3)
621invalidNamedArgument |= (namedArgumentNameSymbol.DeclaredAccessibility != Accessibility.Public); 645getMethod!.DeclaredAccessibility != Accessibility.Public || 646setMethod!.DeclaredAccessibility != Accessibility.Public;
Binder\Binder_Expressions.cs (3)
8733case Accessibility.Protected: 8734case Accessibility.ProtectedOrInternal: 8735case Accessibility.ProtectedAndInternal:
Binder\Binder_Lookup.cs (4)
1505if ((unwrappedSymbol.DeclaredAccessibility == Accessibility.Internal || 1506unwrappedSymbol.DeclaredAccessibility == Accessibility.ProtectedAndInternal || 1507unwrappedSymbol.DeclaredAccessibility == Accessibility.ProtectedOrInternal) 1654if (s.DeclaredAccessibility == Accessibility.Private)
Binder\Binder_Operators.cs (1)
1277if (op.ParameterCount == 1 && op.DeclaredAccessibility == Accessibility.Public)
Binder\ForEachLoopBinder.cs (3)
1445if (result.IsStatic || result.DeclaredAccessibility != Accessibility.Public) 1649if (lookupSymbol.IsStatic || lookupSymbol.DeclaredAccessibility != Accessibility.Public || lookupSymbol.Kind != SymbolKind.Property) 1682moveNextMethodCandidate.Method.IsStatic || moveNextMethodCandidate.Method.DeclaredAccessibility != Accessibility.Public ||
Binder\LockBinder.cs (2)
87if (scopeType is not NamedTypeSymbol { Name: WellKnownMemberNames.LockScopeTypeName, Arity: 0, IsValueType: true, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public } || 121DeclaredAccessibility: Accessibility.Public,
Binder\PatternExplainer.cs (1)
653if (declaredMember is FieldSymbol { IsConst: true, IsStatic: true, DeclaredAccessibility: Accessibility.Public } field &&
Binder\Semantics\AccessCheck.cs (23)
92case Accessibility.Public: 93case Accessibility.Protected: 94case Accessibility.ProtectedOrInternal: 96case Accessibility.Internal: 97case Accessibility.ProtectedAndInternal: 100case Accessibility.Private: 258Accessibility declaredAccessibility, 266case Accessibility.NotApplicable: 267case Accessibility.Public: 271case Accessibility.Private: 272case Accessibility.Protected: 273case Accessibility.ProtectedAndInternal: 277case Accessibility.Internal: 278case Accessibility.ProtectedOrInternal: 299Accessibility declaredAccessibility, 325if (declaredAccessibility == Accessibility.Public) 343Accessibility declaredAccessibility, 359case Accessibility.NotApplicable: 362case Accessibility.Private: 375case Accessibility.Internal: 380case Accessibility.ProtectedAndInternal: 391case Accessibility.ProtectedOrInternal: 403case Accessibility.Protected:
Compiler\ClsComplianceChecker.cs (7)
1237case Accessibility.Public: 1238case Accessibility.Protected: 1239case Accessibility.ProtectedOrInternal: 1241case Accessibility.Private: 1242case Accessibility.ProtectedAndInternal: 1243case Accessibility.Internal: 1245case Accessibility.NotApplicable:
Compiler\DocumentationCommentCompiler.cs (3)
669case Accessibility.Public: 670case Accessibility.Protected: 671case Accessibility.ProtectedOrInternal:
Compiler\MethodBodySynthesizer.cs (3)
603Accessibility accessibility = baseTypeMethod.DeclaredAccessibility; 604if ((accessibility == Accessibility.ProtectedOrInternal || accessibility == Accessibility.Protected) &&
Emitter\Model\AttributeDataAdapter.cs (1)
185if (member.DeclaredAccessibility == Accessibility.Public)
Emitter\Model\MethodSymbolAdapter.cs (4)
597Accessibility accessibility = this.DeclaredAccessibility; 598return (accessibility == Accessibility.Private || 599accessibility == Accessibility.ProtectedAndInternal || 600accessibility == Accessibility.Internal)
Emitter\Model\PEModuleBuilder.cs (2)
586if (symbol.DeclaredAccessibility != Accessibility.Public) 777if (type.DeclaredAccessibility == Accessibility.Private)
Emitter\NoPia\EmbeddedType.cs (1)
78return UnderlyingNamedType.AdaptedNamedTypeSymbol.DeclaredAccessibility == Accessibility.Public;
Emitter\NoPia\EmbeddedTypesManager.cs (1)
458(containerKind == TypeKind.Struct && (field.AdaptedFieldSymbol.IsStatic || field.AdaptedFieldSymbol.DeclaredAccessibility != Accessibility.Public)))
FlowAnalysis\EmptyStructTypeCache.cs (3)
258case Accessibility.Internal: 259case Accessibility.ProtectedAndInternal: 263case Accessibility.Private:
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (3)
339private static NamedTypeSymbol ValidateBuilderType(SyntheticBoundNodeFactory F, TypeSymbol builderAttributeArgument, Accessibility desiredAccessibility, bool isGeneric, bool forMethodLevelBuilder = false) 484if ((method.DeclaredAccessibility == Accessibility.Public) && 512if ((property.DeclaredAccessibility == Accessibility.Public) &&
Lowering\IteratorRewriter\IteratorConstructor.cs (2)
44public override Accessibility DeclaredAccessibility 46get { return Accessibility.Public; }
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (2)
209public override Accessibility DeclaredAccessibility 211get { return Accessibility.Private; }
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.cs (1)
119public override Accessibility DeclaredAccessibility
SymbolDisplay\SymbolDisplayVisitor.cs (6)
395case Accessibility.Private: 398case Accessibility.Internal: 401case Accessibility.ProtectedAndInternal: 406case Accessibility.Protected: 409case Accessibility.ProtectedOrInternal: 414case Accessibility.Public:
Symbols\AccessibilityExtensions.cs (4)
13public static bool HasProtected(this Accessibility accessibility) 17case Accessibility.Protected: 18case Accessibility.ProtectedOrInternal: 19case Accessibility.ProtectedAndInternal:
Symbols\AliasSymbol.cs (2)
192public override Accessibility DeclaredAccessibility 196return Accessibility.NotApplicable;
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (2)
147public sealed override Accessibility DeclaredAccessibility 149get { return Accessibility.Internal; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (2)
131public override Accessibility DeclaredAccessibility 133get { return Accessibility.Private; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (2)
179public override Accessibility DeclaredAccessibility 181get { return Accessibility.Public; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (2)
59public sealed override Accessibility DeclaredAccessibility 61get { return Accessibility.Public; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeOrDelegateTemplateSymbol.cs (2)
200public sealed override Accessibility DeclaredAccessibility 202get { return Accessibility.Internal; }
Symbols\ArrayTypeSymbol.cs (2)
418public override Accessibility DeclaredAccessibility 422return Accessibility.NotApplicable;
Symbols\AssemblySymbol.cs (3)
225public sealed override Accessibility DeclaredAccessibility 229return Accessibility.NotApplicable; 1037return result.DeclaredAccessibility == Accessibility.Public || IsSymbolAccessible(result, this);
Symbols\Attributes\AttributeData.cs (2)
562property.DeclaredAccessibility == Accessibility.Public && property.GetMemberArity() == 0 && 563(object)property.SetMethod != null && property.SetMethod.DeclaredAccessibility == Accessibility.Public)
Symbols\Compilation_WellKnownMembers.cs (1)
296!(member.DeclaredAccessibility == Accessibility.Public || (accessWithinOpt is object && Symbol.IsSymbolAccessible(member, accessWithinOpt))))
Symbols\ConstraintsHelper.cs (1)
1496if (constructor.DeclaredAccessibility != Accessibility.Public)
Symbols\DiscardSymbol.cs (2)
22public override Accessibility DeclaredAccessibility => Accessibility.NotApplicable;
Symbols\DynamicTypeSymbol.cs (2)
175public override Accessibility DeclaredAccessibility 179return Accessibility.NotApplicable;
Symbols\ErrorMethodSymbol.cs (2)
86public override Accessibility DeclaredAccessibility 88get { return Accessibility.Public; }
Symbols\ErrorPropertySymbol.cs (2)
66public override Accessibility DeclaredAccessibility { get { return Accessibility.NotApplicable; } }
Symbols\ErrorTypeSymbol.cs (2)
374public sealed override Accessibility DeclaredAccessibility 378return Accessibility.NotApplicable;
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (3)
219else if (specifierType.DeclaredAccessibility != Accessibility.Public) 828public override Accessibility DeclaredAccessibility => Accessibility.NotApplicable;
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (2)
82public override Accessibility DeclaredAccessibility => Accessibility.NotApplicable;
Symbols\FunctionTypeSymbol.cs (1)
116public override Accessibility DeclaredAccessibility => throw ExceptionUtilities.Unreachable();
Symbols\LabelSymbol.cs (2)
96public override Accessibility DeclaredAccessibility 100return Accessibility.NotApplicable;
Symbols\LocalSymbol.cs (2)
178public sealed override Accessibility DeclaredAccessibility 182return Accessibility.NotApplicable;
Symbols\MemberSymbolExtensions.cs (1)
146return accessor.IsImplementable() && accessor.DeclaredAccessibility != Accessibility.Public;
Symbols\Metadata\PE\MetadataDecoder.cs (1)
378candidate.DeclaredAccessibility != Accessibility.Public)
Symbols\Metadata\PE\PEEventSymbol.cs (4)
160Debug.Assert(candidateAssociatedField.DeclaredAccessibility == Accessibility.Private); 261public override Accessibility DeclaredAccessibility 267Accessibility accessibility = PEPropertyOrEventHelpers.GetDeclaredAccessibilityFromAccessors(_addMethod, _removeMethod); 271return (Accessibility)_lazyDeclaredAccessibility;
Symbols\Metadata\PE\PEFieldSymbol.cs (10)
530public override Accessibility DeclaredAccessibility 534var access = Accessibility.Private; 539access = Accessibility.Internal; 543access = Accessibility.ProtectedOrInternal; 547access = Accessibility.ProtectedAndInternal; 552access = Accessibility.Private; 556access = Accessibility.Public; 560access = Accessibility.Protected; 564access = Accessibility.Private;
Symbols\Metadata\PE\PEMethodSymbol.cs (9)
490public override Accessibility DeclaredAccessibility 497return Accessibility.Internal; 500return Accessibility.ProtectedOrInternal; 503return Accessibility.ProtectedAndInternal; 507return Accessibility.Private; 510return Accessibility.Public; 513return Accessibility.Protected; 516return Accessibility.Private; 1204if (!this.HasRuntimeSpecialName && this.IsStatic && this.DeclaredAccessibility == Accessibility.Public)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (12)
345this.DeclaredAccessibility == Accessibility.Public) // NB: this.flags was set above. 635public override Accessibility DeclaredAccessibility 639Accessibility access = Accessibility.Private; 644access = Accessibility.Internal; 648access = Accessibility.ProtectedOrInternal; 652access = Accessibility.ProtectedAndInternal; 656access = Accessibility.Private; 661access = Accessibility.Public; 665access = Accessibility.Protected; 669access = Accessibility.Internal; 1966if (symbol.DeclaredAccessibility == Accessibility.Private)
Symbols\Metadata\PE\PEPropertySymbol.cs (17)
449public override Accessibility DeclaredAccessibility 455Accessibility accessibility; 481Accessibility getAccessibility = Accessibility.NotApplicable; 482Accessibility setAccessibility = Accessibility.NotApplicable; 486if (getAccessibility == Accessibility.NotApplicable) 491Accessibility overriddenAccessibility = getMethod.DeclaredAccessibility; 492getAccessibility = overriddenAccessibility == Accessibility.ProtectedOrInternal && crossedAssemblyBoundaryWithoutInternalsVisibleTo 493? Accessibility.Protected 498if (setAccessibility == Accessibility.NotApplicable) 503Accessibility overriddenAccessibility = setMethod.DeclaredAccessibility; 504setAccessibility = overriddenAccessibility == Accessibility.ProtectedOrInternal && crossedAssemblyBoundaryWithoutInternalsVisibleTo 505? Accessibility.Protected 510if (getAccessibility != Accessibility.NotApplicable && setAccessibility != Accessibility.NotApplicable) 540return (Accessibility)_declaredAccessibility;
Symbols\MetadataOrSourceAssemblySymbol.cs (1)
62if (result is null || result.DeclaredAccessibility != Accessibility.Public)
Symbols\ModuleSymbol.cs (2)
114public sealed override Accessibility DeclaredAccessibility 118return Accessibility.NotApplicable;
Symbols\NamedTypeSymbol.cs (1)
712public abstract override Accessibility DeclaredAccessibility { get; }
Symbols\NamespaceSymbol.cs (2)
163public sealed override Accessibility DeclaredAccessibility 168return Accessibility.Public;
Symbols\NativeIntegerTypeSymbol.cs (1)
83if (underlyingMember.DeclaredAccessibility != Accessibility.Public)
Symbols\ParameterSymbol.cs (2)
285public override Accessibility DeclaredAccessibility 289return Accessibility.NotApplicable;
Symbols\PointerTypeSymbol.cs (2)
33public override Accessibility DeclaredAccessibility 35get { return Accessibility.NotApplicable; }
Symbols\PropertyOrEventSymbolExtensions.cs (10)
60internal static Accessibility GetDeclaredAccessibilityFromAccessors(MethodSymbol accessor1, MethodSymbol accessor2) 64return ((object)accessor2 == null) ? Accessibility.NotApplicable : accessor2.DeclaredAccessibility; 74internal static Accessibility GetDeclaredAccessibilityFromAccessors(Accessibility accessibility1, Accessibility accessibility2) 76var minAccessibility = (accessibility1 > accessibility2) ? accessibility2 : accessibility1; 77var maxAccessibility = (accessibility1 > accessibility2) ? accessibility1 : accessibility2; 79return ((minAccessibility == Accessibility.Protected) && (maxAccessibility == Accessibility.Internal)) 80? Accessibility.ProtectedOrInternal
Symbols\PublicModel\PreprocessingSymbol.cs (2)
66Accessibility ISymbol.DeclaredAccessibility => Accessibility.NotApplicable;
Symbols\PublicModel\Symbol.cs (1)
125Accessibility ISymbol.DeclaredAccessibility
Symbols\RangeVariableSymbol.cs (2)
127public override Accessibility DeclaredAccessibility 131return Accessibility.NotApplicable;
Symbols\ReducedExtensionMethodSymbol.cs (1)
447public override Accessibility DeclaredAccessibility
Symbols\SignatureOnlyMethodSymbol.cs (1)
141public override Accessibility DeclaredAccessibility { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\SignatureOnlyPropertySymbol.cs (1)
78public override Accessibility DeclaredAccessibility { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
51public sealed override Accessibility DeclaredAccessibility
Symbols\Source\GlobalExpressionVariable.cs (1)
37Debug.Assert(DeclaredAccessibility == Accessibility.Private);
Symbols\Source\LambdaSymbol.cs (2)
214public override Accessibility DeclaredAccessibility 216get { return Accessibility.Private; }
Symbols\Source\LocalFunctionSymbol.cs (1)
356public override Accessibility DeclaredAccessibility => ModifierUtils.EffectiveAccessibility(_declarationModifiers);
Symbols\Source\ModifierUtils.cs (9)
518internal static Accessibility EffectiveAccessibility(DeclarationModifiers modifiers) 523return Accessibility.NotApplicable; // for explicit interface implementation 525return Accessibility.Private; 527return Accessibility.Protected; 529return Accessibility.Internal; 531return Accessibility.Public; 533return Accessibility.ProtectedOrInternal; 535return Accessibility.ProtectedAndInternal; 540return Accessibility.Public;
Symbols\Source\SourceAssemblySymbol.cs (1)
1895return !obj.IsErrorType() && obj.DeclaredAccessibility == Accessibility.Public;
Symbols\Source\SourceCustomEventAccessorSymbol.cs (1)
72public override Accessibility DeclaredAccessibility
Symbols\Source\SourceDelegateMethodSymbol.cs (1)
94if (delegateType.DeclaredAccessibility <= Accessibility.Private)
Symbols\Source\SourceEventSymbol.cs (2)
403public sealed override Accessibility DeclaredAccessibility 533if (this.DeclaredAccessibility == Accessibility.Private && (IsVirtual || (IsAbstract && !isExplicitInterfaceImplementationInInterface) || IsOverride))
Symbols\Source\SourceFixedFieldSymbol.cs (2)
231public override Accessibility DeclaredAccessibility 233get { return Accessibility.Public; }
Symbols\Source\SourceMemberContainerSymbol.cs (24)
717Accessibility containerEffectiveAccessibility = EffectiveAccessibility(); 727Accessibility fieldDeclaredAccessibility = field.DeclaredAccessibility; 728if (fieldDeclaredAccessibility == Accessibility.Private) 733else if (containerEffectiveAccessibility == Accessibility.Private) 738else if (fieldDeclaredAccessibility == Accessibility.Internal || containerEffectiveAccessibility == Accessibility.Internal) 880public override Accessibility DeclaredAccessibility 891private Accessibility EffectiveAccessibility() 893var result = DeclaredAccessibility; 894if (result == Accessibility.Private) return Accessibility.Private; 899case Accessibility.Private: 900return Accessibility.Private; 901case Accessibility.Internal: 902result = Accessibility.Internal; 4126if (m.DeclaredAccessibility != Accessibility.Public) 4325if (deconstruct.DeclaredAccessibility != Accessibility.Public) 4379if (!this.IsSealed && (constructor.DeclaredAccessibility != Accessibility.Public && constructor.DeclaredAccessibility != Accessibility.Protected)) 4424if (printMembersMethod.DeclaredAccessibility != Accessibility.Private) 4429else if (printMembersMethod.DeclaredAccessibility != Accessibility.Protected) 4686if (equalityContract.DeclaredAccessibility != Accessibility.Private) 4691else if (equalityContract.DeclaredAccessibility != Accessibility.Protected) 4752if (thisEquals.DeclaredAccessibility != Accessibility.Public)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (8)
1660case Accessibility.Internal: 1661case Accessibility.Private: 1662case Accessibility.ProtectedAndInternal: 1664case Accessibility.Public: 1665case Accessibility.ProtectedOrInternal: 1666case Accessibility.Protected: 1710overridden.DeclaredAccessibility == Accessibility.ProtectedOrInternal) 1712return overriding.DeclaredAccessibility == Accessibility.Protected;
Symbols\Source\SourceMemberMethodSymbol.cs (2)
340if (this.DeclaredAccessibility <= Accessibility.Private || MethodKind == MethodKind.ExplicitInterfaceImplementation) 579public override Accessibility DeclaredAccessibility
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
402if (DeclaredAccessibility != Accessibility.Private && IsInterface)
Symbols\Source\SourceNamespaceSymbol.cs (3)
370Accessibility declaredAccessibility = nts.DeclaredAccessibility; 371if (declaredAccessibility != Accessibility.Public && declaredAccessibility != Accessibility.Internal)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
823else if (this.DeclaredAccessibility == Accessibility.Private && (IsVirtual || (IsAbstract && !isExplicitInterfaceImplementationInInterface) || IsOverride))
Symbols\Source\SourcePropertyAccessorSymbol.cs (7)
299public sealed override Accessibility DeclaredAccessibility 303var accessibility = this.LocalAccessibility; 304if (accessibility != Accessibility.NotApplicable) 309var propertyAccessibility = _property.DeclaredAccessibility; 310Debug.Assert(propertyAccessibility != Accessibility.NotApplicable); 424internal Accessibility LocalAccessibility 527var localAccessibility = this.LocalAccessibility;
Symbols\Source\SourcePropertySymbolBase.cs (11)
682public override Accessibility DeclaredAccessibility 930else if ((_getMethod.LocalAccessibility != Accessibility.NotApplicable) && 931(_setMethod.LocalAccessibility != Accessibility.NotApplicable)) 974if (accessor.LocalAccessibility != Accessibility.NotApplicable) 1063if (this.DeclaredAccessibility == Accessibility.Private && (IsVirtual || (IsAbstract && !isExplicitInterfaceImplementationInInterface) || IsOverride)) 1140private static bool IsAccessibilityMoreRestrictive(Accessibility property, Accessibility accessor) 1142if (accessor == Accessibility.NotApplicable) 1147((accessor != Accessibility.Protected) || (property != Accessibility.Internal)); 1152if (accessor.LocalAccessibility == Accessibility.Private)
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
82else if (this.DeclaredAccessibility != Accessibility.Public || !this.IsStatic)
Symbols\Symbol.cs (9)
254case Accessibility.Public: 257case Accessibility.Private: 268case Accessibility.Internal: 279case Accessibility.Protected: 290case Accessibility.ProtectedAndInternal: 294case Accessibility.ProtectedOrInternal: 551/// accessibility declared on them, returns <see cref="Accessibility.NotApplicable"/>. 553public abstract Accessibility DeclaredAccessibility { get; } 1786Accessibility ISymbolInternal.DeclaredAccessibility
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (2)
132public override Accessibility DeclaredAccessibility => Accessibility.Private;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (2)
55public override Accessibility DeclaredAccessibility => Accessibility.Private;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (2)
809public override Accessibility DeclaredAccessibility => Accessibility.Internal;
Symbols\Synthesized\Records\SynthesizedRecordClone.cs (1)
162DeclaredAccessibility: Accessibility.Public,
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (3)
36public override Accessibility DeclaredAccessibility => ContainingType.IsSealed ? Accessibility.Private : Accessibility.Protected;
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (1)
326return m.DeclaredAccessibility == Accessibility.Public && !m.IsStatic;
Symbols\Synthesized\SynthesizedContainer.cs (2)
150public override Accessibility DeclaredAccessibility => Accessibility.Private;
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (2)
223public override Accessibility DeclaredAccessibility 229return Accessibility.Public;
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (2)
72public override Accessibility DeclaredAccessibility => Accessibility.Internal;
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
97public override Accessibility DeclaredAccessibility 99get { return Accessibility.Private; }
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (1)
171public override Accessibility DeclaredAccessibility
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (2)
186public override Accessibility DeclaredAccessibility 188get { return Accessibility.Internal; }
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (2)
91public override Accessibility DeclaredAccessibility => Accessibility.Internal;
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
146public sealed override Accessibility DeclaredAccessibility 148get { return Accessibility.Private; }
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (2)
57public override Accessibility DeclaredAccessibility => Accessibility.Internal;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (3)
40public override Accessibility DeclaredAccessibility 42get { return ContainingType.IsAbstract ? Accessibility.Protected : Accessibility.Public; }
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (2)
59public override Accessibility DeclaredAccessibility 61get { return Accessibility.Friend; }
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (2)
344public override Accessibility DeclaredAccessibility 348return Accessibility.Public;
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (2)
50public override Accessibility DeclaredAccessibility => Accessibility.Internal;
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (6)
64public override Accessibility DeclaredAccessibility 68Accessibility overriddenAccessibility = _overriddenAccessor.DeclaredAccessibility; 71case Accessibility.ProtectedOrInternal: 79return Accessibility.Protected; 83case Accessibility.ProtectedAndInternal: 88return Accessibility.Private;
Symbols\Synthesized\SynthesizedStaticConstructor.cs (2)
94public override Accessibility DeclaredAccessibility 100return Accessibility.Private;
Symbols\TypeParameterSymbol.cs (2)
208public sealed override Accessibility DeclaredAccessibility 212return Accessibility.NotApplicable;
Symbols\TypeSymbol.cs (4)
832bool canBeImplementedImplicitlyInCSharp9 = interfaceMember.DeclaredAccessibility == Accessibility.Public && !interfaceMember.IsEventOrPropertyWithImplementableNonPublicAccessor(); 1726if (member.DeclaredAccessibility != Accessibility.Public || member == implicitImpl) 1991else if (closestMismatch.DeclaredAccessibility != Accessibility.Public) 2235if (candidateMember.DeclaredAccessibility != Accessibility.Public || candidateMember.IsStatic != interfaceMember.IsStatic)
Symbols\TypeSymbolExtensions.cs (24)
1003Accessibility acc1 = s1.DeclaredAccessibility; 1005if (acc1 == Accessibility.Public) 1012Accessibility acc2 = s2.DeclaredAccessibility; 1016case Accessibility.Internal: 1020if ((acc2 == Accessibility.Private || acc2 == Accessibility.Internal || acc2 == Accessibility.ProtectedAndInternal) && s2.ContainingAssembly.HasInternalAccessTo(s1.ContainingAssembly)) 1028case Accessibility.ProtectedAndInternal: 1032if ((acc2 == Accessibility.Private || acc2 == Accessibility.Internal || acc2 == Accessibility.ProtectedAndInternal) && s2.ContainingAssembly.HasInternalAccessTo(s1.ContainingAssembly)) 1035goto case Accessibility.Protected; 1040case Accessibility.Protected: 1048else if (acc2 == Accessibility.Private) 1060else if (acc2 == Accessibility.Protected || acc2 == Accessibility.ProtectedAndInternal) 1074case Accessibility.ProtectedOrInternal: 1085case Accessibility.Private: 1104case Accessibility.Internal: 1114case Accessibility.Protected: 1124case Accessibility.ProtectedAndInternal: 1135case Accessibility.ProtectedOrInternal: 1149case Accessibility.Private: 1150if (acc2 == Accessibility.Private)
Symbols\Wrapped\WrappedEventSymbol.cs (1)
86public override Accessibility DeclaredAccessibility
Symbols\Wrapped\WrappedFieldSymbol.cs (1)
52public override Accessibility DeclaredAccessibility
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
109public override Accessibility DeclaredAccessibility
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
103public override Accessibility DeclaredAccessibility
Symbols\Wrapped\WrappedPropertySymbol.cs (1)
108public override Accessibility DeclaredAccessibility
Syntax\SyntaxFacts.cs (8)
358public static string GetText(Accessibility accessibility) 362case Accessibility.NotApplicable: 364case Accessibility.Private: 366case Accessibility.ProtectedAndInternal: 368case Accessibility.Internal: 370case Accessibility.Protected: 372case Accessibility.ProtectedOrInternal: 374case Accessibility.Public:
Microsoft.CodeAnalysis.CSharp.CodeStyle (41)
src\Analyzers\CSharp\Analyzers\AddAccessibilityModifiers\CSharpAddAccessibilityModifiers.cs (8)
47var accessibility = accessibilityFacts.GetAccessibility(member); 54return accessibility == Accessibility.NotApplicable; 65return accessibility == Accessibility.Public; 72return accessibility == Accessibility.NotApplicable; 81if (accessibility == Accessibility.NotApplicable) 91return accessibility == Accessibility.Internal; 98return accessibility == Accessibility.Private; 102return accessibility == Accessibility.Public;
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
109if (containingType.DeclaredAccessibility == Accessibility.Public)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
37=> !symbol.IsStatic && symbol.DeclaredAccessibility == Accessibility.Public;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (3)
301if (primaryConstructor.DeclaredAccessibility == Accessibility.Protected) 306else if (primaryConstructor.DeclaredAccessibility != Accessibility.Public) 531if (member.DeclaredAccessibility == Accessibility.Private &&
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (3)
65if (lockType is not { DeclaredAccessibility: Accessibility.Public }) 68if (lockType.GetTypeMembers("Scope").FirstOrDefault() is not { TypeKind: TypeKind.Struct, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public }) 95DeclaredAccessibility: Accessibility.Private,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (8)
183public static Accessibility DetermineAccessibilityConstraint( 190return Accessibility.Private; 311? Accessibility.Public 312: Accessibility.Internal; 315return Accessibility.Private; 334if (symbol.DeclaredAccessibility is Accessibility.Private or 335Accessibility.ProtectedAndInternal or 336Accessibility.Internal)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (17)
93public Accessibility GetAccessibility(SyntaxNode declaration) 96return Accessibility.NotApplicable; 99GetAccessibilityAndModifiers(modifierTokens, out var accessibility, out _, out _); 103public static void GetAccessibilityAndModifiers(SyntaxTokenList modifierList, out Accessibility accessibility, out DeclarationModifiers modifiers, out bool isDefault) 105accessibility = Accessibility.NotApplicable; 113(SyntaxKind.PublicKeyword, _) => Accessibility.Public, 115(SyntaxKind.PrivateKeyword, Accessibility.Protected) => Accessibility.ProtectedAndInternal, 116(SyntaxKind.PrivateKeyword, _) => Accessibility.Private, 118(SyntaxKind.InternalKeyword, Accessibility.Protected) => Accessibility.ProtectedOrInternal, 119(SyntaxKind.InternalKeyword, _) => Accessibility.Internal, 121(SyntaxKind.ProtectedKeyword, Accessibility.Private) => Accessibility.ProtectedAndInternal, 122(SyntaxKind.ProtectedKeyword, Accessibility.Internal) => Accessibility.ProtectedOrInternal, 123(SyntaxKind.ProtectedKeyword, _) => Accessibility.Protected,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (31)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (4)
134if (propertySymbol.DeclaredAccessibility < Accessibility.Internal) 165getAccessor.DeclaredAccessibility < Accessibility.Internal) 191if (setAccessor.DeclaredAccessibility != Accessibility.Public && 207if (setAccessor.DeclaredAccessibility != Accessibility.Public &&
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (7)
71var minimalAccessibility = (Accessibility)Math.Min((int)propertySymbol.DeclaredAccessibility, (int)setMethod.DeclaredAccessibility); 81var accessibility = fieldSymbol.DeclaredAccessibility; 93static bool CanBeAccessed(SymbolVisibility containingTypeVisibility, Accessibility accessibility) => containingTypeVisibility switch 96SymbolVisibility.Public => accessibility is Accessibility.Public, 98SymbolVisibility.Internal => accessibility is >= Accessibility.Internal, 102SymbolVisibility.Private => accessibility is >= Accessibility.Internal,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConstructorGenerator.cs (1)
127AddAccessibilityModifiers(constructor.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (8)
37Accessibility accessibility, 40Accessibility defaultAccessibility) 49case Accessibility.Public: 52case Accessibility.Protected: 55case Accessibility.Private: 58case Accessibility.ProtectedAndInternal: 62case Accessibility.Internal: 65case Accessibility.ProtectedOrInternal:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (3)
755public override TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken) 760private static SyntaxTokenList UpdateDeclarationAccessibility(SyntaxTokenList modifiersList, Accessibility newAccessibility, CSharpCodeGenerationContextInfo info) 763CSharpCodeGenerationHelpers.AddAccessibilityModifiers(newAccessibility, newModifierTokens, info, Accessibility.NotApplicable);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (1)
238AddAccessibilityModifiers(@event.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
126AddAccessibilityModifiers(field.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
353AddAccessibilityModifiers(method.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (3)
275var defaultAccessibility = destination is CodeGenerationDestination.CompilationUnit or CodeGenerationDestination.Namespace 276? Accessibility.Internal 277: Accessibility.Private;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (2)
347if (accessor.DeclaredAccessibility != Accessibility.NotApplicable && 386AddAccessibilityModifiers(property.DeclaredAccessibility, tokens, info, Accessibility.Private);
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (25)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (25)
233[InlineData("} namespace [|c2|] {", "} namespace C2 {", SymbolKind.Namespace, Accessibility.Public)] 234[InlineData("class [|c2|] { }", "class C2 { }", TypeKind.Class, Accessibility.Private)] 235[InlineData("struct [|c2|] { }", "struct C2 { }", TypeKind.Struct, Accessibility.Private)] 236[InlineData("interface [|c2|] { }", "interface C2 { }", TypeKind.Interface, Accessibility.Private)] 237[InlineData("delegate void [|c2|]();", "delegate void C2();", TypeKind.Delegate, Accessibility.Private)] 238[InlineData("enum [|c2|] { }", "enum C2 { }", TypeKind.Enum, Accessibility.Private)] 239[InlineData("class M<[|t|]> {}", "class M<T> {}", SymbolKind.TypeParameter, Accessibility.Private)] 240[InlineData("void M<[|t|]>() {}", "void M<T>() {}", SymbolKind.TypeParameter, Accessibility.Private)] 241[InlineData("int [|m|] { get; }", "int M { get; }", SymbolKind.Property, Accessibility.Private)] 242[InlineData("void [|m|]() {}", "void M() {}", MethodKind.Ordinary, Accessibility.Private)] 243[InlineData("void Outer() { void [|m|]() {} }", "void Outer() { void M() {} }", MethodKind.LocalFunction, Accessibility.NotApplicable)] 244[InlineData("int [|m|];", "int M;", SymbolKind.Field, Accessibility.Private)] 245[InlineData("event System.EventHandler [|m|];", "event System.EventHandler M;", SymbolKind.Event, Accessibility.Private)] 246[InlineData("void Outer(int [|m|]) {}", "void Outer(int M) {}", SymbolKind.Parameter, Accessibility.Private)] 247[InlineData("void Outer() { void Inner(int [|m|]) {} }", "void Outer() { void Inner(int M) {} }", SymbolKind.Parameter, Accessibility.NotApplicable)] 248[InlineData("void Outer() { System.Action<int> action = [|m|] => {} }", "void Outer() { System.Action<int> action = M => {} }", SymbolKind.Parameter, Accessibility.NotApplicable)] 249[InlineData("void Outer() { System.Action<int> action = ([|m|]) => {} }", "void Outer() { System.Action<int> action = (M) => {} }", SymbolKind.Parameter, Accessibility.NotApplicable)] 250[InlineData("void Outer() { System.Action<int> action = (int [|m|]) => {} }", "void Outer() { System.Action<int> action = (int M) => {} }", SymbolKind.Parameter, Accessibility.NotApplicable)] 251[InlineData("void Outer() { System.Action<int> action = delegate (int [|m|]) {} }", "void Outer() { System.Action<int> action = delegate (int M) {} }", SymbolKind.Parameter, Accessibility.NotApplicable)] 252[InlineData("void Outer() { int [|m|]; }", "void Outer() { int M; }", SymbolKind.Local, Accessibility.NotApplicable)] 254public async Task TestPascalCaseSymbol_ExpectedSymbolAndAccessibility(string camelCaseSymbol, string pascalCaseSymbol, object symbolKind, Accessibility accessibility) 257var alternateAccessibility = accessibility == Accessibility.Public ? Accessibility.Protected : Accessibility.Public;
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
336accessibility: Accessibility.Private,
EventHookup\EventHookupSessionManager_EventHookupSession.cs (1)
159Accessibility.Private,
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (152)
CodeActions\GenerateType\GenerateTypeTests_Dialog.cs (89)
355accessibility: Accessibility.Public, 395accessibility: Accessibility.Internal, 435accessibility: Accessibility.NotApplicable, 470accessibility: Accessibility.NotApplicable, 511accessibility: Accessibility.NotApplicable, 550accessibility: Accessibility.Public, 594accessibility: Accessibility.Public, 639accessibility: Accessibility.Public, 684accessibility: Accessibility.Public, 722accessibility: Accessibility.Public, 758accessibility: Accessibility.Public, 797accessibility: Accessibility.Public, 839accessibility: Accessibility.Public, 875accessibility: Accessibility.Public, 918accessibility: Accessibility.Public, 965accessibility: Accessibility.Public, 1014accessibility: Accessibility.Public, 1069accessibility: Accessibility.Public, 1114accessibility: Accessibility.Public, 1163accessibility: Accessibility.Public, 1222accessibility: Accessibility.Public, 1261accessibility: Accessibility.Public, 1306accessibility: Accessibility.Public, 1345accessibility: Accessibility.Public, 1391accessibility: Accessibility.Public, 1431accessibility: Accessibility.Public, 1470accessibility: Accessibility.Public, 1514accessibility: Accessibility.Public, 1552accessibility: Accessibility.Public, 1597accessibility: Accessibility.Public, 1636accessibility: Accessibility.Public, 1681accessibility: Accessibility.Public, 1718accessibility: Accessibility.Public, 1758accessibility: Accessibility.Public, 1803accessibility: Accessibility.Public, 1847accessibility: Accessibility.Public, 1898accessibility: Accessibility.Public, 1935accessibility: Accessibility.Public, 1965accessibility: Accessibility.Public, 1986accessibility: Accessibility.Public, 2008accessibility: Accessibility.Public, 2038accessibility: Accessibility.Public, 2075accessibility: Accessibility.Public, 2113accessibility: Accessibility.Public, 2151accessibility: Accessibility.Public, 2188accessibility: Accessibility.Public, 2218accessibility: Accessibility.Public, 2269accessibility: Accessibility.Public, 2297accessibility: Accessibility.Public, 2332accessibility: Accessibility.Public, 2367accessibility: Accessibility.Public, 2403accessibility: Accessibility.Public, 2438accessibility: Accessibility.Public, 2471accessibility: Accessibility.Public, 2504accessibility: Accessibility.Public, 2537accessibility: Accessibility.Public, 2566accessibility: Accessibility.Public, 2595accessibility: Accessibility.Public, 2625accessibility: Accessibility.Public, 2660accessibility: Accessibility.Public, 2695accessibility: Accessibility.Public, 2728accessibility: Accessibility.Public, 2761accessibility: Accessibility.Public, 2791accessibility: Accessibility.Public, 2820accessibility: Accessibility.Public, 2855accessibility: Accessibility.Public, 2890accessibility: Accessibility.Public, 2923accessibility: Accessibility.Public, 2956accessibility: Accessibility.Public, 2986accessibility: Accessibility.Public, 3015accessibility: Accessibility.Public, 3049accessibility: Accessibility.Public, 3080accessibility: Accessibility.Public, 3110accessibility: Accessibility.Public, 3147accessibility: Accessibility.Public, 3184accessibility: Accessibility.Public, 3227accessibility: Accessibility.Public, 3276accessibility: Accessibility.Public, 3306accessibility: Accessibility.Public, 3335accessibility: Accessibility.Public, 3370accessibility: Accessibility.Public, 3402accessibility: Accessibility.Public, 3427accessibility: Accessibility.Public, 3462accessibility: Accessibility.Public, 3489accessibility: Accessibility.Public, 3530accessibility: Accessibility.Public, 3563accessibility: Accessibility.Public, 3596accessibility: Accessibility.Public, 3635accessibility: Accessibility.Public,
Completion\CompletionProviders\DeclarationNameCompletionProviderTests_NameDeclarationInfoTests.cs (5)
57await VerifyAccessibility(markup, Accessibility.Public); 74await VerifyAccessibility(markup, Accessibility.Public); 92await VerifyAccessibility(markup, Accessibility.Private); 108await VerifyAccessibility(markup, Accessibility.Private); 796private async Task VerifyAccessibility(string markup, Accessibility? accessibility)
Diagnostics\NamingStyles\EditorConfigNamingStyleParserTests.cs (58)
53Accessibility.NotApplicable, 54Accessibility.Public, 55Accessibility.Internal, 56Accessibility.Private, 57Accessibility.Protected, 58Accessibility.ProtectedAndInternal, 59Accessibility.ProtectedOrInternal 123new[] { Accessibility.NotApplicable, Accessibility.Public, Accessibility.Internal, Accessibility.Private, Accessibility.Protected, Accessibility.ProtectedAndInternal, Accessibility.ProtectedOrInternal }, 183Accessibility.Public, 184Accessibility.Internal, 185Accessibility.Protected, 186Accessibility.ProtectedOrInternal 230Assert.Contains(Accessibility.Private, symbolSpec.ApplicableAccessibilityList); 271new[] { Accessibility.NotApplicable, Accessibility.Public, Accessibility.Internal, Accessibility.Private, Accessibility.Protected, Accessibility.ProtectedAndInternal, Accessibility.ProtectedOrInternal }, 310new[] { Accessibility.NotApplicable, Accessibility.Public, Accessibility.Internal, Accessibility.Private, Accessibility.Protected, Accessibility.ProtectedAndInternal, Accessibility.ProtectedOrInternal }, 368[InlineData("internal,protected_internal", new[] { Accessibility.Internal, Accessibility.ProtectedOrInternal })] 369[InlineData("friend,protected_friend", new[] { Accessibility.Friend, Accessibility.ProtectedOrFriend })] 370[InlineData("private_protected", new[] { Accessibility.ProtectedAndInternal })] 371[InlineData("local", new[] { Accessibility.NotApplicable })] 372[InlineData("*", new[] { Accessibility.NotApplicable, Accessibility.Public, Accessibility.Internal, Accessibility.Private, Accessibility.Protected, Accessibility.ProtectedAndInternal, Accessibility.ProtectedOrInternal })] 373[InlineData(null, new[] { Accessibility.NotApplicable, Accessibility.Public, Accessibility.Internal, Accessibility.Private, Accessibility.Protected, Accessibility.ProtectedAndInternal, Accessibility.ProtectedOrInternal })] 374[InlineData("internal,protected,invalid", new[] { Accessibility.Internal, Accessibility.Protected })] 375[InlineData("invalid", new Accessibility[] { })] 376[InlineData("", new Accessibility[] { })] 378public void TestApplicableAccessibilitiesParse(string specification, Accessibility[] accessibilities)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (112)
BreakingChanges.cs (12)
105Assert.Equal(Accessibility.Public, baseProperty1.DeclaredAccessibility); 106Assert.Equal(Accessibility.Public, baseProperty1.GetMethod.DeclaredAccessibility); 107Assert.Equal(Accessibility.ProtectedOrInternal, baseProperty1.SetMethod.DeclaredAccessibility); 109Assert.Equal(Accessibility.Public, baseProperty2.DeclaredAccessibility); 110Assert.Equal(Accessibility.ProtectedOrInternal, baseProperty2.GetMethod.DeclaredAccessibility); 111Assert.Equal(Accessibility.Public, baseProperty2.SetMethod.DeclaredAccessibility); 117Assert.Equal(Accessibility.Public, derivedProperty1.DeclaredAccessibility); 118Assert.Equal(Accessibility.Public, derivedProperty1.GetMethod.DeclaredAccessibility); 121Assert.Equal(Accessibility.Public, derivedProperty2.DeclaredAccessibility); 123Assert.Equal(Accessibility.Public, derivedProperty2.SetMethod.DeclaredAccessibility); 129Assert.Equal(Accessibility.Protected, derivedProperty1Synthesized.DeclaredAccessibility); 132Assert.Equal(Accessibility.Protected, derivedProperty2Synthesized.DeclaredAccessibility);
CodeGen\CodeGenDeconstructTests.cs (1)
3616Assert.Equal(Accessibility.Private, field.DeclaredAccessibility);
CodeGen\CodeGenDynamicTests.cs (4)
592Assert.Equal(Accessibility.Private, container.DeclaredAccessibility); 601Assert.Equal(Accessibility.Public, field.DeclaredAccessibility); 826Assert.Equal(Accessibility.Internal, d.DeclaredAccessibility); 839Assert.Equal(Accessibility.Public, member.DeclaredAccessibility);
CodeGen\CodeGenReadonlyStructTests.cs (5)
839AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsReadOnlyAttribute, Accessibility.Internal); 1388AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsReadOnlyAttribute, Accessibility.Internal); 1456AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsReadOnlyAttribute, Accessibility.Internal); 1524AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsReadOnlyAttribute, Accessibility.Internal); 2604AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsReadOnlyAttribute, Accessibility.Internal);
CodeGen\DestructorTests.cs (1)
838Assert.Equal(Accessibility.Protected, destructor.DeclaredAccessibility);
CodeGen\EventTests.cs (2)
211Assert.Equal(Accessibility.Public, @event.DeclaredAccessibility); 233Assert.Equal(Accessibility.Private, associatedField.DeclaredAccessibility);
CodeGen\IndexerTests.cs (2)
158Assert.Equal(Accessibility.Private, indexer.DeclaredAccessibility); 260Assert.Equal(Accessibility.Public, indexer.DeclaredAccessibility);
CodeGen\SwitchTests.cs (1)
3044Assert.Equal(Accessibility.Internal, member.DeclaredAccessibility);
Emit\EmitMetadataTests.cs (83)
443Assert.Equal(Accessibility.Public, classA.DeclaredAccessibility); 499Assert.Equal(Accessibility.Internal, classB.DeclaredAccessibility); 503Assert.Equal(Accessibility.Internal, classC.DeclaredAccessibility); 510Assert.Equal(Accessibility.Public, classD.DeclaredAccessibility); 511Assert.Equal(Accessibility.Internal, classE.DeclaredAccessibility); 512Assert.Equal(Accessibility.Protected, classF.DeclaredAccessibility); 513Assert.Equal(Accessibility.ProtectedOrInternal, classH.DeclaredAccessibility); 519Assert.Equal(Accessibility.Private, classG.DeclaredAccessibility); 520Assert.Equal(Accessibility.Private, classK.DeclaredAccessibility); 562Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility); 563Assert.Equal(Accessibility.Internal, f2.DeclaredAccessibility); 564Assert.Equal(Accessibility.ProtectedOrInternal, f3.DeclaredAccessibility); 565Assert.Equal(Accessibility.Protected, f4.DeclaredAccessibility); 571Assert.Equal(Accessibility.Private, f5.DeclaredAccessibility); 572Assert.Equal(Accessibility.Private, f6.DeclaredAccessibility); 603Assert.Equal(Accessibility.Protected, ctor.DeclaredAccessibility); 624Assert.Equal(Accessibility.Private, cctor.DeclaredAccessibility); 666CheckConstantField(type, "I", Accessibility.Private, SpecialType.System_Int32, -1); 668CheckConstantField(type, "J", Accessibility.Internal, SpecialType.System_Int32, -1); 669CheckConstantField(type, "O", Accessibility.ProtectedOrInternal, SpecialType.System_Object, null); 670CheckConstantField(type, "S", Accessibility.Public, SpecialType.System_String, "string"); 676private void CheckConstantField(NamedTypeSymbol type, string name, Accessibility declaredAccessibility, SpecialType fieldType, object value) 867var privateOrNotApplicable = isFromSource ? Accessibility.Private : Accessibility.NotApplicable; 869CheckPropertyAccessibility(p1, Accessibility.Public, Accessibility.Public, Accessibility.Public); 870CheckPropertyAccessibility(p2, Accessibility.Internal, Accessibility.Internal, Accessibility.NotApplicable); 871CheckPropertyAccessibility(p3, Accessibility.ProtectedOrInternal, Accessibility.ProtectedOrInternal, Accessibility.NotApplicable); 872CheckPropertyAccessibility(p4, Accessibility.Protected, Accessibility.Protected, Accessibility.NotApplicable); 873CheckPropertyAccessibility(p7, Accessibility.Public, privateOrNotApplicable, Accessibility.Public); 874CheckPropertyAccessibility(p8, Accessibility.Internal, Accessibility.Internal, privateOrNotApplicable); 875CheckPropertyAccessibility(p9, Accessibility.Protected, Accessibility.Protected, privateOrNotApplicable); 876CheckPropertyAccessibility(p10, Accessibility.ProtectedOrInternal, Accessibility.Protected, Accessibility.ProtectedOrInternal); 877CheckPropertyAccessibility(p11, Accessibility.ProtectedOrInternal, Accessibility.Internal, Accessibility.ProtectedOrInternal); 883CheckPropertyAccessibility(p5, Accessibility.Private, Accessibility.NotApplicable, Accessibility.Private); 884CheckPropertyAccessibility(p6, Accessibility.Private, Accessibility.Private, Accessibility.NotApplicable); 1088CheckPropertyAccessibility(propertyP, Accessibility.Public, Accessibility.Public, Accessibility.Private); 1094CheckPropertyAccessibility(propertyP, Accessibility.Public, Accessibility.Public, Accessibility.NotApplicable); 1100CheckPropertyAccessibility(propertyQ, Accessibility.Public, Accessibility.Public, Accessibility.Internal); 1115CheckPropertyAccessibility(propertyP, Accessibility.Public, Accessibility.Public, Accessibility.NotApplicable); 1121CheckPropertyAccessibility(propertyQ, Accessibility.Public, Accessibility.NotApplicable, Accessibility.Internal); 1160CheckPropertyAccessibility(ip, Accessibility.Private, Accessibility.Private, Accessibility.Private); 1165private static void CheckPropertyAccessibility(PropertySymbol property, Accessibility propertyAccessibility, Accessibility getterAccessibility, Accessibility setterAccessibility) 1174private static void CheckPropertyAccessorAccessibility(PropertySymbol property, Accessibility propertyAccessibility, MethodSymbol accessor, Accessibility accessorAccessibility) 1178Assert.Equal(Accessibility.NotApplicable, accessorAccessibility); 1331CheckEnumType(type, Accessibility.Internal, SpecialType.System_Int32); 1355CheckEnumType(type, Accessibility.Internal, SpecialType.System_Int16); 1389private void CheckEnumType(NamedTypeSymbol type, Accessibility declaredAccessibility, SpecialType underlyingType) 1410Assert.Equal(Accessibility.Public, field.DeclaredAccessibility); // Dev10: value__ is public
PrivateProtected.cs (1)
114Assert.Equal(Accessibility.ProtectedAndInternal, member.DeclaredAccessibility);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (24)
Emit\UnmanagedTypeModifierTests.cs (24)
643AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, parentTypeParameter, module.ContainingAssembly.Name); 649AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, childTypeParameter, module.ContainingAssembly.Name); 678AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 691AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 724AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, parentTypeParameter, module.ContainingAssembly.Name); 730AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, childTypeParameter, module.ContainingAssembly.Name); 756AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 769AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 799AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, parentTypeParameter, module.ContainingAssembly.Name); 805AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, childTypeParameter, module.ContainingAssembly.Name); 831AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 844AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 874AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, parentTypeParameter, module.ContainingAssembly.Name); 880AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, childTypeParameter, module.ContainingAssembly.Name); 906AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 919AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 949AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, parentTypeParameter, module.ContainingAssembly.Name); 955AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, childTypeParameter, module.ContainingAssembly.Name); 982AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 995AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 1041AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, delegateTypeParameter, module.ContainingAssembly.Name); 1047AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, lambdaTypeParameter, module.ContainingAssembly.Name); 1069AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 1095AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (90)
Attributes\AttributeTests_IsByRefLike.cs (4)
46AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsByRefLikeAttribute, Accessibility.Public); 103AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsByRefLikeAttribute, Accessibility.Internal); 683AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsByRefLikeAttribute, Accessibility.Public); 1093Assert.Equal(Accessibility.Internal, typeSymbol.DeclaredAccessibility);
Attributes\AttributeTests_IsUnmanaged.cs (19)
45AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, module.ContainingAssembly.Name); 69AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, module.ContainingAssembly.Name); 99AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, module.ContainingAssembly.Name); 121AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, module.ContainingAssembly.Name); 147AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, reference.Display); 173AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, reference.Display); 209AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, reference.Display); 237AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, reference.Display); 264AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, reference.Display); 290AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, reference.Display); 327AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, reference.Display); 356AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Public, typeParameter, reference.Display); 377AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 396AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 424AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 444AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 653AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 736AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name); 750AttributeValidation.AssertReferencedIsUnmanagedAttribute(Accessibility.Internal, typeParameter, module.ContainingAssembly.Name);
Attributes\AttributeTests_NullablePublicOnly.cs (2)
602Assert.Equal(publicDefinition ? Accessibility.Public : Accessibility.Internal, type.DeclaredAccessibility);
Attributes\AttributeTests_ReadOnlyStruct.cs (2)
45AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsReadOnlyAttribute, Accessibility.Public); 660Assert.Equal(Accessibility.Internal, typeSymbol.DeclaredAccessibility);
Attributes\AttributeTests_RefReadOnly.cs (3)
51AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsReadOnlyAttribute, Accessibility.Public); 74AssertDeclaresType(peModule, WellKnownType.System_Runtime_CompilerServices_IsReadOnlyAttribute, Accessibility.Internal); 2552Assert.Equal(Accessibility.Internal, typeSymbol.DeclaredAccessibility);
Attributes\AttributeTests_RefSafetyRules.cs (2)
237Assert.Equal(publicDefinition ? Accessibility.Public : Accessibility.Internal, type.DeclaredAccessibility);
Semantics\PrimaryConstructorTests.cs (4)
407Assert.Equal(Accessibility.Public, ctor.DeclaredAccessibility); 478Assert.Equal(Accessibility.Protected, ctor.DeclaredAccessibility); 614Assert.Equal(Accessibility.Public, ctor.DeclaredAccessibility); 1079Assert.Equal(Accessibility.Public, symbol.ContainingSymbol.DeclaredAccessibility);
Semantics\RecordTests.cs (54)
3435Assert.Equal(Accessibility.Public, clone.DeclaredAccessibility); 3466Assert.Equal(Accessibility.Public, clone.DeclaredAccessibility); 3498Assert.Equal(Accessibility.Public, clone.DeclaredAccessibility); 3525Assert.Equal(Accessibility.Public, clone.DeclaredAccessibility); 4921Assert.Equal(Accessibility.Protected, print.DeclaredAccessibility); 4929Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); 4996Assert.Equal(Accessibility.Protected, print.DeclaredAccessibility); 5004Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); 5073Assert.Equal(Accessibility.Protected, print.DeclaredAccessibility); 5081Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); 5240Assert.Equal(Accessibility.Private, print.DeclaredAccessibility); 5248Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); 5424Assert.Equal(Accessibility.Private, print.DeclaredAccessibility); 5432Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); 5458Assert.Equal(Accessibility.Protected, print.DeclaredAccessibility); 5466Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); 5851Assert.Equal(Accessibility.Protected, print.DeclaredAccessibility); 5859Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); 9982Assert.Equal(Accessibility.Protected, b1Ctor.DeclaredAccessibility); 13388Assert.True(copyCtor.DeclaredAccessibility == Accessibility.Private); 13421Assert.True(sealedCopyCtor.DeclaredAccessibility == Accessibility.Internal); 13425Assert.True(unsealedCopyCtor.DeclaredAccessibility == Accessibility.Internal); 14010Assert.Equal(Accessibility.Public, clone.DeclaredAccessibility); 14047Assert.Equal(Accessibility.Public, clone.DeclaredAccessibility); 14175Assert.Equal(Accessibility.Public, deconstruct.DeclaredAccessibility); 15703Assert.Equal(Accessibility.Public, deconstruct.DeclaredAccessibility); 18134Assert.Equal(Accessibility.Public, recordEquals.DeclaredAccessibility); 18204Assert.Equal(Accessibility.Protected, copyCtor.DeclaredAccessibility); 18212Assert.Equal(Accessibility.Private, copyCtor.DeclaredAccessibility); 18243Assert.Equal(Accessibility.Public, recordEquals.DeclaredAccessibility); 18356Assert.Equal(Accessibility.Public, clone.DeclaredAccessibility); 18364Assert.Equal(Accessibility.Public, clone.DeclaredAccessibility); 18372Assert.Equal(Accessibility.Public, clone.DeclaredAccessibility); 18507Assert.Equal(Accessibility.Public, recordEquals.DeclaredAccessibility); 18667Assert.Equal(Accessibility.Public, recordEquals.DeclaredAccessibility); 18706Assert.Equal(Accessibility.Public, recordEquals.DeclaredAccessibility); 18742Assert.Equal(Accessibility.Public, recordEquals.DeclaredAccessibility); 18960Assert.Equal(Accessibility.Protected, equalityContract.DeclaredAccessibility); 18970Assert.Equal(Accessibility.Protected, equalityContractGet!.DeclaredAccessibility); 19076Assert.Equal(Accessibility.Protected, equalityContract.DeclaredAccessibility); 19086Assert.Equal(Accessibility.Protected, equalityContractGet!.DeclaredAccessibility); 19149Assert.Equal(modifiers == "sealed " ? Accessibility.Private : Accessibility.Protected, equalityContract.DeclaredAccessibility); 19159Assert.Equal(modifiers == "sealed " ? Accessibility.Private : Accessibility.Protected, equalityContractGet!.DeclaredAccessibility); 20081Assert.Equal(Accessibility.Private, equalityContract.DeclaredAccessibility); 20112Assert.Equal(Accessibility.Protected, equalityContract.DeclaredAccessibility); 20379Assert.Equal(Accessibility.Public, op.DeclaredAccessibility); 20389Assert.Equal(Accessibility.Public, op.DeclaredAccessibility); 20498Assert.Equal(Accessibility.Public, op.DeclaredAccessibility); 20508Assert.Equal(Accessibility.Public, op.DeclaredAccessibility); 21196Assert.Equal(Accessibility.Public, symbol.ContainingSymbol.DeclaredAccessibility); 22699Assert.Equal(Accessibility.Public, clone.DeclaredAccessibility); 23168Assert.Equal(Accessibility.Public, baseEquals.DeclaredAccessibility);
Microsoft.CodeAnalysis.CSharp.Features (96)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
120accessibility: Accessibility.Private,
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (15)
21Accessibility? accessibility, 36public readonly Accessibility? DeclaredAccessibility = accessibility; 155Accessibility.NotApplicable, 423Accessibility.NotApplicable); 601private static Accessibility? GetAccessibility(SyntaxTokenList modifiers) 609return Accessibility.Private; 611return Accessibility.Public; 613return Accessibility.Protected; 615return Accessibility.Internal; 638public static Glyph GetGlyph(SymbolKind kind, Accessibility? declaredAccessibility) 654case Accessibility.Private: 658case Accessibility.Protected: 659case Accessibility.ProtectedAndInternal: 660case Accessibility.ProtectedOrInternal: 664case Accessibility.Internal:
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
199=> namespaceSymbol != null && namespaceSymbol.GetTypeMembers(name).Any(static t => t.DeclaredAccessibility == Accessibility.Public);
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (1)
109if (type.DeclaredAccessibility == Accessibility.Public && type.Name.StartsWith(CallConvPrefix))
Completion\CompletionProviders\OverrideCompletionProvider.cs (18)
76out Accessibility seenAccessibility, 82seenAccessibility = Accessibility.NotApplicable; 141seenAccessibility = seenAccessibility == Accessibility.NotApplicable 142? Accessibility.Public 148Accessibility.NotApplicable => Accessibility.Private, 150Accessibility.Protected => Accessibility.ProtectedAndInternal, 158Accessibility.NotApplicable => Accessibility.Internal, 159Accessibility.Protected => Accessibility.ProtectedOrInternal, 166Accessibility.NotApplicable => Accessibility.Protected, 168Accessibility.Internal => Accessibility.ProtectedOrInternal, 170Accessibility.Private => Accessibility.ProtectedAndInternal,
ConvertAutoPropertyToFullProperty\CSharpConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
39Accessibility.Private,
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
83Accessibility.Private,
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (2)
92method, useDeclaredAccessibility ? mainMethod.DeclaredAccessibility : Accessibility.NotApplicable); 104accessibility: useDeclaredAccessibility ? programType.DeclaredAccessibility : Accessibility.NotApplicable,
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
97Accessibility.Private, 159if (field.DeclaredAccessibility == Accessibility.Private || IsNew(field))
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
103accessibility: Accessibility.Private,
GenerateType\CSharpGenerateTypeService.cs (10)
450private static Accessibility DetermineAccessibilityConstraint( 512protected override Accessibility GetAccessibility(State state, SemanticModel semanticModel, bool intoNamespace, CancellationToken cancellationToken) 519if (accessibilityConstraint is Accessibility.Public or 520Accessibility.Internal) 524else if (accessibilityConstraint is Accessibility.Protected or 525Accessibility.ProtectedOrInternal) 529? Accessibility.Public 530: Accessibility.Internal; 785accessibility: Accessibility.Public, 799accessibility: Accessibility.Public,
ImplementInterface\CSharpImplementImplicitlyCodeRefactoringProvider.cs (1)
49=> generator.WithAccessibility(WithoutExplicitImpl(decl), Accessibility.Public);
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (4)
32protected override Accessibility DetermineDefaultFieldAccessibility(INamedTypeSymbol containingType) 33=> Accessibility.Private; 36protected override Accessibility DetermineDefaultPropertyAccessibility() 37=> Accessibility.Private;
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (7)
214var accessibilityLevel = formattingOptions.AccessibilityModifiersRequired is AccessibilityModifiersRequired.Never or AccessibilityModifiersRequired.OmitIfDefault 215? Accessibility.NotApplicable 216: Accessibility.Private; 220if (rule.SymbolSpecification.AppliesTo(SymbolKind.Field, Accessibility.Private)) 243if (rule.SymbolSpecification.AppliesTo(SymbolKind.Property, Accessibility.Public)) 248Accessibility.Public, 257Accessibility.Public,
Snippets\CSharpConstructorSnippetProvider.cs (3)
73accessibility: syntaxContext.PrecedingModifiers.Any() ? Accessibility.NotApplicable : (containingTypeSymbol.IsAbstract ? Accessibility.Protected : Accessibility.Public));
Snippets\CSharpPropgSnippetProvider.cs (1)
44return (AccessorDeclarationSyntax)generator.SetAccessorDeclaration(Accessibility.Private);
src\Analyzers\CSharp\Analyzers\AddAccessibilityModifiers\CSharpAddAccessibilityModifiers.cs (8)
47var accessibility = accessibilityFacts.GetAccessibility(member); 54return accessibility == Accessibility.NotApplicable; 65return accessibility == Accessibility.Public; 72return accessibility == Accessibility.NotApplicable; 81if (accessibility == Accessibility.NotApplicable) 91return accessibility == Accessibility.Internal; 98return accessibility == Accessibility.Private; 102return accessibility == Accessibility.Public;
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
109if (containingType.DeclaredAccessibility == Accessibility.Public)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
37=> !symbol.IsStatic && symbol.DeclaredAccessibility == Accessibility.Public;
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (3)
301if (primaryConstructor.DeclaredAccessibility == Accessibility.Protected) 306else if (primaryConstructor.DeclaredAccessibility != Accessibility.Public) 531if (member.DeclaredAccessibility == Accessibility.Private &&
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (3)
65if (lockType is not { DeclaredAccessibility: Accessibility.Public }) 68if (lockType.GetTypeMembers("Scope").FirstOrDefault() is not { TypeKind: TypeKind.Struct, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public }) 95DeclaredAccessibility: Accessibility.Private,
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (4)
134if (propertySymbol.DeclaredAccessibility < Accessibility.Internal) 165getAccessor.DeclaredAccessibility < Accessibility.Internal) 191if (setAccessor.DeclaredAccessibility != Accessibility.Public && 207if (setAccessor.DeclaredAccessibility != Accessibility.Public &&
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (7)
71var minimalAccessibility = (Accessibility)Math.Min((int)propertySymbol.DeclaredAccessibility, (int)setMethod.DeclaredAccessibility); 81var accessibility = fieldSymbol.DeclaredAccessibility; 93static bool CanBeAccessed(SymbolVisibility containingTypeVisibility, Accessibility accessibility) => containingTypeVisibility switch 96SymbolVisibility.Public => accessibility is Accessibility.Public, 98SymbolVisibility.Internal => accessibility is >= Accessibility.Internal, 102SymbolVisibility.Private => accessibility is >= Accessibility.Internal,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (25)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (25)
233[InlineData("} namespace [|c2|] {", "} namespace C2 {", SymbolKind.Namespace, Accessibility.Public)] 234[InlineData("class [|c2|] { }", "class C2 { }", TypeKind.Class, Accessibility.Private)] 235[InlineData("struct [|c2|] { }", "struct C2 { }", TypeKind.Struct, Accessibility.Private)] 236[InlineData("interface [|c2|] { }", "interface C2 { }", TypeKind.Interface, Accessibility.Private)] 237[InlineData("delegate void [|c2|]();", "delegate void C2();", TypeKind.Delegate, Accessibility.Private)] 238[InlineData("enum [|c2|] { }", "enum C2 { }", TypeKind.Enum, Accessibility.Private)] 239[InlineData("class M<[|t|]> {}", "class M<T> {}", SymbolKind.TypeParameter, Accessibility.Private)] 240[InlineData("void M<[|t|]>() {}", "void M<T>() {}", SymbolKind.TypeParameter, Accessibility.Private)] 241[InlineData("int [|m|] { get; }", "int M { get; }", SymbolKind.Property, Accessibility.Private)] 242[InlineData("void [|m|]() {}", "void M() {}", MethodKind.Ordinary, Accessibility.Private)] 243[InlineData("void Outer() { void [|m|]() {} }", "void Outer() { void M() {} }", MethodKind.LocalFunction, Accessibility.NotApplicable)] 244[InlineData("int [|m|];", "int M;", SymbolKind.Field, Accessibility.Private)] 245[InlineData("event System.EventHandler [|m|];", "event System.EventHandler M;", SymbolKind.Event, Accessibility.Private)] 246[InlineData("void Outer(int [|m|]) {}", "void Outer(int M) {}", SymbolKind.Parameter, Accessibility.Private)] 247[InlineData("void Outer() { void Inner(int [|m|]) {} }", "void Outer() { void Inner(int M) {} }", SymbolKind.Parameter, Accessibility.NotApplicable)] 248[InlineData("void Outer() { System.Action<int> action = [|m|] => {} }", "void Outer() { System.Action<int> action = M => {} }", SymbolKind.Parameter, Accessibility.NotApplicable)] 249[InlineData("void Outer() { System.Action<int> action = ([|m|]) => {} }", "void Outer() { System.Action<int> action = (M) => {} }", SymbolKind.Parameter, Accessibility.NotApplicable)] 250[InlineData("void Outer() { System.Action<int> action = (int [|m|]) => {} }", "void Outer() { System.Action<int> action = (int M) => {} }", SymbolKind.Parameter, Accessibility.NotApplicable)] 251[InlineData("void Outer() { System.Action<int> action = delegate (int [|m|]) {} }", "void Outer() { System.Action<int> action = delegate (int M) {} }", SymbolKind.Parameter, Accessibility.NotApplicable)] 252[InlineData("void Outer() { int [|m|]; }", "void Outer() { int M; }", SymbolKind.Local, Accessibility.NotApplicable)] 254public async Task TestPascalCaseSymbol_ExpectedSymbolAndAccessibility(string camelCaseSymbol, string pascalCaseSymbol, object symbolKind, Accessibility accessibility) 257var alternateAccessibility = accessibility == Accessibility.Public ? Accessibility.Protected : Accessibility.Public;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (37)
Semantics\AccessCheckTests.cs (1)
910Assert.Equal(Accessibility.Private, Private.DeclaredAccessibility);
Semantics\DelegateTypeTests.cs (1)
14385Assert.Equal(Accessibility.Internal, delegateType.DeclaredAccessibility);
Semantics\NativeIntegerTests.cs (2)
313if (underlyingMember.DeclaredAccessibility != Accessibility.Public) 427if (underlyingMember.DeclaredAccessibility != Accessibility.Public)
Semantics\NullableReferenceTypesTests.cs (2)
98807Assert.Equal(Accessibility.Internal, nullableAttribute.AttributeClass.DeclaredAccessibility); 104932Assert.Equal(Accessibility.Internal, nullableAttribute.AttributeClass.DeclaredAccessibility);
Semantics\OperatorTests.cs (2)
7663Assert.Equal(Accessibility.Public, symbol1.DeclaredAccessibility); 8458Assert.Equal(Accessibility.Public, symbol1.DeclaredAccessibility);
Semantics\RecordStructTests.cs (15)
661Assert.Equal(Accessibility.Internal, comp.GlobalNamespace.GetTypeMember("S1").DeclaredAccessibility); 662Assert.Equal(Accessibility.Public, comp.GlobalNamespace.GetTypeMember("S2").DeclaredAccessibility); 663Assert.Equal(Accessibility.Internal, comp.GlobalNamespace.GetTypeMember("S3").DeclaredAccessibility); 664Assert.Equal(Accessibility.ProtectedAndInternal, comp.GlobalNamespace.GetTypeMember("C").GetTypeMember("S4").DeclaredAccessibility); 665Assert.Equal(Accessibility.ProtectedOrInternal, comp.GlobalNamespace.GetTypeMember("C").GetTypeMember("S5").DeclaredAccessibility); 3450Assert.Equal(Accessibility.Public, deconstruct.DeclaredAccessibility); 4339Assert.Equal(Accessibility.Public, recordEquals.DeclaredAccessibility); 4348Assert.Equal(Accessibility.Public, objectEquals.DeclaredAccessibility); 4357Assert.Equal(Accessibility.Public, gethashCode.DeclaredAccessibility); 4906Assert.Equal(Accessibility.Public, op.DeclaredAccessibility); 4916Assert.Equal(Accessibility.Public, op.DeclaredAccessibility); 5142Assert.Equal(Accessibility.Private, print.DeclaredAccessibility); 5150Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility); 5346Assert.Equal(Accessibility.Private, print.DeclaredAccessibility); 5354Assert.Equal(Accessibility.Public, toString.DeclaredAccessibility);
Semantics\TopLevelStatementsTests.cs (14)
9057Assert.Equal(Accessibility.Internal, entryPoint.ContainingType.DeclaredAccessibility); 9058Assert.Equal(Accessibility.Private, entryPoint.DeclaredAccessibility); 9112Assert.Equal(Accessibility.Public, entryPoint.ContainingType.DeclaredAccessibility); 9113Assert.Equal(Accessibility.Private, entryPoint.DeclaredAccessibility); 9154Assert.Equal(Accessibility.Public, entryPoint.ContainingType.DeclaredAccessibility); 9155Assert.Equal(Accessibility.Private, entryPoint.DeclaredAccessibility); 9176Assert.Equal(Accessibility.Internal, entryPoint.ContainingType.DeclaredAccessibility); 9177Assert.Equal(Accessibility.Private, entryPoint.DeclaredAccessibility); 9198Assert.Equal(Accessibility.Internal, entryPoint.ContainingType.DeclaredAccessibility); 9199Assert.Equal(Accessibility.Private, entryPoint.DeclaredAccessibility); 9227Assert.Equal(Accessibility.Internal, entryPoint.ContainingType.DeclaredAccessibility); 9228Assert.Equal(Accessibility.Private, entryPoint.DeclaredAccessibility); 9322Assert.Equal(Accessibility.Private, entryPoint.DeclaredAccessibility); 9326Assert.Equal(Accessibility.Internal, entryPoint.ContainingType.DeclaredAccessibility);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (773)
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1039Assert.Equal(Accessibility.Public, methodDispose.DeclaredAccessibility);
Symbols\AnonymousTypesSymbolTests.cs (3)
1024Assert.Equal(Accessibility.Internal, type.DeclaredAccessibility); 1096Assert.Equal(Accessibility.Public, property.DeclaredAccessibility); 1126Assert.Equal(Accessibility.Public, method.DeclaredAccessibility);
Symbols\AssemblyAndNamespaceTests.cs (2)
38Assert.Equal(Accessibility.NotApplicable, sym.DeclaredAccessibility); 65Assert.Equal(Accessibility.NotApplicable, sym.DeclaredAccessibility);
Symbols\CheckedUserDefinedOperatorsTests.cs (3)
60Assert.Equal(Accessibility.Public, opSymbol.DeclaredAccessibility); 1277Assert.Equal(Accessibility.Public, opSymbol.DeclaredAccessibility); 2511Assert.Equal(Accessibility.Public, opSymbol.DeclaredAccessibility);
Symbols\CompilationCreationTests.cs (4)
2375Assert.Equal(Accessibility.Public, foo2.DeclaredAccessibility); 2394Assert.Equal(Accessibility.Internal, foo3.DeclaredAccessibility); 2435Assert.Equal(Accessibility.Public, type3.DeclaredAccessibility); 2436Assert.Equal(Accessibility.Internal, typeC302.DeclaredAccessibility);
Symbols\DefaultInterfaceImplementationTests.cs (575)
208Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 2024Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 2699Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 2708Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 6419Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 6428Assert.Equal(Accessibility.Public, e1.DeclaredAccessibility); 8443Assert.Equal(Accessibility.Public, m01.DeclaredAccessibility); 8455Assert.Equal(Accessibility.Protected, m02.DeclaredAccessibility); 8467Assert.Equal(Accessibility.ProtectedOrInternal, m03.DeclaredAccessibility); 8479Assert.Equal(Accessibility.Internal, m04.DeclaredAccessibility); 8491Assert.Equal(Accessibility.Private, m05.DeclaredAccessibility); 8503Assert.Equal(Accessibility.Public, m06.DeclaredAccessibility); 8515Assert.Equal(Accessibility.Public, m07.DeclaredAccessibility); 8527Assert.Equal(Accessibility.Public, m08.DeclaredAccessibility); 8539Assert.Equal(Accessibility.Public, m09.DeclaredAccessibility); 8551Assert.Equal(Accessibility.Public, m10.DeclaredAccessibility); 8563Assert.Equal(Accessibility.Public, m11.DeclaredAccessibility); 8575Assert.Equal(Accessibility.Public, m12.DeclaredAccessibility); 8587Assert.Equal(Accessibility.ProtectedAndInternal, m13.DeclaredAccessibility); 8796Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 8835Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 8886foreach (var tuple in new[] { (name: "M1", access: Accessibility.Public), (name: "M2", access: Accessibility.Internal), (name: "M3", access: Accessibility.Private) }) 8983Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 8996Assert.Equal(Accessibility.Public, m2.DeclaredAccessibility); 9009Assert.Equal(Accessibility.Public, m3.DeclaredAccessibility); 9065Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 9123Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 9136Assert.Equal(Accessibility.Private, m2.DeclaredAccessibility); 9149Assert.Equal(Accessibility.Private, m3.DeclaredAccessibility); 9255ValidateMethodModifiersImplicit_10(compilation1.SourceModule, Accessibility.Internal, isStatic: isStatic); 9261CompileAndVerify(compilation1, expectedOutput: !Execute(isStatic) ? null : "M1", verify: Verify(isStatic), symbolValidator: (m) => ValidateMethodModifiersImplicit_10(m, Accessibility.Internal, isStatic: isStatic)).VerifyDiagnostics(); 9263ValidateMethodModifiersImplicit_10(compilation1.SourceModule, Accessibility.Internal, isStatic: isStatic); 9271ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Internal, isStatic: isStatic); 9293ValidateMethodModifiersImplicit_10(compilation3.SourceModule, Accessibility.Internal, isStatic: isStatic); 9306ValidateMethodModifiersImplicit_10(compilation3.SourceModule, Accessibility.Internal, isStatic: isStatic); 9330private static void ValidateMethodModifiersImplicit_10(ModuleSymbol m, Accessibility accessibility, bool isStatic = false) 9335private static void ValidateMethodModifiersExplicit_10(ModuleSymbol m, Accessibility accessibility) 9340private static void ValidateMethodModifiersImplicitInTest2_10(ModuleSymbol m, Accessibility accessibility) 9345private static void ValidateMethodModifiersExplicitInTest2_10(ModuleSymbol m, Accessibility accessibility) 9350private static void ValidateMethodModifiers_10(ModuleSymbol m, bool implementedByBase, bool isExplicit, Accessibility accessibility, bool isStatic = false) 9364private static void ValidateMethodModifiers_10(MethodSymbol m1, Accessibility accessibility, bool isStatic = false) 9409ValidateMethodModifiers_10_02(source1, source2, Accessibility.Internal, 9426Accessibility accessibility, 9433Accessibility accessibility, 9441Accessibility accessibility, 9532CompileAndVerify(compilation1, expectedOutput: "M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersExplicit_10(m, Accessibility.Internal)); 9534ValidateMethodModifiersExplicit_10(compilation1.SourceModule, Accessibility.Internal); 9541ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Internal); 9552ValidateMethodModifiersExplicit_10(compilation3.SourceModule, Accessibility.Internal); 9563ValidateMethodModifiersExplicit_10(compilation4.SourceModule, Accessibility.Internal); 9605ValidateMethodModifiers_10_02(source1, source2, Accessibility.Internal, 9658ValidateMethodModifiers_10_02(source1, source2, Accessibility.Internal, 9716ValidateMethodModifiers_10_02(source1, source2, Accessibility.Internal, 9774ValidateMethodModifiers_10_02(source1, source2, Accessibility.Internal, 9831CompileAndVerify(compilation1, expectedOutput: "Test2.M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersExplicitInTest2_10(m, Accessibility.Internal)); 9833ValidateMethodModifiersExplicitInTest2_10(compilation1.SourceModule, Accessibility.Internal); 9840ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Internal); 9845CompileAndVerify(compilation3, expectedOutput: "Test2.M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersExplicitInTest2_10(m, Accessibility.Internal)); 9847ValidateMethodModifiersExplicitInTest2_10(compilation3.SourceModule, Accessibility.Internal); 9852CompileAndVerify(compilation4, expectedOutput: "Test2.M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersExplicitInTest2_10(m, Accessibility.Internal)); 9854ValidateMethodModifiersExplicitInTest2_10(compilation4.SourceModule, Accessibility.Internal); 9905ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Internal); 9974ValidateMethodModifiersImplicitInTest2_10(compilation1.SourceModule, Accessibility.Internal); 9980CompileAndVerify(compilation1, expectedOutput: !ExecutionConditionUtil.IsMonoOrCoreClr ? null : "M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersImplicitInTest2_10(m, Accessibility.Internal)).VerifyDiagnostics(); 9982ValidateMethodModifiersImplicitInTest2_10(compilation1.SourceModule, Accessibility.Internal); 9990ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Internal); 10006ValidateMethodModifiersImplicitInTest2_10(compilation3.SourceModule, Accessibility.Internal); 10054CompileAndVerify(compilation3, expectedOutput: !ExecutionConditionUtil.IsMonoOrCoreClr ? null : "M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersImplicitInTest2_10(m, Accessibility.Internal)).VerifyDiagnostics(); 10056ValidateMethodModifiersImplicitInTest2_10(compilation3.SourceModule, Accessibility.Internal); 10062CompileAndVerify(compilation3, expectedOutput: !ExecutionConditionUtil.IsMonoOrCoreClr ? null : "M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersImplicitInTest2_10(m, Accessibility.Internal)).VerifyDiagnostics(); 10064ValidateMethodModifiersImplicitInTest2_10(compilation3.SourceModule, Accessibility.Internal); 10102Assert.Equal(Accessibility.Internal, m1.DeclaredAccessibility); 10152Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 10233Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 10247Assert.Equal(Accessibility.Public, m2.DeclaredAccessibility); 10261Assert.Equal(Accessibility.Public, m3.DeclaredAccessibility); 10275Assert.Equal(Accessibility.Public, m4.DeclaredAccessibility); 10341Assert.Equal(Accessibility.Public, m2.DeclaredAccessibility); 10395Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 10409Assert.Equal(Accessibility.Public, m2.DeclaredAccessibility); 10423Assert.Equal(Accessibility.Public, m3.DeclaredAccessibility); 10437Assert.Equal(Accessibility.Private, m4.DeclaredAccessibility); 10451Assert.Equal(Accessibility.Public, m5.DeclaredAccessibility); 10621Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 10635Assert.Equal(Accessibility.Public, m2.DeclaredAccessibility); 10741Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 10755Assert.Equal(Accessibility.Private, m2.DeclaredAccessibility); 10769Assert.Equal(Accessibility.Public, m3.DeclaredAccessibility); 10783Assert.Equal(Accessibility.Public, m4.DeclaredAccessibility); 10797Assert.Equal(Accessibility.Public, m5.DeclaredAccessibility); 10849Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 10912Assert.Equal(Accessibility.Internal, m1.DeclaredAccessibility); 11076Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 11090Assert.Equal(Accessibility.Private, m2.DeclaredAccessibility); 11107Assert.Equal(Accessibility.Private, m2Impl.DeclaredAccessibility); 11183Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 11197Assert.Equal(Accessibility.Private, m2.DeclaredAccessibility); 11214Assert.Equal(Accessibility.Private, m2Impl.DeclaredAccessibility); 11801foreach (var tuple in new[] { (name: "M1", access: Accessibility.Protected), (name: "M2", access: Accessibility.ProtectedOrInternal), (name: "M3", access: Accessibility.ProtectedAndInternal) }) 11863ValidateMethodModifiersImplicit_10(compilation1.SourceModule, Accessibility.Protected); 11886CompileAndVerify(compilation1, expectedOutput: !ExecutionConditionUtil.IsMonoOrCoreClr ? null : "M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersImplicit_10(m, Accessibility.Protected)).VerifyDiagnostics(); 11888ValidateMethodModifiersImplicit_10(compilation1.SourceModule, Accessibility.Protected); 11896ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Protected); 11913ValidateMethodModifiersImplicit_10(compilation3.SourceModule, Accessibility.Protected); 11920CompileAndVerify(compilation3, expectedOutput: !ExecutionConditionUtil.IsMonoOrCoreClr ? null : "M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersImplicit_10(m, Accessibility.Protected)).VerifyDiagnostics(); 11921ValidateMethodModifiersImplicit_10(compilation3.SourceModule, Accessibility.Protected); 11994ValidateMethodModifiersImplicit_10(compilation1.SourceModule, Accessibility.ProtectedOrInternal); 12001CompileAndVerify(compilation1, expectedOutput: !ExecutionConditionUtil.IsMonoOrCoreClr ? null : "M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersImplicit_10(m, Accessibility.ProtectedOrInternal)).VerifyDiagnostics(); 12003ValidateMethodModifiersImplicit_10(compilation1.SourceModule, Accessibility.ProtectedOrInternal); 12011ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.ProtectedOrInternal); 12035ValidateMethodModifiersImplicit_10(compilation3.SourceModule, Accessibility.ProtectedOrInternal); 12041CompileAndVerify(compilation3, expectedOutput: !ExecutionConditionUtil.IsMonoOrCoreClr ? null : "M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersImplicit_10(m, Accessibility.ProtectedOrInternal)).VerifyDiagnostics(); 12042ValidateMethodModifiersImplicit_10(compilation3.SourceModule, Accessibility.ProtectedOrInternal); 12117ValidateMethodModifiersImplicit_10(compilation1.SourceModule, Accessibility.ProtectedAndInternal); 12124CompileAndVerify(compilation1, expectedOutput: !ExecutionConditionUtil.IsMonoOrCoreClr ? null : "M1", verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersImplicit_10(m, Accessibility.ProtectedAndInternal)).VerifyDiagnostics(); 12126ValidateMethodModifiersImplicit_10(compilation1.SourceModule, Accessibility.ProtectedAndInternal); 12134ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.ProtectedAndInternal); 12158ValidateMethodModifiersImplicit_10(compilation3.SourceModule, Accessibility.ProtectedAndInternal); 12171ValidateMethodModifiersImplicit_10(compilation3.SourceModule, Accessibility.ProtectedAndInternal); 12222CompileAndVerify(compilation1, expectedOutput: ExecutionConditionUtil.IsMonoOrCoreClr ? "M1" : null, verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersExplicit_10(m, Accessibility.Protected)); 12224ValidateMethodModifiersExplicit_10(compilation1.SourceModule, Accessibility.Protected); 12232ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.Protected); 12243CompileAndVerify(compilation3, expectedOutput: "M1", symbolValidator: (m) => ValidateMethodModifiersExplicit_10(m, Accessibility.Protected)); 12245ValidateMethodModifiersExplicit_10(compilation3.SourceModule, Accessibility.Protected); 12284CompileAndVerify(compilation1, expectedOutput: ExecutionConditionUtil.IsMonoOrCoreClr ? "M1" : null, verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersExplicit_10(m, Accessibility.ProtectedOrInternal)); 12286ValidateMethodModifiersExplicit_10(compilation1.SourceModule, Accessibility.ProtectedOrInternal); 12294ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.ProtectedOrInternal); 12305CompileAndVerify(compilation3, expectedOutput: "M1", symbolValidator: (m) => ValidateMethodModifiersExplicit_10(m, Accessibility.ProtectedOrInternal)); 12307ValidateMethodModifiersExplicit_10(compilation3.SourceModule, Accessibility.ProtectedOrInternal); 12346CompileAndVerify(compilation1, expectedOutput: ExecutionConditionUtil.IsMonoOrCoreClr ? "M1" : null, verify: VerifyOnMonoOrCoreClr, symbolValidator: (m) => ValidateMethodModifiersExplicit_10(m, Accessibility.ProtectedAndInternal)); 12348ValidateMethodModifiersExplicit_10(compilation1.SourceModule, Accessibility.ProtectedAndInternal); 12356ValidateMethodModifiers_10(compilation2.GetTypeByMetadataName("I1").GetMember<MethodSymbol>("M1"), Accessibility.ProtectedAndInternal); 12370ValidateMethodModifiersExplicit_10(compilation3.SourceModule, Accessibility.ProtectedAndInternal); 12459ValidateMethodModifiers_10_02(source1, source2, Accessibility.Protected, 12528ValidateMethodModifiers_10_02(source1, source2, Accessibility.ProtectedOrInternal, 12571ValidateMethodModifiers_10_02(source1, source2, Accessibility.ProtectedAndInternal, 12669Assert.Equal(Accessibility.Protected, m1.DeclaredAccessibility); 12757Assert.Equal(Accessibility.ProtectedOrInternal, m1.DeclaredAccessibility); 12845Assert.Equal(Accessibility.ProtectedAndInternal, m1.DeclaredAccessibility); 13125Assert.Equal(Accessibility.Public, p01.DeclaredAccessibility); 13139Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 13151Assert.Equal(Accessibility.Protected, p02.DeclaredAccessibility); 13161Assert.Equal(Accessibility.Protected, p02get.DeclaredAccessibility); 13172Assert.Equal(Accessibility.ProtectedOrInternal, p03.DeclaredAccessibility); 13182Assert.Equal(Accessibility.ProtectedOrInternal, p03set.DeclaredAccessibility); 13193Assert.Equal(Accessibility.Internal, p04.DeclaredAccessibility); 13203Assert.Equal(Accessibility.Internal, p04get.DeclaredAccessibility); 13214Assert.Equal(Accessibility.Private, p05.DeclaredAccessibility); 13224Assert.Equal(Accessibility.Private, p05set.DeclaredAccessibility); 13235Assert.Equal(Accessibility.Public, p06.DeclaredAccessibility); 13245Assert.Equal(Accessibility.Public, p06get.DeclaredAccessibility); 13256Assert.Equal(Accessibility.Public, p07.DeclaredAccessibility); 13266Assert.Equal(Accessibility.Public, p07set.DeclaredAccessibility); 13277Assert.Equal(Accessibility.Public, p08.DeclaredAccessibility); 13287Assert.Equal(Accessibility.Public, p08get.DeclaredAccessibility); 13298Assert.Equal(Accessibility.Public, p09.DeclaredAccessibility); 13308Assert.Equal(Accessibility.Public, p09set.DeclaredAccessibility); 13319Assert.Equal(Accessibility.Public, p10.DeclaredAccessibility); 13329Assert.Equal(Accessibility.Public, p10get.DeclaredAccessibility); 13339Assert.Equal(Accessibility.Public, p11.DeclaredAccessibility); 13353Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 13364Assert.Equal(Accessibility.Public, p12.DeclaredAccessibility); 13378Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 13389Assert.Equal(Accessibility.Public, p13.DeclaredAccessibility); 13391ValidateP13Accessor(p13.GetMethod, Accessibility.Public); 13392ValidateP13Accessor(p13.SetMethod, Accessibility.Protected); 13393void ValidateP13Accessor(MethodSymbol accessor, Accessibility accessibility) 13414Assert.Equal(Accessibility.Public, p14.DeclaredAccessibility); 13416ValidateP14Accessor(p14.GetMethod, Accessibility.ProtectedOrInternal); 13417ValidateP14Accessor(p14.SetMethod, Accessibility.Public); 13418void ValidateP14Accessor(MethodSymbol accessor, Accessibility accessibility) 13439Assert.Equal(Accessibility.Public, p15.DeclaredAccessibility); 13441ValidateP15Accessor(p15.GetMethod, Accessibility.Public); 13442ValidateP15Accessor(p15.SetMethod, Accessibility.Internal); 13443void ValidateP15Accessor(MethodSymbol accessor, Accessibility accessibility) 13464Assert.Equal(Accessibility.Public, p16.DeclaredAccessibility); 13466ValidateP16Accessor(p16.GetMethod, Accessibility.Private); 13467ValidateP16Accessor(p16.SetMethod, Accessibility.Public); 13468void ValidateP16Accessor(MethodSymbol accessor, Accessibility accessibility) 13490Assert.Equal(Accessibility.Public, p17.DeclaredAccessibility); 13500Assert.Equal(Accessibility.Private, p17get.DeclaredAccessibility); 13511Assert.Equal(Accessibility.ProtectedAndInternal, p18.DeclaredAccessibility); 13521Assert.Equal(Accessibility.ProtectedAndInternal, p18get.DeclaredAccessibility); 13531Assert.Equal(Accessibility.Public, p19.DeclaredAccessibility); 13533ValidateP13Accessor(p19.GetMethod, Accessibility.Public); 13534ValidateP13Accessor(p19.SetMethod, Accessibility.ProtectedAndInternal); 13925Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 13935Assert.Equal(Accessibility.Public, p1get.DeclaredAccessibility); 14017Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 14033Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 14091Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 14106Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 14276foreach (var tuple in new[] { (name: "P1", access: Accessibility.Public), 14277(name: "P2", access: Accessibility.Internal), 14278(name: "P3", access: Accessibility.Private), 14279(name: "P4", access: Accessibility.Internal), 14280(name: "P5", access: Accessibility.Internal), 14281(name: "P6", access: Accessibility.Internal), 14282(name: "P7", access: Accessibility.Internal), 14283(name: "P8", access: Accessibility.Internal)}) 14404Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 14415Assert.Equal(Accessibility.Public, p1get.DeclaredAccessibility); 14427Assert.Equal(Accessibility.Public, p2.DeclaredAccessibility); 14438Assert.Equal(Accessibility.Public, p2set.DeclaredAccessibility); 14450Assert.Equal(Accessibility.Public, p3.DeclaredAccessibility); 14461Assert.Equal(Accessibility.Public, p3get.DeclaredAccessibility); 14642Assert.Equal(Accessibility.Private, p1.DeclaredAccessibility); 14674Assert.Equal(Accessibility.Private, accessor.DeclaredAccessibility); 14746Assert.Equal(Accessibility.Private, p1.DeclaredAccessibility); 14757Assert.Equal(Accessibility.Private, p1get.DeclaredAccessibility); 14769Assert.Equal(Accessibility.Private, p2.DeclaredAccessibility); 14780Assert.Equal(Accessibility.Private, p2get.DeclaredAccessibility); 14791Assert.Equal(Accessibility.Private, p3.DeclaredAccessibility); 14806Assert.Equal(Accessibility.Private, accessor.DeclaredAccessibility); 14819Assert.Equal(Accessibility.Private, p4.DeclaredAccessibility); 14830Assert.Equal(Accessibility.Private, p4get.DeclaredAccessibility); 14875ValidatePropertyModifiers_11_01(source1, source2, Accessibility.Internal, 14900private void ValidatePropertyModifiers_11_01(string source1, string source2, Accessibility accessibility, 14907private void ValidatePropertyModifiers_11_01(string source1, string source2, Accessibility accessibility, 14995private static void ValidatePropertyModifiers_11(ModuleSymbol m, Accessibility accessibility) 15012private static void ValidatePropertyModifiers_11(PropertySymbol p1, Accessibility accessibility) 15023private static void ValidatePropertyAccessorModifiers_11(MethodSymbol m1, Accessibility accessibility) 16194Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 16226Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 16324Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 16336Assert.Equal(Accessibility.Public, p1get.DeclaredAccessibility); 16350Assert.Equal(Accessibility.Public, p2.DeclaredAccessibility); 16362Assert.Equal(Accessibility.Public, p2get.DeclaredAccessibility); 16376Assert.Equal(Accessibility.Public, p3.DeclaredAccessibility); 16388Assert.Equal(Accessibility.Public, p3set.DeclaredAccessibility); 16600Assert.Equal(Accessibility.Public, p2.DeclaredAccessibility); 16634Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 16790Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 16802Assert.Equal(Accessibility.Public, p1get.DeclaredAccessibility); 16816Assert.Equal(Accessibility.Public, p2.DeclaredAccessibility); 16828Assert.Equal(Accessibility.Public, p2set.DeclaredAccessibility); 16844Assert.Equal(Accessibility.Public, p3.DeclaredAccessibility); 16860Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 16875Assert.Equal(Accessibility.Private, p4.DeclaredAccessibility); 16887Assert.Equal(Accessibility.Private, p4get.DeclaredAccessibility); 16900Assert.Equal(Accessibility.Public, p5.DeclaredAccessibility); 16912Assert.Equal(Accessibility.Public, p5set.DeclaredAccessibility); 17033Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 17045Assert.Equal(Accessibility.Public, p1get.DeclaredAccessibility); 17059Assert.Equal(Accessibility.Public, p2.DeclaredAccessibility); 17071Assert.Equal(Accessibility.Public, p2get.DeclaredAccessibility); 17084Assert.Equal(Accessibility.Public, p3.DeclaredAccessibility); 17100Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 17113Assert.Equal(Accessibility.Private, p4.DeclaredAccessibility); 17129Assert.Equal(Accessibility.Private, accessor.DeclaredAccessibility); 17143Assert.Equal(Accessibility.Public, p5.DeclaredAccessibility); 17155Assert.Equal(Accessibility.Public, p5get.DeclaredAccessibility); 17282Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 17298Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 17313Assert.Equal(Accessibility.Private, p2.DeclaredAccessibility); 17325Assert.Equal(Accessibility.Private, p2get.DeclaredAccessibility); 17338Assert.Equal(Accessibility.Public, p3.DeclaredAccessibility); 17354Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 17368Assert.Equal(Accessibility.Public, p4.DeclaredAccessibility); 17384Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 17398Assert.Equal(Accessibility.Public, p5.DeclaredAccessibility); 17410Assert.Equal(Accessibility.Public, p5get.DeclaredAccessibility); 17451ValidatePropertyModifiers_20(source1, source2, Accessibility.Internal); 17454private void ValidatePropertyModifiers_20(string source1, string source2, Accessibility accessibility) 17721ValidatePropertyModifiers_22(source1, Accessibility.Internal); 17724private void ValidatePropertyModifiers_22(string source1, Accessibility accessibility) 17761Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 17769ValidateAccessor(p1.SetMethod, Accessibility.Public); 17773ValidateAccessor(p1.GetMethod, Accessibility.Public); 17781void ValidateAccessor(MethodSymbol accessor, Accessibility access) 17784Assert.Equal(accessor.DeclaredAccessibility != Accessibility.Private, accessor.IsVirtual); 17785Assert.Equal(accessor.DeclaredAccessibility != Accessibility.Private, accessor.IsMetadataVirtual()); 17792Assert.Same(accessor.DeclaredAccessibility == Accessibility.Private ? null : accessor, test1.FindImplementationForInterfaceMember(accessor)); 18295ValidateProperty23(GetSingleProperty(im, "I3"), false, Accessibility.Private, Accessibility.Public, m.GlobalNamespace.GetTypeMember("Test3")); 18296ValidateProperty23(GetSingleProperty(im, "I4"), false, Accessibility.Public, Accessibility.Private, m.GlobalNamespace.GetTypeMember("Test4")); 18297ValidateProperty23(GetSingleProperty(im, "I5"), false, Accessibility.Private, Accessibility.Public, m.GlobalNamespace.GetTypeMember("Test5")); 18298ValidateProperty23(GetSingleProperty(im, "I6"), false, Accessibility.Public, Accessibility.Private, m.GlobalNamespace.GetTypeMember("Test6")); 18321ValidateProperty23(GetSingleProperty(compilation2, "I3"), false, Accessibility.Private, Accessibility.Public); 18322ValidateProperty23(GetSingleProperty(compilation2, "I4"), false, Accessibility.Public, Accessibility.Private); 18323ValidateProperty23(GetSingleProperty(compilation2, "I5"), false, Accessibility.Private, Accessibility.Public); 18324ValidateProperty23(GetSingleProperty(compilation2, "I6"), false, Accessibility.Public, Accessibility.Private); 18341private static void ValidateProperty23(PropertySymbol p1, bool isAbstract, Accessibility getAccess, Accessibility setAccess, NamedTypeSymbol test1 = null) 18349Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 18371private static void ValidateMethod23(PropertySymbol p1, MethodSymbol m1, bool isAbstract, Accessibility access, NamedTypeSymbol test1, MethodSymbol implementingMethod) 18375Assert.Equal(Accessibility.Private, access); 18381Assert.NotEqual(isAbstract || access == Accessibility.Private, m1.IsVirtual); 18382Assert.Equal(isAbstract || access != Accessibility.Private, m1.IsMetadataVirtual()); 18392Assert.Same(access != Accessibility.Private ? implementingMethod : null, test1.FindImplementationForInterfaceMember(m1)); 18436ValidatePropertyModifiers_23(source1, source2, Accessibility.Internal, Accessibility.Public, 18450private void ValidatePropertyModifiers_23(string source1, string source2, Accessibility getAccess, Accessibility setAccess, params DiagnosticDescription[] expectedIn9) 18455private void ValidatePropertyModifiers_23(string source1, string source2, Accessibility getAccess, Accessibility setAccess, DiagnosticDescription[] expectedIn9, params DiagnosticDescription[] expectedAcrossAssemblyBoundaries) 19174ValidatePropertyModifiers_23(source1, source2, Accessibility.Public, Accessibility.Internal, 19860ValidateMethod(p1get, Accessibility.Public); 19861ValidateMethod(p1set, Accessibility.Internal); 19875Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 19878void ValidateMethod(MethodSymbol m1, Accessibility access) 19904ValidateMethod(p1get, Accessibility.Public); 19905ValidateMethod(p1set, Accessibility.Internal); 20514foreach (var tuple in new[] { (name: "P1", access: Accessibility.Protected, getAccess: Accessibility.Protected, setAccess: Accessibility.Protected), 20515(name: "P2", access: Accessibility.ProtectedOrInternal, getAccess: Accessibility.ProtectedOrInternal, setAccess: Accessibility.ProtectedOrInternal), 20516(name: "P3", access: Accessibility.ProtectedAndInternal, getAccess: Accessibility.ProtectedAndInternal, setAccess: Accessibility.ProtectedAndInternal), 20517(name: "P4", access: Accessibility.Public, getAccess: Accessibility.Protected, setAccess: Accessibility.Public), 20518(name: "P5", access: Accessibility.Public, getAccess: Accessibility.Public, setAccess: Accessibility.ProtectedOrInternal), 20519(name: "P6", access: Accessibility.Public, getAccess: Accessibility.ProtectedAndInternal, setAccess: Accessibility.Public)}) 20536void validateAccessor(MethodSymbol accessor, Accessibility accessibility) 20593ValidatePropertyModifiers_11_01(source1, source2, Accessibility.Protected, 20649ValidatePropertyModifiers_11_01(source1, source2, Accessibility.ProtectedOrInternal, 20705ValidatePropertyModifiers_11_01(source1, source2, Accessibility.ProtectedAndInternal, 20770ValidatePropertyModifiers_23(source1, source2, Accessibility.Protected, Accessibility.Public, 20817ValidatePropertyModifiers_23(source1, source2, Accessibility.ProtectedOrInternal, Accessibility.Public, 20864ValidatePropertyModifiers_23(source1, source2, Accessibility.Public, Accessibility.ProtectedAndInternal, 21162ValidatePropertyModifiers_20(source1, source2, Accessibility.Protected); 21201ValidatePropertyModifiers_20(source1, source2, Accessibility.ProtectedOrInternal); 21240ValidatePropertyModifiers_20(source1, source2, Accessibility.ProtectedAndInternal); 21339ValidatePropertyModifiers_22(source1, Accessibility.Protected); 21423ValidatePropertyModifiers_22(source1, Accessibility.ProtectedOrInternal); 21522ValidatePropertyModifiers_22(source1, Accessibility.ProtectedAndInternal); 21602Assert.Equal(Accessibility.Public, p01.DeclaredAccessibility); 21616Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 21628Assert.Equal(Accessibility.Protected, p02.DeclaredAccessibility); 21638Assert.Equal(Accessibility.Protected, p02get.DeclaredAccessibility); 21649Assert.Equal(Accessibility.ProtectedOrInternal, p03.DeclaredAccessibility); 21659Assert.Equal(Accessibility.ProtectedOrInternal, p03set.DeclaredAccessibility); 21670Assert.Equal(Accessibility.Internal, p04.DeclaredAccessibility); 21680Assert.Equal(Accessibility.Internal, p04get.DeclaredAccessibility); 21691Assert.Equal(Accessibility.Private, p05.DeclaredAccessibility); 21701Assert.Equal(Accessibility.Private, p05set.DeclaredAccessibility); 21712Assert.Equal(Accessibility.Public, p06.DeclaredAccessibility); 21722Assert.Equal(Accessibility.Public, p06get.DeclaredAccessibility); 21733Assert.Equal(Accessibility.Public, p07.DeclaredAccessibility); 21743Assert.Equal(Accessibility.Public, p07set.DeclaredAccessibility); 21754Assert.Equal(Accessibility.Public, p08.DeclaredAccessibility); 21764Assert.Equal(Accessibility.Public, p08get.DeclaredAccessibility); 21775Assert.Equal(Accessibility.Public, p09.DeclaredAccessibility); 21785Assert.Equal(Accessibility.Public, p09set.DeclaredAccessibility); 21796Assert.Equal(Accessibility.Public, p10.DeclaredAccessibility); 21806Assert.Equal(Accessibility.Public, p10get.DeclaredAccessibility); 21816Assert.Equal(Accessibility.Public, p11.DeclaredAccessibility); 21830Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 21841Assert.Equal(Accessibility.Public, p12.DeclaredAccessibility); 21855Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 21866Assert.Equal(Accessibility.Public, p13.DeclaredAccessibility); 21868ValidateP13Accessor(p13.GetMethod, Accessibility.Public); 21869ValidateP13Accessor(p13.SetMethod, Accessibility.Protected); 21870void ValidateP13Accessor(MethodSymbol accessor, Accessibility accessibility) 21891Assert.Equal(Accessibility.Public, p14.DeclaredAccessibility); 21893ValidateP14Accessor(p14.GetMethod, Accessibility.ProtectedOrInternal); 21894ValidateP14Accessor(p14.SetMethod, Accessibility.Public); 21895void ValidateP14Accessor(MethodSymbol accessor, Accessibility accessibility) 21916Assert.Equal(Accessibility.Public, p15.DeclaredAccessibility); 21918ValidateP15Accessor(p15.GetMethod, Accessibility.Public); 21919ValidateP15Accessor(p15.SetMethod, Accessibility.Internal); 21920void ValidateP15Accessor(MethodSymbol accessor, Accessibility accessibility) 21941Assert.Equal(Accessibility.Public, p16.DeclaredAccessibility); 21943ValidateP16Accessor(p16.GetMethod, Accessibility.Private); 21944ValidateP16Accessor(p16.SetMethod, Accessibility.Public); 21945void ValidateP16Accessor(MethodSymbol accessor, Accessibility accessibility) 21967Assert.Equal(Accessibility.Public, p17.DeclaredAccessibility); 21977Assert.Equal(Accessibility.Private, p17get.DeclaredAccessibility); 21988Assert.Equal(Accessibility.ProtectedAndInternal, p18.DeclaredAccessibility); 21998Assert.Equal(Accessibility.ProtectedAndInternal, p18get.DeclaredAccessibility); 22008Assert.Equal(Accessibility.Public, p19.DeclaredAccessibility); 22010ValidateP13Accessor(p19.GetMethod, Accessibility.Public); 22011ValidateP13Accessor(p19.SetMethod, Accessibility.ProtectedAndInternal); 22694ValidatePropertyModifiers_11_01(source1, source2, Accessibility.Internal, 24466ValidatePropertyModifiers_20(source1, source2, Accessibility.Internal); 24640ValidatePropertyModifiers_22(source1, Accessibility.Internal); 25164ValidatePropertyModifiers_23(source1, source2, Accessibility.Internal, Accessibility.Public, 25827ValidatePropertyModifiers_23(source1, source2, Accessibility.Public, Accessibility.Internal, 26847Assert.Equal(Accessibility.Public, p01.DeclaredAccessibility); 26861Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 26873Assert.Equal(Accessibility.Protected, p02.DeclaredAccessibility); 26883Assert.Equal(Accessibility.Protected, p02get.DeclaredAccessibility); 26894Assert.Equal(Accessibility.ProtectedOrInternal, p03.DeclaredAccessibility); 26904Assert.Equal(Accessibility.ProtectedOrInternal, p03set.DeclaredAccessibility); 26915Assert.Equal(Accessibility.Internal, p04.DeclaredAccessibility); 26925Assert.Equal(Accessibility.Internal, p04get.DeclaredAccessibility); 26936Assert.Equal(Accessibility.Private, p05.DeclaredAccessibility); 26946Assert.Equal(Accessibility.Private, p05set.DeclaredAccessibility); 26957Assert.Equal(Accessibility.Public, p06.DeclaredAccessibility); 26967Assert.Equal(Accessibility.Public, p06get.DeclaredAccessibility); 26978Assert.Equal(Accessibility.Public, p07.DeclaredAccessibility); 26988Assert.Equal(Accessibility.Public, p07set.DeclaredAccessibility); 26999Assert.Equal(Accessibility.Public, p08.DeclaredAccessibility); 27009Assert.Equal(Accessibility.Public, p08get.DeclaredAccessibility); 27020Assert.Equal(Accessibility.Public, p09.DeclaredAccessibility); 27030Assert.Equal(Accessibility.Public, p09set.DeclaredAccessibility); 27041Assert.Equal(Accessibility.Public, p10.DeclaredAccessibility); 27051Assert.Equal(Accessibility.Public, p10get.DeclaredAccessibility); 27063Assert.Equal(Accessibility.Public, p11.DeclaredAccessibility); 27077Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 27089Assert.Equal(Accessibility.ProtectedAndInternal, p14.DeclaredAccessibility); 27103Assert.Equal(Accessibility.ProtectedAndInternal, accessor.DeclaredAccessibility); 27645Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 27661Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 27719Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 27734Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 27807foreach (var tuple in new[] { (name: "P1", access: Accessibility.Public), 27808(name: "P2", access: Accessibility.Internal), 27809(name: "P3", access: Accessibility.Private)}) 27987Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 28002Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 28014Assert.Equal(Accessibility.Public, p2.DeclaredAccessibility); 28029Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 28041Assert.Equal(Accessibility.Public, p3.DeclaredAccessibility); 28056Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 28148Assert.Equal(Accessibility.Private, p1.DeclaredAccessibility); 28164Assert.Equal(Accessibility.Private, accessor.DeclaredAccessibility); 28244Assert.Equal(Accessibility.Private, p1.DeclaredAccessibility); 28259Assert.Equal(Accessibility.Private, accessor.DeclaredAccessibility); 28271Assert.Equal(Accessibility.Private, p2.DeclaredAccessibility); 28286Assert.Equal(Accessibility.Private, accessor.DeclaredAccessibility); 28298Assert.Equal(Accessibility.Private, p3.DeclaredAccessibility); 28313Assert.Equal(Accessibility.Private, accessor.DeclaredAccessibility); 28325Assert.Equal(Accessibility.Private, p4.DeclaredAccessibility); 28340Assert.Equal(Accessibility.Private, accessor.DeclaredAccessibility); 28386ValidateEventModifiers_11(source1, source2, Accessibility.Internal, 28411private void ValidateEventModifiers_11(string source1, string source2, Accessibility accessibility, DiagnosticDescription[] expectedIn9, params DiagnosticDescription[] expectedNoImplementation) 28416private void ValidateEventModifiers_11(string source1, string source2, Accessibility accessibility, DiagnosticDescription[] expectedIn9, DiagnosticDescription[] expectedAcrossAssemblyBoundaries, params DiagnosticDescription[] expectedNoImplementation) 29597Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 29613Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 29712Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 29728Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 29742Assert.Equal(Accessibility.Public, p2.DeclaredAccessibility); 29758Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 29772Assert.Equal(Accessibility.Public, p3.DeclaredAccessibility); 29788Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30013Assert.Equal(Accessibility.Public, p2.DeclaredAccessibility); 30047Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30125Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 30141Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30155Assert.Equal(Accessibility.Public, p2.DeclaredAccessibility); 30171Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30185Assert.Equal(Accessibility.Public, p3.DeclaredAccessibility); 30201Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30214Assert.Equal(Accessibility.Private, p4.DeclaredAccessibility); 30230Assert.Equal(Accessibility.Private, accessor.DeclaredAccessibility); 30243Assert.Equal(Accessibility.Public, p5.DeclaredAccessibility); 30259Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30455Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 30471Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30485Assert.Equal(Accessibility.Public, p2.DeclaredAccessibility); 30501Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30515Assert.Equal(Accessibility.Public, p3.DeclaredAccessibility); 30531Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30544Assert.Equal(Accessibility.Private, p4.DeclaredAccessibility); 30560Assert.Equal(Accessibility.Private, accessor.DeclaredAccessibility); 30676Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility); 30692Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30706Assert.Equal(Accessibility.Private, p2.DeclaredAccessibility); 30722Assert.Equal(Accessibility.Private, accessor.DeclaredAccessibility); 30736Assert.Equal(Accessibility.Public, p3.DeclaredAccessibility); 30752Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30766Assert.Equal(Accessibility.Public, p4.DeclaredAccessibility); 30782Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30795Assert.Equal(Accessibility.Public, p5.DeclaredAccessibility); 30811Assert.Equal(Accessibility.Public, accessor.DeclaredAccessibility); 30856ValidateEventModifiers_20(source1, source2, Accessibility.Internal); 30859private void ValidateEventModifiers_20(string source1, string source2, Accessibility accessibility) 31226foreach (var tuple in new[] { (name: "P1", access: Accessibility.Protected), 31227(name: "P2", access: Accessibility.ProtectedOrInternal), 31228(name: "P3", access: Accessibility.ProtectedAndInternal)}) 31302ValidateEventModifiers_11(source1, source2, Accessibility.Protected, 31359ValidateEventModifiers_11(source1, source2, Accessibility.ProtectedOrInternal, 31417ValidateEventModifiers_11(source1, source2, Accessibility.ProtectedAndInternal, 31614ValidateEventModifiers_20(source1, source2, Accessibility.Protected); 31656ValidateEventModifiers_20(source1, source2, Accessibility.ProtectedOrInternal); 31698ValidateEventModifiers_20(source1, source2, Accessibility.ProtectedAndInternal); 31748private void ValidateNestedTypes_01(string source1, Accessibility expected = Accessibility.Public, TargetFramework targetFramework = TargetFramework.Standard, bool execute = true, Verification verify = default) 31814Assert.Equal(Accessibility.Public, compilation1.GetMember("I1.T" + i).DeclaredAccessibility); 31930ValidateNestedTypes_01(source0 + source1, Accessibility.Protected, targetFramework: TargetFramework.NetCoreApp, execute: ExecutionConditionUtil.IsMonoOrCoreClr, verify: VerifyOnMonoOrCoreClr_FailsIlVerify); 31938Assert.Equal(Accessibility.Protected, compilation1.GetMember("I1.T" + i).DeclaredAccessibility); 32120ValidateNestedTypes_01(source0 + source1, Accessibility.ProtectedOrInternal, targetFramework: TargetFramework.NetCoreApp, execute: ExecutionConditionUtil.IsMonoOrCoreClr, verify: VerifyOnMonoOrCoreClr); 32121ValidateNestedTypes_01(source0 + source2, Accessibility.ProtectedOrInternal, targetFramework: TargetFramework.NetCoreApp, execute: ExecutionConditionUtil.IsMonoOrCoreClr, verify: VerifyOnMonoOrCoreClr); 32129Assert.Equal(Accessibility.ProtectedOrInternal, compilation1.GetMember("I1.T" + i).DeclaredAccessibility); 32252ValidateNestedTypes_01(source1 + source2, Accessibility.Internal); 32336ValidateNestedTypes_01(source1, Accessibility.Private); 32479ValidateNestedTypes_01(source0 + source1, Accessibility.ProtectedAndInternal, targetFramework: TargetFramework.NetCoreApp, execute: ExecutionConditionUtil.IsMonoOrCoreClr, verify: VerifyOnMonoOrCoreClr_FailsIlVerify); 32487Assert.Equal(Accessibility.ProtectedAndInternal, compilation1.GetMember("I1.T" + i).DeclaredAccessibility); 33072Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 33909Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 34025Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 36895Assert.Equal(Accessibility.Private, method.DeclaredAccessibility); 37091Assert.Same(interfaceAccessor.DeclaredAccessibility == Accessibility.Private ? null : accessor, implementingType.FindImplementationForInterfaceMember(interfaceAccessor)); 37127Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 38019Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 40160Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 43748Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility); 43749Assert.Equal(Accessibility.Protected, f2.DeclaredAccessibility); 43750Assert.Equal(Accessibility.ProtectedOrInternal, f3.DeclaredAccessibility); 43751Assert.Equal(Accessibility.ProtectedAndInternal, f4.DeclaredAccessibility); 43807Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility); 43808Assert.Equal(Accessibility.Public, f2.DeclaredAccessibility); 43809Assert.Equal(Accessibility.Internal, f3.DeclaredAccessibility); 43810Assert.Equal(Accessibility.Private, f4.DeclaredAccessibility); 43947Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility); 43948Assert.Equal(Accessibility.Public, f2.DeclaredAccessibility); 43949Assert.Equal(Accessibility.Internal, f3.DeclaredAccessibility); 43950Assert.Equal(Accessibility.Private, f4.DeclaredAccessibility); 44077Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility); 44078Assert.Equal(Accessibility.Public, f2.DeclaredAccessibility); 44079Assert.Equal(Accessibility.Internal, f3.DeclaredAccessibility); 44080Assert.Equal(Accessibility.Private, f4.DeclaredAccessibility); 44317Assert.Equal(Accessibility.Protected, f1.DeclaredAccessibility); 44318Assert.Equal(Accessibility.ProtectedOrInternal, f2.DeclaredAccessibility); 44319Assert.Equal(Accessibility.ProtectedAndInternal, f3.DeclaredAccessibility); 44669Assert.Equal(Accessibility.Private, cctor.DeclaredAccessibility); 44767Assert.Equal(Accessibility.Private, cctor.DeclaredAccessibility); 45074Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility); 45075Assert.Equal(Accessibility.Public, f2.DeclaredAccessibility); 45076Assert.Equal(Accessibility.Internal, f3.DeclaredAccessibility); 45077Assert.Equal(Accessibility.Private, f4.DeclaredAccessibility); 45230Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility); 45231Assert.Equal(Accessibility.Public, f2.DeclaredAccessibility); 45232Assert.Equal(Accessibility.Internal, f3.DeclaredAccessibility); 45233Assert.Equal(Accessibility.Private, f4.DeclaredAccessibility); 45365Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility); 45366Assert.Equal(Accessibility.Public, f2.DeclaredAccessibility); 45367Assert.Equal(Accessibility.Internal, f3.DeclaredAccessibility); 45369Assert.Equal(Accessibility.Private, f1.SetMethod.DeclaredAccessibility); 45370Assert.Equal(Accessibility.Private, f2.SetMethod.DeclaredAccessibility); 45371Assert.Equal(Accessibility.Private, f3.SetMethod.DeclaredAccessibility); 45558Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility); 45559Assert.Equal(Accessibility.Public, f2.DeclaredAccessibility); 45560Assert.Equal(Accessibility.Internal, f3.DeclaredAccessibility); 45561Assert.Equal(Accessibility.Private, f4.DeclaredAccessibility); 45698Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility); 45699Assert.Equal(Accessibility.Public, f2.DeclaredAccessibility); 45700Assert.Equal(Accessibility.Internal, f3.DeclaredAccessibility); 45701Assert.Equal(Accessibility.Private, f4.DeclaredAccessibility); 49536Assert.Equal(Accessibility.Public, member.DeclaredAccessibility); 49584Assert.Equal(Accessibility.Public, member.DeclaredAccessibility); 51122Assert.Equal(Accessibility.Private, m.DeclaredAccessibility); 52045Assert.Equal(Accessibility.Private, i2m1.DeclaredAccessibility); 52168Assert.Equal(Accessibility.Private, i2m1.DeclaredAccessibility); 52563Assert.Equal(Accessibility.Private, reabstracting.DeclaredAccessibility); 53745Assert.Equal(Accessibility.Private, i2p1.DeclaredAccessibility); 53761Assert.Equal(Accessibility.Private, i2p1Get.DeclaredAccessibility); 53778Assert.Equal(Accessibility.Private, i2p1Set.DeclaredAccessibility); 57527Assert.Equal(Accessibility.Private, reabstracting.DeclaredAccessibility);
Symbols\IndexerTests.cs (3)
2715var publicIndexer = indexers.Single(indexer => indexer.DeclaredAccessibility == Accessibility.Public); 2716var protectedIndexer = indexers.Single(indexer => indexer.DeclaredAccessibility == Accessibility.Protected); 2717var privateIndexer = indexers.Single(indexer => indexer.DeclaredAccessibility == Accessibility.Private);
Symbols\Metadata\MetadataMemberTests.cs (5)
165Assert.Equal(Accessibility.Protected, ctor.DeclaredAccessibility); 206Assert.Equal(Accessibility.Public, member1.DeclaredAccessibility); 263Assert.Equal(Accessibility.NotApplicable, p1.DeclaredAccessibility); 314Assert.Equal(Accessibility.Public, member2.DeclaredAccessibility); 360Assert.Equal(Accessibility.NotApplicable, p1.DeclaredAccessibility);
Symbols\Metadata\MetadataTypeTests.cs (7)
46Assert.Equal(Accessibility.Public, ns.DeclaredAccessibility); 90Assert.Equal(Accessibility.Internal, class1.DeclaredAccessibility); 140Assert.Equal(Accessibility.Public, type1.DeclaredAccessibility); 188Assert.Equal(Accessibility.Public, type1.DeclaredAccessibility); 238Assert.Equal(Accessibility.Public, type1.DeclaredAccessibility); 302Assert.Equal(Accessibility.NotApplicable, type2.DeclaredAccessibility); 303Assert.Equal(Accessibility.NotApplicable, type3.DeclaredAccessibility);
Symbols\Metadata\PE\LoadingFields.cs (5)
60Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility); 70Assert.Equal(Accessibility.Protected, f2.DeclaredAccessibility); 78Assert.Equal(Accessibility.Internal, f3.DeclaredAccessibility); 86Assert.Equal(Accessibility.ProtectedOrInternal, f4.DeclaredAccessibility); 94Assert.Equal(Accessibility.Protected, f5.DeclaredAccessibility);
Symbols\Metadata\PE\LoadingGenericTypeParameters.cs (1)
52Assert.Equal(Accessibility.NotApplicable, varC1_T.DeclaredAccessibility);
Symbols\Metadata\PE\LoadingMethods.cs (6)
57Assert.Equal(Accessibility.Public, localM1.DeclaredAccessibility); 62Assert.Equal(Accessibility.Protected, localM2.DeclaredAccessibility); 69Assert.Equal(Accessibility.NotApplicable, localM1_1.DeclaredAccessibility); 80Assert.Equal(Accessibility.Protected, localM3.DeclaredAccessibility); 84Assert.Equal(Accessibility.Internal, localM4.DeclaredAccessibility); 88Assert.Equal(Accessibility.ProtectedOrInternal, localM5.DeclaredAccessibility);
Symbols\Metadata\PE\TypeAccessibility.cs (6)
38Assert.Equal(Accessibility.Public, obj.DeclaredAccessibility); 44Assert.Equal(Accessibility.Internal, frameworkAssembly.DeclaredAccessibility); 58Assert.Equal(Accessibility.Internal, controlKeyState.DeclaredAccessibility); 68Assert.Equal(Accessibility.Public, contextForm.DeclaredAccessibility); 90Assert.Equal(Accessibility.Protected, serializedArg.DeclaredAccessibility); 108Assert.Equal(Accessibility.ProtectedOrInternal, exceptionFromErrorCode.DeclaredAccessibility);
Symbols\MissingSpecialMember.cs (7)
160Assert.Equal(Accessibility.NotApplicable, specialType.DeclaredAccessibility); 165Assert.Equal(Accessibility.Internal, lookupType.DeclaredAccessibility); 273Assert.Equal(Accessibility.Internal, wellKnownType.DeclaredAccessibility); 277Assert.Equal(Accessibility.Internal, lookupType.DeclaredAccessibility); 306Assert.Equal(Accessibility.NotApplicable, wellKnownType.DeclaredAccessibility); 310Assert.NotEqual(Accessibility.NotApplicable, lookupType.DeclaredAccessibility); 500Assert.Equal(Accessibility.Public, wellKnown.DeclaredAccessibility);
Symbols\MockNamedTypeSymbol.cs (2)
180public override Accessibility DeclaredAccessibility 184return Accessibility.Public;
Symbols\OverriddenOrHiddenMembersTests.cs (11)
2921p.DeclaredAccessibility == (p.ContainingType.Name == "A" ? Accessibility.ProtectedOrInternal : Accessibility.Protected)); 2969p.DeclaredAccessibility == (p.ContainingType.Name == "A" ? Accessibility.ProtectedOrInternal : Accessibility.Protected)); 3016AssertEx.All(properties, p => p.DeclaredAccessibility == Accessibility.Public); 3063AssertEx.All(properties, p => p.DeclaredAccessibility == Accessibility.Public); 3110AssertEx.All(properties, p => p.DeclaredAccessibility == Accessibility.Public); 3157AssertEx.All(properties, p => p.DeclaredAccessibility == Accessibility.Public); 3231AssertEx.All(properties, p => p.DeclaredAccessibility == Accessibility.ProtectedOrInternal); 3285e.DeclaredAccessibility == (e.ContainingType.Name == "A" ? Accessibility.ProtectedOrInternal : Accessibility.Protected));
Symbols\PartialPropertiesTests.cs (2)
1457Assert.Equal(Accessibility.Private, p1Def.DeclaredAccessibility); 1460Assert.Equal(Accessibility.Private, p1DefPublic.DeclaredAccessibility);
Symbols\Retargeting\RetargetCustomModifiers.cs (1)
185Assert.Equal(Accessibility.Public, volatileFld.DeclaredAccessibility);
Symbols\Source\AccessTests.cs (1)
31Assert.Equal(Accessibility.Public, a.DeclaredAccessibility);
Symbols\Source\BaseClassTests.cs (1)
1259Assert.Equal(Accessibility.Private, d.DeclaredAccessibility);
Symbols\Source\DelegateTests.cs (2)
137Assert.Equal(Accessibility.Internal, v.DeclaredAccessibility); 209Assert.Equal(Accessibility.Internal, d.DeclaredAccessibility);
Symbols\Source\EventTests.cs (12)
84Assert.Equal(Accessibility.Public, @event.DeclaredAccessibility); 102Assert.Equal(Accessibility.Private, associatedField.DeclaredAccessibility); 123Assert.Equal(Accessibility.Internal, @event.DeclaredAccessibility); 140Assert.Equal(Accessibility.Private, associatedField.DeclaredAccessibility); 161Assert.Equal(Accessibility.Protected, @event.DeclaredAccessibility); 196Assert.Equal(Accessibility.Private, @event.DeclaredAccessibility); 1868Assert.Equal(Accessibility.Private, event1.AddMethod.DeclaredAccessibility); 1870Assert.Equal(Accessibility.Public, event1.RemoveMethod.DeclaredAccessibility); 1873Assert.Equal(Accessibility.Protected, event2.AddMethod.DeclaredAccessibility); 1875Assert.Equal(Accessibility.Public, event2.RemoveMethod.DeclaredAccessibility); 1878Assert.Equal(Accessibility.Internal, event3.AddMethod.DeclaredAccessibility); 1880Assert.Equal(Accessibility.Public, event3.RemoveMethod.DeclaredAccessibility);
Symbols\Source\ExpressionBodiedPropertyTests.cs (2)
471Assert.Equal(Accessibility.Private, p.DeclaredAccessibility); 472Assert.Equal(Accessibility.Private, indexer.DeclaredAccessibility);
Symbols\Source\FieldTests.cs (2)
67Assert.Equal(Accessibility.Private, sym.DeclaredAccessibility); 94Assert.Equal(Accessibility.Private, f.DeclaredAccessibility);
Symbols\Source\FileModifierTests.cs (2)
95Assert.Equal(Accessibility.Internal, outer.DeclaredAccessibility); 99Assert.Equal(Accessibility.Private, classC.DeclaredAccessibility);
Symbols\Source\MethodTests.cs (27)
44Assert.Equal(Accessibility.Private, m.DeclaredAccessibility); 65Action<string, string, int, Accessibility?> check = 85Accessibility? doNotCheckAccessibility = null; 88check(@"internal class A { }", "A", 1, Accessibility.Public); 91check(@"abstract internal class A { }", "A", 1, Accessibility.Protected); 126Assert.Equal(Accessibility.Private, m.DeclaredAccessibility); 150Assert.Equal(Accessibility.Private, m.DeclaredAccessibility); 171Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 172Assert.Equal(Accessibility.Public, m2.DeclaredAccessibility); 381Assert.Equal(Accessibility.Public, outP.DeclaredAccessibility); 668Assert.Equal(Accessibility.Protected, m0.DeclaredAccessibility); 961Assert.Equal(Accessibility.Public, type1.DeclaredAccessibility); 1070Assert.Equal(Accessibility.Public, type1.DeclaredAccessibility); 1182Assert.Equal(Accessibility.Public, m0.DeclaredAccessibility); 1187Assert.Equal(Accessibility.Private, m2.DeclaredAccessibility); 1193Assert.Equal(Accessibility.Private, m3.DeclaredAccessibility); 1198Assert.Equal(Accessibility.Private, m4.DeclaredAccessibility); 1206Assert.Equal(Accessibility.Public, type2.DeclaredAccessibility); 1219Assert.Equal(Accessibility.Public, m0.DeclaredAccessibility); 1224Assert.Equal(Accessibility.Private, mm.DeclaredAccessibility); 1229Assert.Equal(Accessibility.Private, m2.DeclaredAccessibility); 1262Assert.Equal(Accessibility.Public, type1.DeclaredAccessibility); 1276Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility); 1281Assert.Equal(Accessibility.Private, m2.DeclaredAccessibility); 1287Assert.Equal(Accessibility.Private, m3.DeclaredAccessibility); 1905Assert.Equal(Accessibility.Private, staticConstructor.DeclaredAccessibility); 1929Assert.Equal(Accessibility.Private, staticConstructor.DeclaredAccessibility);
Symbols\Source\ModifierTests.cs (20)
51Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 54Assert.Equal(Accessibility.Public, m2.DeclaredAccessibility); 56Assert.Equal(Accessibility.Protected, m3.DeclaredAccessibility); 58Assert.Equal(Accessibility.Internal, m4.DeclaredAccessibility); 60Assert.Equal(Accessibility.ProtectedOrInternal, m5.DeclaredAccessibility); 62Assert.Equal(Accessibility.ProtectedOrInternal, m5_1.DeclaredAccessibility); 65Assert.Equal(Accessibility.ProtectedOrInternal, m5_2.DeclaredAccessibility); 68Assert.Equal(Accessibility.Private, m6.DeclaredAccessibility); 74Assert.Equal(Accessibility.Internal, m8.DeclaredAccessibility); 78Assert.Equal(Accessibility.Internal, m8_1.DeclaredAccessibility); 82Assert.Equal(Accessibility.Internal, m8_2.DeclaredAccessibility); 85Assert.Equal(Accessibility.Internal, m9.DeclaredAccessibility); 88Assert.Equal(Accessibility.Internal, m10.DeclaredAccessibility); 91Assert.Equal(Accessibility.Internal, m11.DeclaredAccessibility); 114Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility); 116Assert.Equal(Accessibility.Public, m2.DeclaredAccessibility); 118Assert.Equal(Accessibility.Protected, m3.DeclaredAccessibility); 120Assert.Equal(Accessibility.Internal, m4.DeclaredAccessibility); 122Assert.Equal(Accessibility.ProtectedOrInternal, m5.DeclaredAccessibility); 124Assert.Equal(Accessibility.Private, m6.DeclaredAccessibility);
Symbols\Source\PropertyTests.cs (38)
794Accessibility.ProtectedOrInternal, 795Accessibility.Protected, 796Accessibility.Internal); 799Accessibility.ProtectedOrInternal, 800Accessibility.Protected, 801Accessibility.ProtectedOrInternal); 804Accessibility.Protected, 805Accessibility.Protected, 806Accessibility.ProtectedAndInternal); 809Accessibility.ProtectedOrInternal, 810Accessibility.Internal, 811Accessibility.ProtectedOrInternal); 814Accessibility.Internal, 815Accessibility.Internal, 816Accessibility.ProtectedAndInternal); 819Accessibility.ProtectedOrInternal, 820Accessibility.ProtectedOrInternal, 821Accessibility.ProtectedOrInternal); 824Accessibility.ProtectedOrInternal, 825Accessibility.ProtectedOrInternal, 826Accessibility.ProtectedAndInternal); 829Accessibility.ProtectedAndInternal, 830Accessibility.ProtectedAndInternal, 831Accessibility.ProtectedAndInternal); 834Accessibility.ProtectedAndInternal, 835Accessibility.ProtectedAndInternal, 836Accessibility.NotApplicable); 839Accessibility.ProtectedOrInternal, 840Accessibility.NotApplicable, 841Accessibility.ProtectedOrInternal); 844Accessibility.ProtectedOrInternal, 845Accessibility.ProtectedAndInternal, 846Accessibility.ProtectedOrInternal); 2558private static void VerifyAccessibility(PEPropertySymbol property, Accessibility propertyAccessibility, Accessibility getAccessibility, Accessibility setAccessibility) 2566private static void VerifyAccessorAccessibility(MethodSymbol accessor, Accessibility accessorAccessibility) 2568if (accessorAccessibility == Accessibility.NotApplicable)
Symbols\Source\RecordTests.cs (5)
158Assert.Equal(Accessibility.Public, x.DeclaredAccessibility); 175Assert.Equal(Accessibility.Public, getAccessor.DeclaredAccessibility); 182Assert.Equal(Accessibility.Public, setAccessor.DeclaredAccessibility); 192Assert.Equal(Accessibility.Public, y.DeclaredAccessibility); 215Assert.Equal(Accessibility.Public, setAccessor.DeclaredAccessibility);
Symbols\StaticAbstractMembersInInterfacesTests.cs (3)
22048Assert.Equal(Accessibility.Private, c1.GetMembers().OfType<MethodSymbol>().Where(m => !m.IsConstructor()).Single().DeclaredAccessibility); 22198Assert.Equal(Accessibility.Private, c1.GetMembers().OfType<MethodSymbol>().Where(m => !m.IsConstructor()).Single().DeclaredAccessibility); 29860Assert.Equal(Accessibility.Private, c1.GetMembers().OfType<MethodSymbol>().Where(m => !m.IsConstructor()).Single().DeclaredAccessibility);
Symbols\TypeTests.cs (14)
90Assert.Equal(Accessibility.Internal, a.DeclaredAccessibility); 91Assert.Equal(Accessibility.Internal, b.DeclaredAccessibility); 92Assert.Equal(Accessibility.Internal, s.DeclaredAccessibility); 281Assert.Equal(Accessibility.Internal, type2.DeclaredAccessibility); 284Assert.Equal(Accessibility.Private, type3.DeclaredAccessibility); 288Assert.Equal(Accessibility.ProtectedOrInternal, type4.DeclaredAccessibility); 299Assert.Equal(Accessibility.Public, type2.DeclaredAccessibility); 302Assert.Equal(Accessibility.Private, type3.DeclaredAccessibility); 307Assert.Equal(Accessibility.Private, type4.DeclaredAccessibility); 481Assert.Equal(Accessibility.NotApplicable, elemType1.Type.DeclaredAccessibility); 671Assert.Equal(Accessibility.Public, v.DeclaredAccessibility); 857Assert.Equal(Accessibility.Public, igoo.DeclaredAccessibility); 870Assert.Equal(Accessibility.Internal, classA.DeclaredAccessibility); 882Assert.Equal(Accessibility.Public, structS.DeclaredAccessibility);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (8)
Parsing\ReadOnlyStructs.cs (8)
47Assert.Equal(Accessibility.Private, s1.DeclaredAccessibility); 53Assert.Equal(Accessibility.Public, s2.DeclaredAccessibility); 59Assert.Equal(Accessibility.Public, s3.DeclaredAccessibility); 121Assert.Equal(Accessibility.Private, s1.DeclaredAccessibility); 127Assert.Equal(Accessibility.Public, s2.DeclaredAccessibility); 133Assert.Equal(Accessibility.Public, s3.DeclaredAccessibility); 156Assert.Equal(Accessibility.Private, s1.DeclaredAccessibility); 162Assert.Equal(Accessibility.Public, s2.DeclaredAccessibility);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
AttributeValidation.cs (3)
17internal static void AssertReferencedIsUnmanagedAttribute(Accessibility accessibility, TypeParameterSymbol typeParameter, string assemblyName) 28case Accessibility.Internal: 38case Accessibility.Public:
FunctionPointerUtilities.cs (1)
62Assert.Equal(Accessibility.NotApplicable, symbol.DeclaredAccessibility);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Metadata\WinMdMetadataTests.cs (2)
76Assert.Equal(Accessibility.Public, func.DeclaredAccessibility); 115Assert.Equal(Accessibility.Internal, clas.DeclaredAccessibility);
Microsoft.CodeAnalysis.CSharp.Workspaces (104)
CodeGeneration\CSharpSyntaxGenerator.cs (46)
173Accessibility accessibility, 230Accessibility accessibility, 264public override SyntaxNode OperatorDeclaration(OperatorKind kind, IEnumerable<SyntaxNode>? parameters = null, SyntaxNode? returnType = null, Accessibility accessibility = Accessibility.NotApplicable, DeclarationModifiers modifiers = default, IEnumerable<SyntaxNode>? statements = null) 270private protected override SyntaxNode OperatorDeclaration(string operatorName, bool isImplicitConversion, IEnumerable<SyntaxNode>? parameters = null, SyntaxNode? returnType = null, Accessibility accessibility = Accessibility.NotApplicable, DeclarationModifiers modifiers = default, IEnumerable<SyntaxNode>? statements = null) 357Accessibility accessibility, 377Accessibility accessibility, 399Accessibility accessibility, 420public override SyntaxNode GetAccessorDeclaration(Accessibility accessibility, IEnumerable<SyntaxNode>? statements) 423private protected override SyntaxNode SetAccessorDeclaration(Accessibility accessibility, bool isInitOnly, IEnumerable<SyntaxNode>? statements) 427SyntaxKind kind, Accessibility accessibility, IEnumerable<SyntaxNode>? statements) 465Accessibility accessibility, 533Accessibility accessibility, 547Accessibility accessibility, 583d = this.AsImplementation(d, Accessibility.Public); 598d = this.AsImplementation(d, Accessibility.NotApplicable); 635private SyntaxNode AsImplementation(SyntaxNode declaration, Accessibility requiredAccess) 696Accessibility accessibility, 752Accessibility accessibility, 774Accessibility accessibility, 805Accessibility acc; 852Accessibility.NotApplicable, 878Accessibility accessibility, 885internal override SyntaxNode EnumDeclaration(string name, SyntaxNode? underlyingType, Accessibility accessibility = Accessibility.NotApplicable, DeclarationModifiers modifiers = default, IEnumerable<SyntaxNode>? members = null) 933Accessibility accessibility = Accessibility.NotApplicable, 1396public override Accessibility GetAccessibility(SyntaxNode declaration) 1399private static void GetAccessibilityAndModifiers(SyntaxTokenList modifierList, out Accessibility accessibility, out DeclarationModifiers modifiers, out bool isDefault) 1402public override SyntaxNode WithAccessibility(SyntaxNode declaration, Accessibility accessibility) 1405accessibility != Accessibility.NotApplicable) 1414if (modifiers.IsFile && accessibility != Accessibility.NotApplicable) 1422if (modifiers.IsStatic && declaration.IsKind(SyntaxKind.ConstructorDeclaration) && accessibility != Accessibility.NotApplicable) 1627GetAccessibilityAndModifiers(tokens, out var accessibility, out var tmp, out _); 1628if (accessibility != Accessibility.NotApplicable) 1634accessibility = Accessibility.NotApplicable; 1662Accessibility accessibility, 1669Accessibility accessibility, 1677Accessibility.Internal => [InternalKeyword], 1678Accessibility.Public => [PublicKeyword], 1679Accessibility.Private => [PrivateKeyword], 1680Accessibility.Protected => [ProtectedKeyword], 1681Accessibility.ProtectedOrInternal => [ProtectedKeyword, InternalKeyword], 1682Accessibility.ProtectedAndInternal => [PrivateKeyword, ProtectedKeyword], 1776}, Accessibility.NotApplicable);
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (13)
194Accessibility.Private, 318Accessibility.Public, 450Accessibility.Public, 597private static Accessibility GetAccessibility(SyntaxNode container, SyntaxTokenList modifiers) 604case SyntaxKind.PublicKeyword: return Accessibility.Public; 605case SyntaxKind.PrivateKeyword: return Accessibility.Private; 606case SyntaxKind.ProtectedKeyword: return Accessibility.Protected; 614return Accessibility.Internal; 624return Accessibility.Private; 627return Accessibility.Public; 631return Accessibility.Private; 633return Accessibility.Internal; 637return Accessibility.Internal;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (8)
183public static Accessibility DetermineAccessibilityConstraint( 190return Accessibility.Private; 311? Accessibility.Public 312: Accessibility.Internal; 315return Accessibility.Private; 334if (symbol.DeclaredAccessibility is Accessibility.Private or 335Accessibility.ProtectedAndInternal or 336Accessibility.Internal)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (17)
93public Accessibility GetAccessibility(SyntaxNode declaration) 96return Accessibility.NotApplicable; 99GetAccessibilityAndModifiers(modifierTokens, out var accessibility, out _, out _); 103public static void GetAccessibilityAndModifiers(SyntaxTokenList modifierList, out Accessibility accessibility, out DeclarationModifiers modifiers, out bool isDefault) 105accessibility = Accessibility.NotApplicable; 113(SyntaxKind.PublicKeyword, _) => Accessibility.Public, 115(SyntaxKind.PrivateKeyword, Accessibility.Protected) => Accessibility.ProtectedAndInternal, 116(SyntaxKind.PrivateKeyword, _) => Accessibility.Private, 118(SyntaxKind.InternalKeyword, Accessibility.Protected) => Accessibility.ProtectedOrInternal, 119(SyntaxKind.InternalKeyword, _) => Accessibility.Internal, 121(SyntaxKind.ProtectedKeyword, Accessibility.Private) => Accessibility.ProtectedAndInternal, 122(SyntaxKind.ProtectedKeyword, Accessibility.Internal) => Accessibility.ProtectedOrInternal, 123(SyntaxKind.ProtectedKeyword, _) => Accessibility.Protected,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConstructorGenerator.cs (1)
127AddAccessibilityModifiers(constructor.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (8)
37Accessibility accessibility, 40Accessibility defaultAccessibility) 49case Accessibility.Public: 52case Accessibility.Protected: 55case Accessibility.Private: 58case Accessibility.ProtectedAndInternal: 62case Accessibility.Internal: 65case Accessibility.ProtectedOrInternal:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (3)
755public override TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, CSharpCodeGenerationContextInfo info, CancellationToken cancellationToken) 760private static SyntaxTokenList UpdateDeclarationAccessibility(SyntaxTokenList modifiersList, Accessibility newAccessibility, CSharpCodeGenerationContextInfo info) 763CSharpCodeGenerationHelpers.AddAccessibilityModifiers(newAccessibility, newModifierTokens, info, Accessibility.NotApplicable);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (1)
238AddAccessibilityModifiers(@event.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\FieldGenerator.cs (1)
126AddAccessibilityModifiers(field.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
353AddAccessibilityModifiers(method.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (3)
275var defaultAccessibility = destination is CodeGenerationDestination.CompilationUnit or CodeGenerationDestination.Namespace 276? Accessibility.Internal 277: Accessibility.Private;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (2)
347if (accessor.DeclaredAccessibility != Accessibility.NotApplicable && 386AddAccessibilityModifiers(property.DeclaredAccessibility, tokens, info, Accessibility.Private);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (135)
CodeGeneration\SymbolEditorTests.cs (2)
283var newSymbol = (INamedTypeSymbol)await editor.EditAllDeclarationsAsync(symbol, (e, d) => e.SetAccessibility(d, Accessibility.Internal)); 320var newSymbol = (INamedTypeSymbol)await editor.EditAllDeclarationsAsync(symbol, (e, d) => e.SetAccessibility(d, Accessibility.Public));
CodeGeneration\SyntaxGeneratorTests.cs (133)
789Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), accessibility: Accessibility.Public), 793Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), accessibility: Accessibility.NotApplicable, modifiers: DeclarationModifiers.Static | DeclarationModifiers.ReadOnly), 797Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), accessibility: Accessibility.NotApplicable, modifiers: DeclarationModifiers.Required), 829Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("x"), accessibility: Accessibility.Public), 833Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("x"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Abstract), 1016Generator.ConstructorDeclaration("c", accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Static), 1138Generator.EventDeclaration("ef", Generator.IdentifierName("t"), accessibility: Accessibility.Public), 1154Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Abstract), 1177Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Private, modifiers: DeclarationModifiers.Abstract), 1183Generator.IndexerDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("a"))], type: Generator.IdentifierName("t"), accessibility: Accessibility.Internal, modifiers: DeclarationModifiers.Abstract), 1189Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"), accessibility: Accessibility.Private, modifiers: DeclarationModifiers.Abstract), 1474Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"), accessibility: Accessibility.Private, modifiers: DeclarationModifiers.Abstract), 1480Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Internal, modifiers: DeclarationModifiers.Abstract), 1486Generator.IndexerDeclaration(parameters: [Generator.ParameterDeclaration("p", Generator.IdentifierName("a"))], type: Generator.IdentifierName("t"), accessibility: Accessibility.Protected, modifiers: DeclarationModifiers.Abstract), 1498Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"), accessibility: Accessibility.Private, modifiers: DeclarationModifiers.Abstract), 1630Generator.InterfaceDeclaration("i", members: [Generator.MethodDeclaration("m", returnType: Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Sealed)]), 1634Generator.InterfaceDeclaration("i", members: [Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Sealed)]), 1638Generator.InterfaceDeclaration("i", members: [Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.ReadOnly)]), 1642Generator.InterfaceDeclaration("i", members: [Generator.IndexerDeclaration([Generator.ParameterDeclaration("y", Generator.IdentifierName("x"))], Generator.IdentifierName("t"), Accessibility.Public, DeclarationModifiers.Sealed)]), 1646Generator.InterfaceDeclaration("i", members: [Generator.IndexerDeclaration([Generator.ParameterDeclaration("y", Generator.IdentifierName("x"))], Generator.IdentifierName("t"), Accessibility.Public, DeclarationModifiers.ReadOnly)]), 1650Generator.InterfaceDeclaration("i", members: [Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Static)]), 1654Generator.InterfaceDeclaration("i", members: [Generator.EventDeclaration("ef", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Static)]), 1658Generator.InterfaceDeclaration("i", members: [Generator.FieldDeclaration("f", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.Sealed)]), 1716Generator.DelegateDeclaration("d", accessibility: Accessibility.Public), 1720Generator.DelegateDeclaration("d", accessibility: Accessibility.Public), 1870Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), accessibility: Accessibility.NotApplicable, modifiers: DeclarationModifiers.Abstract), 2943Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.ClassDeclaration("c", accessibility: Accessibility.Internal))); 2944Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.StructDeclaration("s", accessibility: Accessibility.Internal))); 2945Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.EnumDeclaration("i", accessibility: Accessibility.Internal))); 2946Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.EnumDeclaration("e", accessibility: Accessibility.Internal))); 2947Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.DelegateDeclaration("d", accessibility: Accessibility.Internal))); 2948Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.MethodDeclaration("m", accessibility: Accessibility.Internal))); 2949Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.ConstructorDeclaration(accessibility: Accessibility.Internal))); 2950Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.ParameterDeclaration("p"))); 2951Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Internal))); 2952Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t"), accessibility: Accessibility.Internal))); 2953Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.FieldDeclaration("f", Generator.IdentifierName("t"), accessibility: Accessibility.Internal))); 2954Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.EnumMember("v"))); 2955Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.EventDeclaration("ef", Generator.IdentifierName("t"), accessibility: Accessibility.Internal))); 2956Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), accessibility: Accessibility.Internal))); 2957Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.NamespaceDeclaration("n"))); 2958Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.NamespaceImportDeclaration("u"))); 2959Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc"))); 2960Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.Attribute("a"))); 2961Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(TypeParameter("tp"))); 2967Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ClassDeclaration("c", accessibility: Accessibility.Internal), Accessibility.Private))); 2968Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.StructDeclaration("s", accessibility: Accessibility.Internal), Accessibility.Private))); 2969Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EnumDeclaration("i", accessibility: Accessibility.Internal), Accessibility.Private))); 2970Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EnumDeclaration("e", accessibility: Accessibility.Internal), Accessibility.Private))); 2971Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.DelegateDeclaration("d", accessibility: Accessibility.Internal), Accessibility.Private))); 2972Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.MethodDeclaration("m", accessibility: Accessibility.Internal), Accessibility.Private))); 2973Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ConstructorDeclaration(accessibility: Accessibility.Internal), Accessibility.Private))); 2974Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ParameterDeclaration("p"), Accessibility.Private))); 2975Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Internal), Accessibility.Private))); 2976Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.IndexerDeclaration([Generator.ParameterDeclaration("i")], Generator.IdentifierName("t"), accessibility: Accessibility.Internal), Accessibility.Private))); 2977Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.FieldDeclaration("f", Generator.IdentifierName("t"), accessibility: Accessibility.Internal), Accessibility.Private))); 2978Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EnumMember("v"), Accessibility.Private))); 2979Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EventDeclaration("ef", Generator.IdentifierName("t"), accessibility: Accessibility.Internal), Accessibility.Private))); 2980Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), accessibility: Accessibility.Internal), Accessibility.Private))); 2981Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.NamespaceDeclaration("n"), Accessibility.Private))); 2982Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.NamespaceImportDeclaration("u"), Accessibility.Private))); 2983Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc"), Accessibility.Private))); 2984Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.Attribute("a"), Accessibility.Private))); 2985Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(TypeParameter("tp"), Accessibility.Private))); 2986Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(AccessorDeclaration(SyntaxKind.InitAccessorDeclaration), Accessibility.Private))); 3105var publicCtor = Generator.WithAccessibility(ctor, Accessibility.Public); 3114var ctor = Generator.ConstructorDeclaration("C", accessibility: Accessibility.Public); 3139var filePublicClass = Generator.WithAccessibility(fileClass, Accessibility.Public); 3362Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(getAccessor)); 3367Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(setAccessor)); 3374Assert.Equal(Accessibility.Public, Generator.GetAccessibility(Generator.WithAccessibility(getAccessor, Accessibility.Public))); 3375Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(setAccessor, Accessibility.Private))); 3392var newProp = Generator.ReplaceNode(prop, getAccessor, Generator.WithAccessibility(getAccessor, Accessibility.Public)); 3393Assert.Equal(Accessibility.Public, Generator.GetAccessibility(Generator.GetAccessor(newProp, DeclarationKind.GetAccessor))); 3395newProp = Generator.ReplaceNode(prop, setAccessor, Generator.WithAccessibility(setAccessor, Accessibility.Public)); 3396Assert.Equal(Accessibility.Public, Generator.GetAccessibility(Generator.GetAccessor(newProp, DeclarationKind.SetAccessor))); 3409Generator.GetAccessorDeclaration(Accessibility.NotApplicable, [Generator.ReturnStatement()])), 3415Generator.GetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])), 3421Generator.SetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])), 3430Generator.GetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])), 3436Generator.SetAccessorDeclaration(Accessibility.Protected, [Generator.ReturnStatement()])), 3799Assert.Equal(Accessibility.Public, Generator.GetAccessibility(declX)); 3805Assert.Equal(Accessibility.Public, Generator.GetAccessibility(declY)); 3811Assert.Equal(Accessibility.Public, Generator.GetAccessibility(declZ)); 3829var xPrivate = Generator.WithAccessibility(declX, Accessibility.Private); 3832Assert.Equal(Accessibility.Private, Generator.GetAccessibility(xPrivate)); 3919Generator.ReplaceNode(declC, declX, Generator.WithAccessibility(declX, Accessibility.Private)),
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
Diagnostics\GenerateType\TestGenerateTypeOptionsService.cs (4)
21public Accessibility Accessibility = Accessibility.NotApplicable; 73Accessibility accessibility = Accessibility.NotApplicable,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (57)
CodeGeneration\CodeGenerationTests.cs (25)
61Accessibility accessibility = Accessibility.Public, 103Accessibility accessibility = Accessibility.Public, 136Accessibility accessibility = Accessibility.Public, 181Accessibility accessibility = Accessibility.Public, 221Accessibility accessibility = Accessibility.Public, 268Accessibility accessibility = Accessibility.Public, 339Accessibility accessibility = Accessibility.Public, 372Accessibility accessibility = Accessibility.Public, 411Accessibility defaultAccessibility = Accessibility.Public, 412Accessibility setterAccessibility = Accessibility.Public, 504Accessibility accessibility = Accessibility.Public, 568Accessibility? accessibility = null, 708attributes: default, Accessibility.Public, 712internal static Func<SemanticModel, ISymbol> CreateField(Accessibility accessibility, Editing.DeclarationModifiers modifiers, Type type, string name)
CodeGeneration\CodeGenerationTests.CSharp.cs (17)
68accessibility: Accessibility.Private, 241[InlineData(Accessibility.NotApplicable)] 242[InlineData(Accessibility.Internal)] 243[InlineData(Accessibility.Public)] 244public async Task AddFileClass(Accessibility accessibility) 289accessibility: Accessibility.Private, 304accessibility: Accessibility.ProtectedOrInternal, 320accessibility: Accessibility.Internal, 337accessibility: Accessibility.Public, 493addMethod: CodeGenerationSymbolFactory.CreateAccessorSymbol(ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty), 494removeMethod: CodeGenerationSymbolFactory.CreateAccessorSymbol(ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty), 641accessibility: Accessibility.Protected, 1017setterAccessibility: Accessibility.Internal); 1031setterAccessibility: Accessibility.Internal); 1424await TestUpdateDeclarationAsync<ClassDeclarationSyntax>(input, expected, accessibility: Accessibility.Internal); 1464var getField = CreateField(Accessibility.Public, new Editing.DeclarationModifiers(), typeof(int), "f2"); 1490var getField = CreateField(Accessibility.Public, new Editing.DeclarationModifiers(), typeof(int), "f2");
CodeGeneration\CodeGenerationTests.VisualBasic.cs (15)
61accessibility: Accessibility.Private, 221accessibility: Accessibility.Internal, 235accessibility: Accessibility.Internal, 249accessibility: Accessibility.Public, 415Accessibility.Public, 424ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty), 448addMethod: CodeGenerationSymbolFactory.CreateAccessorSymbol(ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, ImmutableArray<SyntaxNode>.Empty), 477ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, addStatements), 479ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, removeStatements), 481ImmutableArray<AttributeData>.Empty, Accessibility.NotApplicable, raiseStatements), 524accessibility: Accessibility.ProtectedOrInternal, 607accessibility: Accessibility.Protected, 624accessibility: Accessibility.Public, 1492await TestUpdateDeclarationAsync<ClassStatementSyntax>(input, expected, accessibility: Accessibility.ProtectedOrFriend); 1534var getField = CreateField(Accessibility.Public, new DeclarationModifiers(isStatic: true), typeof(int), "f2");
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (8)
DkmUtilities.cs (8)
308private static DkmEvaluationResultAccessType GetResultAccessType(Accessibility accessibility) 312case Accessibility.Public: 314case Accessibility.Protected: 316case Accessibility.Private: 318case Accessibility.Internal: 319case Accessibility.ProtectedOrInternal: // Dev12 treats this as "internal" 320case Accessibility.ProtectedAndInternal: // Dev12 treats this as "internal" 322case Accessibility.NotApplicable:
Microsoft.CodeAnalysis.Features (281)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
166accessibility: Accessibility.Private,
Common\GlyphExtensions.cs (45)
55Accessibility.Protected => Glyph.ClassProtected, 56Accessibility.Private => Glyph.ClassPrivate, 57Accessibility.Internal => Glyph.ClassInternal, 63Accessibility.Protected => Glyph.ConstantProtected, 64Accessibility.Private => Glyph.ConstantPrivate, 65Accessibility.Internal => Glyph.ConstantInternal, 71Accessibility.Protected => Glyph.DelegateProtected, 72Accessibility.Private => Glyph.DelegatePrivate, 73Accessibility.Internal => Glyph.DelegateInternal, 79Accessibility.Protected => Glyph.EnumProtected, 80Accessibility.Private => Glyph.EnumPrivate, 81Accessibility.Internal => Glyph.EnumInternal, 87Accessibility.Protected => Glyph.EnumMemberProtected, 88Accessibility.Private => Glyph.EnumMemberPrivate, 89Accessibility.Internal => Glyph.EnumMemberInternal, 98Accessibility.Protected => Glyph.EventProtected, 99Accessibility.Private => Glyph.EventPrivate, 100Accessibility.Internal => Glyph.EventInternal, 106Accessibility.Protected => Glyph.ExtensionMethodProtected, 107Accessibility.Private => Glyph.ExtensionMethodPrivate, 108Accessibility.Internal => Glyph.ExtensionMethodInternal, 114Accessibility.Protected => Glyph.FieldProtected, 115Accessibility.Private => Glyph.FieldPrivate, 116Accessibility.Internal => Glyph.FieldInternal, 122Accessibility.Protected => Glyph.InterfaceProtected, 123Accessibility.Private => Glyph.InterfacePrivate, 124Accessibility.Internal => Glyph.InterfaceInternal, 148Accessibility.Protected => Glyph.MethodProtected, 149Accessibility.Private => Glyph.MethodPrivate, 150Accessibility.Internal => Glyph.MethodInternal, 156Accessibility.Protected => Glyph.ModulePublic, 157Accessibility.Private => Glyph.ModulePrivate, 158Accessibility.Internal => Glyph.ModuleInternal, 173Accessibility.Protected => Glyph.PropertyProtected, 174Accessibility.Private => Glyph.PropertyPrivate, 175Accessibility.Internal => Glyph.PropertyInternal, 190Accessibility.Protected => Glyph.StructureProtected, 191Accessibility.Private => Glyph.StructurePrivate, 192Accessibility.Internal => Glyph.StructureInternal, 211public static Accessibility GetAccessibility(ImmutableArray<string> tags) 218return Accessibility.Public; 220return Accessibility.Protected; 222return Accessibility.Internal; 224return Accessibility.Private; 228return Accessibility.NotApplicable;
Completion\Providers\AbstractOverrideCompletionProvider.cs (1)
20public abstract bool TryDetermineModifiers(SyntaxToken startToken, SourceText text, int startLine, out Accessibility seenAccessibility, out DeclarationModifiers modifiers);
Completion\Providers\AbstractOverrideCompletionProvider.ItemGetter.cs (14)
91Accessibility seenAccessibility, 104if (seenAccessibility != Accessibility.NotApplicable) 110static bool MatchesAccessibility(Accessibility declaredAccessibility, Accessibility seenAccessibility) 119Accessibility.Private => declaredAccessibility is Accessibility.Private or Accessibility.ProtectedAndInternal, 121Accessibility.Protected => declaredAccessibility is Accessibility.Protected or Accessibility.ProtectedAndInternal or Accessibility.ProtectedOrInternal, 123Accessibility.Internal => declaredAccessibility is Accessibility.Internal or Accessibility.ProtectedOrInternal,
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (1)
71accessibility: IncludeAccessibility(method, cancellationToken) ? method.DeclaredAccessibility : Accessibility.NotApplicable,
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (2)
279overloadInfo.NonGenericOverload.DeclaredAccessibility == Accessibility.Public); 318var newContainsPublicGenericOverload = type.DeclaredAccessibility >= Accessibility.Public || ContainsPublicGenericOverload;
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (2)
421=> symbol.DeclaredAccessibility == Accessibility.Public || 422(symbol.DeclaredAccessibility == Accessibility.Internal && internalsVisible);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (5)
267Accessibility.Public, 316attributes: default, Accessibility.Internal, modifiers: default, 356attributes: default, Accessibility.Public, modifiers: default, 372attributes: default, Accessibility.Public, DeclarationModifiers.Abstract, 399attributes: default, Accessibility.Public, modifiers: default,
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
102default, Accessibility.Private,
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (6)
295var parameterNamingRule = await document.GetApplicableNamingRuleAsync(SymbolKind.Parameter, Accessibility.NotApplicable, cancellationToken).ConfigureAwait(false); 867Accessibility.Public, 913var accessibility = scope == Scope.DependentProjects 914? Accessibility.Public 915: Accessibility.Internal; 946attributes: default, Accessibility.Public, modifiers: default,
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
150method.DeclaredAccessibility == Accessibility.Public &&
EmbeddedLanguages\Json\LanguageServices\JsonLanguageDetector.cs (1)
144if (symbol is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, IsStatic: true } &&
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (2)
63where method.DeclaredAccessibility == Accessibility.Public 151method.DeclaredAccessibility == Accessibility.Public &&
EncapsulateField\AbstractEncapsulateFieldService.cs (10)
196var markFieldPrivate = field.DeclaredAccessibility != Accessibility.Private; 338Accessibility accessibility, 364protected static Accessibility ComputeAccessibility(Accessibility accessibility, ITypeSymbol type) 366var computedAccessibility = accessibility; 367if (accessibility is Accessibility.NotApplicable or Accessibility.Private) 369computedAccessibility = Accessibility.Public; 392Accessibility.NotApplicable, 409Accessibility.NotApplicable,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (5)
128if (symbol.DeclaredAccessibility == Accessibility.Private) 155if (symbol.DeclaredAccessibility == Accessibility.Private) 193return symbol.DeclaredAccessibility is Accessibility.Internal or 194Accessibility.ProtectedAndInternal or 195Accessibility.ProtectedOrInternal;
ExtractInterface\AbstractExtractInterfaceService.cs (9)
144accessibility: ShouldIncludeAccessibilityModifier(refactoringResult.TypeNode) ? refactoringResult.TypeToExtractFrom.DeclaredAccessibility : Accessibility.NotApplicable, 382accessibility: Accessibility.Public, 391accessibility: Accessibility.Public, 405var getMethod = property.GetMethod != null && property.GetMethod.DeclaredAccessibility == Accessibility.Public 411accessibility: Accessibility.Public, 419setMethod: property is { SetMethod.DeclaredAccessibility: Accessibility.Public } ? property.SetMethod : null, 433if (m.DeclaredAccessibility != Accessibility.Public || 445(prop is { GetMethod.DeclaredAccessibility: Accessibility.Public } || 446prop is { SetMethod.DeclaredAccessibility: Accessibility.Public });
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (2)
166compareMethod.DeclaredAccessibility != Accessibility.Public && 196Accessibility.Public,
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (2)
94accessibility: _state.ContainingType.IsAbstractClass() ? Accessibility.Protected : Accessibility.Public,
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (1)
50public record GenerateConstructorIntentData(Accessibility? Accessibility);
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (2)
29Accessibility? desiredAccessibility, 35private readonly Accessibility? _desiredAccessibility = desiredAccessibility;
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (5)
34public Accessibility Accessibility { get; private set; } 41Accessibility? desiredAccessibility, 57Accessibility? desiredAccessibility, 68Accessibility = desiredAccessibility ?? (ContainingType.IsAbstractClass() ? Accessibility.Protected : Accessibility.Public);
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (1)
136accessibility: Accessibility.Public,
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (2)
162Accessibility.Public, 179Accessibility.Public,
GenerateFromMembers\GenerateFromMembersHelpers.cs (1)
102var parameterNamingRule = rules.Where(rule => rule.SymbolSpecification.AppliesTo(SymbolKind.Parameter, Accessibility.NotApplicable)).First();
GenerateType\AbstractGenerateTypeService.cs (5)
42protected abstract Accessibility GetAccessibility(State state, SemanticModel semanticModel, bool intoNamespace, CancellationToken cancellationToken); 233protected static Accessibility DetermineDefaultAccessibility( 241return Accessibility.Public; 252return Accessibility.Private; 256return Accessibility.Internal;
GenerateType\AbstractGenerateTypeService.Editor.cs (6)
609var fieldNamingRule = await _semanticDocument.Document.GetApplicableNamingRuleAsync(SymbolKind.Field, Accessibility.Private, _cancellationToken).ConfigureAwait(false); 648case Accessibility.ProtectedOrInternal: 649case Accessibility.Protected: 650case Accessibility.Public: 652case Accessibility.ProtectedAndInternal: 653case Accessibility.Internal:
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (4)
224DetermineName(), null, parameters.ToImmutable(), Accessibility.Public, 240.Where(c => c.DeclaredAccessibility is Accessibility.Public or Accessibility.Protected && !c.IsObsolete()) 269private Accessibility DetermineAccessibility()
GenerateType\GenerateTypeOptionsResult.cs (2)
15public Accessibility Accessibility { get; } 29Accessibility accessibility,
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (15)
45protected abstract Accessibility DetermineDefaultFieldAccessibility(INamedTypeSymbol containingType); 46protected abstract Accessibility DetermineDefaultPropertyAccessibility(); 282if (rule.SymbolSpecification.AppliesTo(SymbolKind.Field, Accessibility.Private)) 286var accessibilityLevel = Accessibility.Private; 289var defaultAccessibility = DetermineDefaultFieldAccessibility(parameter.ContainingType); 290if (defaultAccessibility == Accessibility.Private) 292accessibilityLevel = Accessibility.NotApplicable; 318if (rule.SymbolSpecification.AppliesTo(SymbolKind.Property, Accessibility.Public)) 322var accessibilityLevel = Accessibility.Public; 325var defaultAccessibility = DetermineDefaultPropertyAccessibility(); 326if (defaultAccessibility == Accessibility.Public) 328accessibilityLevel = Accessibility.NotApplicable; 334Accessibility.Public,
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
113if (calleeMethodSymbol.DeclaredAccessibility != Accessibility.Private)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
41public Accessibility DeclaredAccessibility => _symbol.DeclaredAccessibility;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (3)
31where m.DeclaredAccessibility is Accessibility.Public or 32Accessibility.Protected or 33Accessibility.ProtectedOrInternal
NavigateTo\RoslynNavigateToItem.cs (6)
307private static Glyph GetGlyph(DeclaredSymbolInfoKind kind, Accessibility accessibility) 319case Accessibility.Private: 322case Accessibility.Internal: 325case Accessibility.Protected: 326case Accessibility.ProtectedOrInternal: 327case Accessibility.ProtectedAndInternal:
PullMemberUp\MembersPuller.cs (6)
78return getterOrSetter?.DeclaredAccessibility == Accessibility.Public ? getterOrSetter : null; 87: CodeGenerationSymbolFactory.CreateMethodSymbol(getterOrSetter, accessibility: Accessibility.Public); 162accessibility: Accessibility.Public, 217editor.SetAccessibility(memberDeclaration, Accessibility.Public); 247accessibility: Accessibility.Public, 260editor.SetAccessibility(declaration, Accessibility.Public);
PullMemberUp\PullMembersUpOptionsBuilder.cs (1)
22var changeOriginalToPublic = memberAndMakeAbstract.member.DeclaredAccessibility != Accessibility.Public;
Shared\Extensions\DocumentExtensions.cs (1)
109this Document document, SymbolKindOrTypeKind kind, DeclarationModifiers modifiers, Accessibility? accessibility, CancellationToken cancellationToken)
Shared\Extensions\ISymbolExtensions_2.cs (5)
165case Accessibility.Private: 169case Accessibility.Protected: 170case Accessibility.ProtectedAndInternal: 171case Accessibility.ProtectedOrInternal: 175case Accessibility.Internal:
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
161DeclaredAccessibility: Accessibility.Private,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
762if (memberSymbol.DeclaredAccessibility == Accessibility.Private &&
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (3)
135DeclaredAccessibility: Accessibility.Private, 399if (getterField.DeclaredAccessibility != Accessibility.Private) 569if (result.Property.DeclaredAccessibility != Accessibility.Private &&
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
39.FirstOrDefault(m => m.DeclaredAccessibility == Accessibility.Public &&
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
98.FirstOrDefault(m => m is { DeclaredAccessibility: Accessibility.Public, Parameters.Length: 2 });
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (1)
184DeclaredAccessibility: Accessibility.Private,
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (8)
19var preferredAccessibility = GetPreferredAccessibility(symbol); 29SyntaxNode UpdateAccessibility(SyntaxNode declaration, Accessibility preferredAccessibility) 35return generator.GetAccessibility(declaration) == Accessibility.NotApplicable 37: generator.WithAccessibility(declaration, Accessibility.NotApplicable); 41private static Accessibility GetPreferredAccessibility(ISymbol symbol) 53return Accessibility.Public; 56return Accessibility.Protected; 59return Accessibility.Public;
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
54if (method.DeclaredAccessibility != Accessibility.Public)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (5)
143case Accessibility.ProtectedOrInternal: 144case Accessibility.Protected: 145case Accessibility.Public: 147case Accessibility.ProtectedAndInternal: 148case Accessibility.Internal:
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (4)
79var parameterNamingRule = await document.Document.GetApplicableNamingRuleAsync(SymbolKind.Parameter, Accessibility.NotApplicable, cancellationToken).ConfigureAwait(false); 445accessibility: Accessibility.Public, 509TypeToGenerateIn.IsAbstractClass() ? Accessibility.Protected : Accessibility.Public,
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (13)
67case Accessibility.ProtectedOrInternal: 68case Accessibility.Protected: 69case Accessibility.Public: 71case Accessibility.ProtectedAndInternal: 72case Accessibility.Internal: 143var fieldNamingRule = await document.Document.GetApplicableNamingRuleAsync(SymbolKind.Field, Accessibility.Private, cancellationToken).ConfigureAwait(false); 144var propertyNamingRule = await document.Document.GetApplicableNamingRuleAsync(SymbolKind.Property, Accessibility.Public, cancellationToken).ConfigureAwait(false); 145var parameterNamingRule = await document.Document.GetApplicableNamingRuleAsync(SymbolKind.Parameter, Accessibility.NotApplicable, cancellationToken).ConfigureAwait(false); 332case Accessibility.ProtectedOrInternal: 333case Accessibility.Protected: 334case Accessibility.Public: 336case Accessibility.ProtectedAndInternal: 337case Accessibility.Internal:
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (10)
62var accessibility = DetermineAccessibility(baseConstructor, classType); 80private static Accessibility DetermineAccessibility(IMethodSymbol baseConstructor, INamedTypeSymbol classType) 85return Accessibility.Public; 89if (classType.IsAbstractClass() && baseConstructor.DeclaredAccessibility == Accessibility.Public) 90return Accessibility.Protected; 97case Accessibility.Protected: 98return Accessibility.Public; 99case Accessibility.ProtectedAndInternal: 100case Accessibility.ProtectedOrInternal: 101return Accessibility.Internal;
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
42accessibility: Accessibility.Public,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (8)
75var accessibility = DetermineAccessibility(isAbstract); 229private Accessibility DetermineAccessibility(bool isAbstract) 240return isAbstract ? Accessibility.Protected : Accessibility.Private; 262return Accessibility.Protected; 266return Accessibility.Internal; 271return Accessibility.Public; 275return Accessibility.NotApplicable;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (8)
106private IMethodSymbol CreateAccessor(Accessibility accessibility) 126private Accessibility DetermineMinimalAccessibility(State state) 130return Accessibility.NotApplicable; 138return Accessibility.Public; 142return Accessibility.Private; 162return Accessibility.Protected; 166return Accessibility.Internal; 171return Accessibility.Public;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (3)
116Document document, State state, SymbolKind kind, Accessibility accessibility, CancellationToken cancellationToken) 182document, state, SymbolKind.Local, Accessibility.NotApplicable, cancellationToken).ConfigureAwait(false)) 198document, state, SymbolKind.Parameter, Accessibility.NotApplicable, cancellationToken).ConfigureAwait(false))
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (5)
83public Accessibility DetermineMaximalAccessibility() 86return Accessibility.NotApplicable; 88var accessibility = Accessibility.Public; 92var effectiveAccessibility = AccessibilityUtilities.Minimum(
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (4)
178DeclarationModifiers modifiers, Accessibility accessibility) 200Accessibility accessibility, 239IEventSymbol @event, ISymbol? throughMember, Accessibility accessibility, DeclarationModifiers modifiers) 263accessibility: Accessibility.NotApplicable,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (4)
125if (first.DeclaredAccessibility <= Accessibility.NotApplicable || 126second.DeclaredAccessibility <= Accessibility.NotApplicable) 193if (first.DeclaredAccessibility <= Accessibility.NotApplicable || 194second.DeclaredAccessibility <= Accessibility.NotApplicable)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (6)
299var accessibility = member.Name == memberName || generateAbstractly 300? Accessibility.Public 301: Accessibility.Private; 312private ISymbol GenerateEvent(Compilation compilation, string memberName, bool generateInvisibly, SyntaxGenerator factory, DeclarationModifiers modifiers, bool useExplicitInterfaceSymbol, Accessibility accessibility, IEventSymbol @event) 316accessibility: Accessibility.NotApplicable, 342accessibility: Accessibility.NotApplicable,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_DisposePattern.cs (9)
140var accessibility = State.ClassOrStructType.IsSealed 141? Accessibility.Private 142: Accessibility.Protected; 225accessibility: Explicitly ? Accessibility.NotApplicable : Accessibility.Public, 240SymbolKind.Field, Accessibility.Private, cancellationToken).ConfigureAwait(false); 245var accessibilityLevel = options.AccessibilityModifiersRequired is AccessibilityModifiersRequired.Never or AccessibilityModifiersRequired.OmitIfDefault 246? Accessibility.NotApplicable 247: Accessibility.Private;
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Method.cs (1)
28Accessibility accessibility,
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Property.cs (3)
33Accessibility accessibility, 97Accessibility accessibility, 131Accessibility accessibility,
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
88Accessibility.Private,
src\Analyzers\Core\CodeFixes\Naming\NamingExtensions.cs (1)
18this Document document, SymbolKind symbolKind, Accessibility accessibility, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol (4)
Extensions\ProtocolConversions.cs (4)
628var glyphString = glyph.ToString().Replace(nameof(Accessibility.Public), string.Empty) 629.Replace(nameof(Accessibility.Protected), string.Empty) 630.Replace(nameof(Accessibility.Private), string.Empty) 631.Replace(nameof(Accessibility.Internal), string.Empty);
Microsoft.CodeAnalysis.Test.Utilities (1)
CommonTestBase.cs (1)
536internal void AssertDeclaresType(PEModuleSymbol peModule, WellKnownType type, Accessibility expectedAccessibility)
Microsoft.CodeAnalysis.VisualBasic (488)
Analysis\FlowAnalysis\DataFlowPass.vb (1)
826If field.DeclaredAccessibility <> Accessibility.Private Then
Binding\Binder.vb (3)
970Case Accessibility.Protected, 971Accessibility.ProtectedOrInternal, 972Accessibility.ProtectedAndInternal
Binding\Binder_Attributes.vb (4)
334If DigThroughArrayType(param.Type).DeclaredAccessibility <> Accessibility.Public Then 341If DigThroughArrayType(container).DeclaredAccessibility <> Accessibility.Public Then 360If methodSym.DeclaredAccessibility <> Accessibility.Public Then 506If sym.DeclaredAccessibility <> Accessibility.Public Then
Binding\Binder_Lambda.vb (1)
24Dim modifiers As SourceMemberFlags = DecodeModifiers(node.SubOrFunctionHeader.Modifiers, asyncIterator, ERRID.ERR_InvalidLambdaModifier, Accessibility.Public, If(diagnostics.DiagnosticBag, New DiagnosticBag())).FoundFlags And asyncIterator
Binding\Binder_Utils.vb (15)
145defaultAccessibility As Accessibility, 218Dim access As Accessibility 220access = Accessibility.Public 222access = Accessibility.ProtectedOrFriend 224access = Accessibility.ProtectedAndFriend 231access = Accessibility.Friend 233access = Accessibility.Protected 235access = Accessibility.Private 240If access = Accessibility.Private Then 1553AccessibilityPrivate = CUShort(Accessibility.Private) 1554AccessibilityProtected = CUShort(Accessibility.Protected) 1555AccessibilityFriend = CUShort(Accessibility.Friend) 1556AccessibilityProtectedFriend = CUShort(Accessibility.ProtectedOrFriend) 1557AccessibilityPrivateProtected = CUShort(Accessibility.ProtectedAndFriend) 1558AccessibilityPublic = CUShort(Accessibility.Public)
Binding\Binder_XmlLiterals.vb (2)
1579Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 1780Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Binding\LookupResult.vb (6)
837If first.DeclaredAccessibility = Accessibility.Protected AndAlso 838second.DeclaredAccessibility = Accessibility.Friend Then 844If second.DeclaredAccessibility = Accessibility.Protected AndAlso 845first.DeclaredAccessibility = Accessibility.Friend Then 992Debug.Assert(possiblyMergedNamespace.DeclaredAccessibility = Accessibility.Public) 995If type.DeclaredAccessibility < Accessibility.Public AndAlso
Compilation\ClsComplianceChecker.vb (7)
817Case Accessibility.Public 819Case Accessibility.Protected, Accessibility.ProtectedOrFriend 823Case Accessibility.Private, Accessibility.ProtectedAndFriend, Accessibility.Friend 825Case Accessibility.NotApplicable
Compilation\MethodCompiler.vb (1)
1950If m.DeclaredAccessibility <> Accessibility.Public Then
Declarations\DeclarationModifiersExtensions.vb (7)
10Friend Function ToAccessibility(modifiers As DeclarationModifiers) As Accessibility 12Case DeclarationModifiers.Private : Return Accessibility.Private 13Case DeclarationModifiers.Public : Return Accessibility.Public 14Case DeclarationModifiers.Protected : Return Accessibility.Protected 15Case DeclarationModifiers.Friend : Return Accessibility.Friend 16Case DeclarationModifiers.Friend Or DeclarationModifiers.Protected : Return Accessibility.ProtectedOrFriend 17Case DeclarationModifiers.Private Or DeclarationModifiers.Protected : Return Accessibility.ProtectedAndFriend
Emit\AttributeDataAdapter.vb (1)
137If member.DeclaredAccessibility = Accessibility.Public Then
Emit\NoPia\EmbeddedType.vb (1)
65Return UnderlyingNamedType.AdaptedNamedTypeSymbol.DeclaredAccessibility = Accessibility.Public
Emit\NoPia\EmbeddedTypesManager.vb (1)
385(containerKind = TypeKind.Structure AndAlso (field.AdaptedFieldSymbol.IsShared OrElse field.AdaptedFieldSymbol.DeclaredAccessibility <> Accessibility.Public)) Then
Emit\PEModuleBuilder.vb (2)
505If symbol.DeclaredAccessibility <> Accessibility.Public Then 560If entry.type.DeclaredAccessibility = Accessibility.Private Then
Emit\SynthesizedNamespaceSymbol.vb (2)
56Friend Overrides ReadOnly Property DeclaredAccessibilityOfMostAccessibleDescendantType As Accessibility 58Return Accessibility.Friend
Errors\ErrorMessageHelpers.vb (8)
13Public Function ToDisplay(access As Accessibility) As String 15Case Accessibility.NotApplicable 17Case Accessibility.Private 19Case Accessibility.Protected 21Case Accessibility.ProtectedOrFriend 23Case Accessibility.ProtectedAndFriend 25Case Accessibility.Friend 27Case Accessibility.Public
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.vb (1)
119result = Me.F.StateMachineField(awaiterType, Me._method, fieldName, SynthesizedLocalKind.AwaiterField, slotIndex, accessibility:=Accessibility.Friend)
Lowering\AsyncRewriter\AsyncRewriter.SpillFieldAllocator.vb (1)
44Accessibility.Friend)
Lowering\AsyncRewriter\AsyncRewriter.vb (5)
136Me.StateField = Me.F.StateMachineField(Me.F.SpecialType(SpecialType.System_Int32), Me.Method, GeneratedNames.MakeStateMachineStateFieldName(), Accessibility.Public) 137Me._builderField = Me.F.StateMachineField(Me._builderType, Me.Method, GeneratedNames.MakeStateMachineBuilderFieldName(), Accessibility.Public) 173Accessibility.Friend)) 179Accessibility.Private, 467Accessibility.Friend),
Lowering\IteratorRewriter\IteratorRewriter.vb (10)
139Me.StateField = Me.F.StateMachineField(Me.F.SpecialType(SpecialType.System_Int32), Me.Method, GeneratedNames.MakeStateMachineStateFieldName(), Accessibility.Public) 142_currentField = F.StateMachineField(_elementType, Me.Method, GeneratedNames.MakeIteratorCurrentFieldName(), Accessibility.Public) 146F.StateMachineField(F.SpecialType(SpecialType.System_Int32), Me.Method, GeneratedNames.MakeIteratorInitialThreadIdName(), Accessibility.Public), 157Accessibility.Private, 161Accessibility.Private) 184Accessibility.Private, 269Accessibility.Private, 278Accessibility.Private) 284Accessibility.Private, 297Accessibility.Private)
Lowering\LambdaRewriter\LambdaCapturedVariable.vb (1)
28MyBase.New(frame, captured, type, fieldName, accessibility:=Accessibility.Public)
Lowering\LambdaRewriter\LambdaFrame.vb (3)
70Me._singletonCache = New SynthesizedLambdaCacheFieldSymbol(Me, Me, Me, cacheVariableName, topLevelMethod, Accessibility.Public, isReadOnly:=True, isShared:=True) 129Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 132Return Accessibility.Friend
Lowering\LambdaRewriter\LambdaRewriter.vb (1)
1236accessibility:=Accessibility.Public,
Lowering\LambdaRewriter\SynthesizedLambdaCacheFieldSymbol.vb (2)
25Optional accessibility As Accessibility = Accessibility.Private,
Lowering\LambdaRewriter\SynthesizedLambdaMethod.vb (3)
30Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 32Return If(TypeOf ContainingType Is LambdaFrame, Accessibility.Friend, Accessibility.Private)
Lowering\MethodToClassRewriter\MethodToClassRewriter.MyBaseMyClassWrapper.vb (2)
290Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 292Return Accessibility.Private
Lowering\StateMachineRewriter\StateMachineFieldSymbol.vb (6)
27Optional accessibility As Accessibility = Accessibility.Private, 48Optional accessibility As Accessibility = Accessibility.Private, 69Optional accessibility As Accessibility = Accessibility.Private,
Lowering\StateMachineRewriter\StateMachineRewriter.vb (15)
219Accessibility.Friend), 230Accessibility.Friend), 246Accessibility.Friend), 257Accessibility.Friend), 354Return F.StateMachineField(localType, Me.Method, proxyName, New LocalSlotDebugInfo(local.SynthesizedKind, id), slotIndex, Accessibility.Friend) 413Friend Function OpenMethodImplementation(interfaceMethod As WellKnownMember, name As String, accessibility As Accessibility, Optional hasMethodBodyDependency As Boolean = False, Optional associatedProperty As PropertySymbol = Nothing) As SynthesizedMethod 419Friend Function OpenMethodImplementation(interfaceMethod As SpecialMember, name As String, accessibility As Accessibility, Optional hasMethodBodyDependency As Boolean = False, Optional associatedProperty As PropertySymbol = Nothing) As SynthesizedMethod 425Friend Function OpenMethodImplementation(interfaceType As NamedTypeSymbol, interfaceMethod As SpecialMember, name As String, accessibility As Accessibility, Optional hasMethodBodyDependency As Boolean = False, Optional associatedProperty As PropertySymbol = Nothing) As SynthesizedMethod 433accessibility As Accessibility, 453Friend Function OpenPropertyImplementation(interfaceProperty As SpecialMember, name As String, accessibility As Accessibility) As MethodSymbol 459Friend Function OpenPropertyImplementation(interfaceType As NamedTypeSymbol, interfaceMethod As SpecialMember, name As String, accessibility As Accessibility) As MethodSymbol 465Private Function OpenPropertyImplementation(getterToImplement As MethodSymbol, name As String, accessibility As Accessibility) As MethodSymbol 490Friend Function OpenMoveNextMethodImplementation(interfaceMethod As WellKnownMember, accessibility As Accessibility) As SynthesizedMethod 496Friend Function OpenMoveNextMethodImplementation(interfaceMethod As SpecialMember, accessibility As Accessibility) As SynthesizedMethod 502Private Function OpenMoveNextMethodImplementation(methodToImplement As MethodSymbol, accessibility As Accessibility) As SynthesizedMethod
Lowering\StateMachineRewriter\SynthesizedContainer.vb (2)
262Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 264Return Accessibility.Private
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.vb (5)
24Private ReadOnly _accessibility As Accessibility 33declaredAccessibility As Accessibility, 121Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 190declaredAccessibility As Accessibility) 243declaredAccessibility As Accessibility,
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.vb (2)
27declaredAccessibility As Accessibility) 130Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Lowering\SynthesizedSubmissionFields.vb (1)
58_hostObjectField = New SynthesizedFieldSymbol(_declaringSubmissionClass, _declaringSubmissionClass, hostObjectTypeSymbol, "<host-object>", accessibility:=Accessibility.Private, isReadOnly:=True, isShared:=False)
Lowering\SyntheticBoundNodeFactory.vb (6)
115Public Function StateMachineField(type As TypeSymbol, implicitlyDefinedBy As Symbol, name As String, Optional accessibility As Accessibility = Accessibility.Private) As SynthesizedFieldSymbol 121Public Function StateMachineField(type As TypeSymbol, implicitlyDefinedBy As Symbol, name As String, synthesizedKind As SynthesizedLocalKind, slotIndex As Integer, Optional accessibility As Accessibility = Accessibility.Private) As SynthesizedFieldSymbol 127Public Function StateMachineField(type As TypeSymbol, implicitlyDefinedBy As Symbol, name As String, slotDebugInfo As LocalSlotDebugInfo, slotIndex As Integer, Optional accessibility As Accessibility = Accessibility.Private) As SynthesizedFieldSymbol
Semantics\AccessCheck.vb (62)
174Private Shared Function CheckNonNestedTypeAccessibility(assembly As AssemblySymbol, declaredAccessibility As Accessibility, within As Symbol) As AccessCheckResult 181Case Accessibility.NotApplicable, Accessibility.Public 185Case Accessibility.Private, Accessibility.Protected, Accessibility.ProtectedAndFriend 189Case Accessibility.Friend, Accessibility.ProtectedOrFriend 202declaredAccessibility As Accessibility, 221Case Accessibility.NotApplicable 224Case Accessibility.Public 227Case Accessibility.Private 241Case Accessibility.Friend 246Case Accessibility.ProtectedAndFriend 256Case Accessibility.ProtectedOrFriend 267Case Accessibility.Protected 658If exposedType.DeclaredAccessibility = Accessibility.Public Then 725Dim memberAccessOutsideAssembly As Accessibility = GetEffectiveAccessOutsideAssembly(exposedThrough) 727Debug.Assert(memberAccessOutsideAssembly <> Accessibility.Friend, "How can the access be friend outside the assembly ?") 729If memberAccessOutsideAssembly = Accessibility.Private Then 733Dim typeAccessOutsideAssembly As Accessibility = GetEffectiveAccessOutsideAssembly(exposedType) 735If typeAccessOutsideAssembly = Accessibility.Private Then 739If typeAccessOutsideAssembly = Accessibility.Public Then 743Debug.Assert(typeAccessOutsideAssembly = Accessibility.Protected, "What else can the Type access be outside the assembly ?") 745If memberAccessOutsideAssembly = Accessibility.Public Then 749Debug.Assert(memberAccessOutsideAssembly = Accessibility.Protected, "What else can the Member access be outside the assembly ?") 764Private Shared ReadOnly s_mapAccessToAccessOutsideAssembly() As Accessibility 767s_mapAccessToAccessOutsideAssembly = New Accessibility(Accessibility.Public) {} 769s_mapAccessToAccessOutsideAssembly(Accessibility.NotApplicable) = Accessibility.NotApplicable 770s_mapAccessToAccessOutsideAssembly(Accessibility.Private) = Accessibility.Private 771s_mapAccessToAccessOutsideAssembly(Accessibility.ProtectedAndFriend) = Accessibility.Private 772s_mapAccessToAccessOutsideAssembly(Accessibility.Protected) = Accessibility.Protected 773s_mapAccessToAccessOutsideAssembly(Accessibility.Friend) = Accessibility.Private 774s_mapAccessToAccessOutsideAssembly(Accessibility.ProtectedOrFriend) = Accessibility.Protected 775s_mapAccessToAccessOutsideAssembly(Accessibility.Public) = Accessibility.Public 781) As Accessibility 782Dim effectiveAccess As Accessibility = s_mapAccessToAccessOutsideAssembly(symbol.DeclaredAccessibility) 784If effectiveAccess = Accessibility.Private Then 792Dim accessOfContainer As Accessibility = s_mapAccessToAccessOutsideAssembly(enclosingType.DeclaredAccessibility) 798If effectiveAccess = Accessibility.Private Then 812) As Accessibility 813Dim accessOfMember As Accessibility = symbol.DeclaredAccessibility 861Dim membersAccessibilityInAssemblyContext As Accessibility = GetAccessInAssemblyContext(exposingMember, isOutsideAssembly) 863If membersAccessibilityInAssemblyContext = Accessibility.Private Then 874Dim StopAtAccess As Accessibility = Accessibility.Protected 879Dim exposingTypeAccessibilityInAssemblyContext As Accessibility = GetAccessInAssemblyContext(exposingType, isOutsideAssembly) 882If membersAccessibilityInAssemblyContext <= Accessibility.Protected Then 900If exposingTypeAccessibilityInAssemblyContext <> Accessibility.Protected Then 905Debug.Assert(exposingTypeAccessibilityInAssemblyContext = Accessibility.Protected) 927If GetAccessInAssemblyContext(type, isOutsideAssembly) = Accessibility.Private Then 970If GetAccessInAssemblyContext(type, isOutsideAssembly) <> Accessibility.Protected Then 990stopAtAccess As Accessibility, 1015Dim EnclosingContainerAccess As Accessibility = GetAccessInAssemblyContext(enclosingType, isOutsideAssembly)
SymbolDisplay\SymbolDisplayVisitor.vb (6)
352Case Accessibility.Private 354Case Accessibility.Internal 356Case Accessibility.Protected 358Case Accessibility.ProtectedAndInternal 362Case Accessibility.ProtectedOrInternal 366Case Accessibility.Public
Symbols\AccessibilityExtensions.vb (7)
17Friend Function ToDiagnosticString(a As Accessibility) As String 19Case Accessibility.Public 21Case Accessibility.Friend 23Case Accessibility.Private 25Case Accessibility.Protected 27Case Accessibility.ProtectedOrFriend 29Case Accessibility.ProtectedAndFriend
Symbols\AliasSymbol.vb (3)
201''' <returns><see cref="Accessibility.NotApplicable"/></returns> 202Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 204Return Accessibility.NotApplicable
Symbols\AnonymousTypes\PublicSymbols\AnonymousTypeOrDelegatePublicSymbol.vb (2)
164Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 166Return Accessibility.Friend
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_EqualsMethodSymbol.vb (2)
68Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 70Return Accessibility.Public
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_GetHashCodeMethodSymbol.vb (2)
37Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 39Return Accessibility.Public
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_IEquatable_EqualsMethodSymbol.vb (2)
74Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 76Return Accessibility.Public
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_PropertySymbol.vb (2)
119Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 121Return Accessibility.Public
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_ToStringMethodSymbol.vb (2)
41Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 43Return Accessibility.Public
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousTypeOrDelegateTemplateSymbol.vb (2)
263Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 265Return Accessibility.Friend
Symbols\ArrayTypeSymbol.vb (2)
305Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 307Return Accessibility.NotApplicable
Symbols\AssemblySymbol.vb (3)
193Public NotOverridable Overrides ReadOnly Property DeclaredAccessibility As Accessibility 195Return Accessibility.NotApplicable 728Return result.DeclaredAccessibility = Accessibility.Public OrElse IsSymbolAccessible(result, Me)
Symbols\Attributes\AttributeData.vb (2)
424[property].DeclaredAccessibility = Accessibility.Public AndAlso [property].GetArity() = 0 AndAlso 425[property].HasSet AndAlso [property].SetMethod.DeclaredAccessibility = Accessibility.Public Then
Symbols\ConstraintsHelper.vb (1)
1185If constructor.DeclaredAccessibility <> Accessibility.Public Then
Symbols\ErrorMethodSymbol.vb (2)
48Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 50Return Accessibility.Public
Symbols\ErrorTypeSymbol.vb (2)
218Public NotOverridable Overrides ReadOnly Property DeclaredAccessibility As Accessibility 220Return Accessibility.Public
Symbols\LabelSymbol.vb (2)
62Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 64Return Accessibility.NotApplicable
Symbols\MergedNamespaceSymbol.vb (7)
366Protected NotOverridable Overrides Function GetDeclaredAccessibilityOfMostAccessibleDescendantType() As Accessibility 368Dim result As Accessibility = Accessibility.NotApplicable 371Dim current As Accessibility = nsSym.DeclaredAccessibilityOfMostAccessibleDescendantType 374If current = Accessibility.Public Then 375Return Accessibility.Public 499If Me.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType = Accessibility.Public Then
Symbols\Metadata\PE\MetadataDecoder.vb (1)
331candidate.DeclaredAccessibility <> Accessibility.Public Then
Symbols\Metadata\PE\PEEventSymbol.vb (3)
165Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 168Dim accessibility As Accessibility = PEPropertyOrEventHelpers.GetDeclaredAccessibilityFromAccessors(Me.AddMethod, Me.RemoveMethod) 172Return DirectCast(Me._lazyDeclaredAccessibility, Accessibility)
Symbols\Metadata\PE\PEFieldSymbol.vb (10)
108Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 110Dim access As Accessibility = Accessibility.Private 114access = Accessibility.Friend 117access = Accessibility.ProtectedOrFriend 120access = Accessibility.ProtectedAndFriend 124access = Accessibility.Private 127access = Accessibility.Public 130access = Accessibility.Protected 133access = Accessibility.Private
Symbols\Metadata\PE\PEMethodSymbol.vb (12)
405ElseIf IsShared AndAlso DeclaredAccessibility = Accessibility.Public AndAlso Not IsSub AndAlso Arity = 0 Then 525IsShared AndAlso DeclaredAccessibility = Accessibility.Public AndAlso 607Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 609Dim access As Accessibility = Accessibility.Private 613access = Accessibility.Friend 616access = Accessibility.ProtectedOrFriend 619access = Accessibility.ProtectedAndFriend 623access = Accessibility.Private 626access = Accessibility.Public 629access = Accessibility.Protected 632access = Accessibility.Private
Symbols\Metadata\PE\PENamedTypeSymbol.vb (10)
339Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 341Dim access As Accessibility = Accessibility.Private 345access = Accessibility.Friend 348access = Accessibility.ProtectedOrFriend 351access = Accessibility.ProtectedAndFriend 354access = Accessibility.Private 358access = Accessibility.Public 361access = Accessibility.Protected 364access = Accessibility.Friend
Symbols\Metadata\PE\PENamedTypeSymbolWithEmittedNamespaceName.vb (1)
36If (Arity = 0 OrElse MangleName) AndAlso (moduleSymbol.ContainingAssembly.KeepLookingForDeclaredSpecialTypes) AndAlso Me.DeclaredAccessibility = Accessibility.Public Then
Symbols\Metadata\PE\PENestedNamespaceSymbol.vb (5)
140Protected Overrides Function GetDeclaredAccessibilityOfMostAccessibleDescendantType() As Accessibility 146Dim result As Accessibility = Accessibility.NotApplicable 159Return Accessibility.Public 162result = Accessibility.Friend
Symbols\Metadata\PE\PEPropertyOrEventHelpers.vb (5)
51Friend Shared Function GetDeclaredAccessibilityFromAccessors(accessor1 As MethodSymbol, accessor2 As MethodSymbol) As Accessibility 53Return If((accessor2 Is Nothing), Accessibility.NotApplicable, accessor2.DeclaredAccessibility) 62Return If(((minAccessibility = Accessibility.[Protected]) AndAlso (maxAccessibility = Accessibility.Friend)), Accessibility.ProtectedOrFriend, maxAccessibility)
Symbols\Metadata\PE\PEPropertySymbol.vb (7)
179Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 185Return DirectCast(Me._lazyDeclaredAccessibility, Accessibility) 437Private Shared Function GetDeclaredAccessibility([property] As PropertySymbol) As Accessibility 441Return If((setMethod Is Nothing), Accessibility.NotApplicable, setMethod.DeclaredAccessibility) 450Return If(((minAccessibility = Accessibility.Protected) AndAlso (maxAccessibility = Accessibility.Friend)), Accessibility.ProtectedOrFriend, maxAccessibility)
Symbols\MetadataOrSourceAssemblySymbol.vb (1)
55If result Is Nothing OrElse result.DeclaredAccessibility <> Accessibility.Public Then
Symbols\MethodSymbol.vb (2)
547If Me.DeclaredAccessibility = Accessibility.Private Then 553If type.DeclaredAccessibility = Accessibility.Private Then
Symbols\MissingNamespaceSymbol.vb (2)
125Friend Overrides ReadOnly Property DeclaredAccessibilityOfMostAccessibleDescendantType As Accessibility 127Return Accessibility.Private
Symbols\ModuleSymbol.vb (2)
44Public NotOverridable Overrides ReadOnly Property DeclaredAccessibility As Accessibility 46Return Accessibility.NotApplicable
Symbols\NamedTypeSymbol.vb (1)
643Public MustOverride Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\NamespaceSymbol.vb (14)
157Public NotOverridable Overrides ReadOnly Property DeclaredAccessibility As Accessibility 159Return Accessibility.Public 180Friend MustOverride ReadOnly Property DeclaredAccessibilityOfMostAccessibleDescendantType As Accessibility 191Protected Overridable Function GetDeclaredAccessibilityOfMostAccessibleDescendantType() As Accessibility 193Dim result As Accessibility = Accessibility.NotApplicable 198Case Accessibility.Public 199Return Accessibility.Public 202result = Accessibility.Friend 211Dim childResult As Accessibility = [namespace].DeclaredAccessibilityOfMostAccessibleDescendantType 214If childResult = Accessibility.Public Then 215Return Accessibility.Public 232If accessibility = Accessibility.Public Then 236If accessibility = Accessibility.Friend Then
Symbols\ParameterSymbol.vb (2)
205Public NotOverridable Overrides ReadOnly Property DeclaredAccessibility As Accessibility 207Return Accessibility.NotApplicable
Symbols\PEOrSourceOrMergedNamespaceSymbol.vb (9)
42Private _lazyDeclaredAccessibilityOfMostAccessibleDescendantType As Byte = CByte(Accessibility.Private) ' Not calculated yet. 44Friend ReadOnly Property RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType As Accessibility 46Return CType(_lazyDeclaredAccessibilityOfMostAccessibleDescendantType, Accessibility) 59Friend NotOverridable Overrides ReadOnly Property DeclaredAccessibilityOfMostAccessibleDescendantType As Accessibility 61If _lazyDeclaredAccessibilityOfMostAccessibleDescendantType = Accessibility.Private Then 65If _lazyDeclaredAccessibilityOfMostAccessibleDescendantType = Accessibility.Public Then 69parent._lazyDeclaredAccessibilityOfMostAccessibleDescendantType = Accessibility.Private 71parent._lazyDeclaredAccessibilityOfMostAccessibleDescendantType = CByte(Accessibility.Public) 77Return CType(_lazyDeclaredAccessibilityOfMostAccessibleDescendantType, Accessibility)
Symbols\PreprocessingSymbol.vb (2)
52Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 54Return Accessibility.NotApplicable
Symbols\ReducedExtensionMethodSymbol.vb (1)
613Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\Retargeting\RetargetingEventSymbol.vb (1)
73Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\Retargeting\RetargetingFieldSymbol.vb (1)
100Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\Retargeting\RetargetingMethodSymbol.vb (1)
272Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\Retargeting\RetargetingNamedTypeSymbol.vb (1)
353Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\Retargeting\RetargetingNamespaceSymbol.vb (2)
207Protected Overrides Function GetDeclaredAccessibilityOfMostAccessibleDescendantType() As Accessibility 211Friend Overrides ReadOnly Property DeclaredAccessibilityOfMostAccessibleDescendantType As Accessibility
Symbols\Retargeting\RetargetingPropertySymbol.vb (1)
89Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\SignatureOnlyMethodSymbol.vb (1)
210Public Overrides ReadOnly Property DeclaredAccessibility() As Accessibility
Symbols\SignatureOnlyPropertySymbol.vb (1)
136Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\Source\CustomEventAccessorSymbol.vb (2)
53Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 57Return Accessibility.Private
Symbols\Source\ImplementsHelper.vb (1)
645If member.DeclaredAccessibility = Accessibility.Public AndAlso
Symbols\Source\LambdaSymbol.vb (2)
143Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 145Return Accessibility.Private
Symbols\Source\LocalSymbol.vb (2)
206Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 208Return Accessibility.NotApplicable
Symbols\Source\OverrideHidingHelper.vb (3)
903If inaccessibleMember.DeclaredAccessibility = Accessibility.Friend AndAlso 1009If overridden.DeclaredAccessibility = Accessibility.ProtectedOrFriend And Not overriding.ContainingAssembly = overridden.ContainingAssembly Then 1011Return overriding.DeclaredAccessibility = Accessibility.Protected
Symbols\Source\RangeVariableSymbol.vb (2)
55Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 57Return Accessibility.NotApplicable
Symbols\Source\SourceAssemblySymbol.vb (1)
939Return Not obj.IsErrorType() AndAlso obj.DeclaredAccessibility = Accessibility.Public
Symbols\Source\SourceEventSymbol.vb (3)
566Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 568Return CType((_memberFlags And SourceMemberFlags.AccessibilityMask), Accessibility) 714Accessibility.Public,
Symbols\Source\SourceFieldSymbol.vb (2)
169Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 171Return CType((m_memberFlags And SourceMemberFlags.AccessibilityMask), Accessibility)
Symbols\Source\SourceMemberContainerTypeSymbol.vb (9)
27[Private] = CUShort(Accessibility.Private) 28[Protected] = CUShort(Accessibility.Protected) 29[Friend] = CUShort(Accessibility.Friend) 30ProtectedFriend = CUShort(Accessibility.ProtectedOrFriend) 31PrivateProtected = CUShort(Accessibility.ProtectedAndFriend) 32[Public] = CUShort(Accessibility.Public) 1235Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 1237Return CType((_flags And SourceTypeFlags.AccessibilityMask), Accessibility) 1900If implMethod.DeclaredAccessibility <> Accessibility.Private Then
Symbols\Source\SourceMemberFieldSymbol.vb (2)
435If(container.IsValueType, Accessibility.Public, Accessibility.Private),
Symbols\Source\SourceMethodSymbol.vb (5)
226Accessibility.Public, 428Accessibility.Public, 455Dim operatorModifiers = binder.DecodeModifiers(syntax.Modifiers, allowModifiers, ERRID.ERR_BadOperatorFlags1, Accessibility.Public, diagBag) 642Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 644Return CType((m_flags And SourceMemberFlags.AccessibilityMask), Accessibility)
Symbols\Source\SourceNamedTypeSymbol.vb (5)
83Me.DeclaredAccessibility = Accessibility.Public Then 601If namedType.DeclaredAccessibility = Accessibility.Public AndAlso namedType.MangleName = Me.MangleName Then 703accessibility:=Accessibility.Public, 2363(member.DeclaredAccessibility = Accessibility.Public OrElse 2364member.DeclaredAccessibility = Accessibility.Friend) Then
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (14)
164If comClass.DeclaredAccessibility <> Accessibility.Public Then 170If container.DeclaredAccessibility <> Accessibility.Public Then 341If member.DeclaredAccessibility <> Accessibility.Private Then 369If member.IsShared OrElse member.DeclaredAccessibility <> Accessibility.Public OrElse 406If getter.DeclaredAccessibility <> Accessibility.Public OrElse Not GetComVisibleState(getter) Then 416If setter.DeclaredAccessibility <> Accessibility.Public OrElse Not GetComVisibleState(setter) Then 742Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 744Return Accessibility.Public 1052Debug.Assert(clone.DeclaredAccessibility = Accessibility.Public) 1121Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 1123Return Accessibility.Public 1683Debug.Assert(clone.DeclaredAccessibility = Accessibility.Public) 1732Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 1734Return Accessibility.Public
Symbols\Source\SourcePropertyAccessorSymbol.vb (5)
81Accessibility.NotApplicable, 167Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 170If accessibility <> Accessibility.NotApplicable Then 175Debug.Assert(propertyAccessibility <> Accessibility.NotApplicable) 377Friend ReadOnly Property LocalAccessibility As Accessibility
Symbols\Source\SourcePropertySymbol.vb (16)
140If getMethod.LocalAccessibility <> Accessibility.NotApplicable Then 153If setMethod.LocalAccessibility <> Accessibility.NotApplicable Then 165If (getMethod.LocalAccessibility <> Accessibility.NotApplicable) AndAlso (setMethod.LocalAccessibility <> Accessibility.NotApplicable) Then 170((getMethod.LocalAccessibility = Accessibility.Private) OrElse (setMethod.LocalAccessibility = Accessibility.Private)) Then 977Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 979Return CType((_flags And SourceMemberFlags.AccessibilityMask), Accessibility) 1083ElseIf [property].IsNotOverridable AndAlso localAccessibility = Accessibility.Private Then 1085ElseIf [property].IsDefault AndAlso localAccessibility = Accessibility.Private Then 1096Private Shared Function IsAccessibilityMoreRestrictive([property] As Accessibility, accessor As Accessibility) As Boolean 1097If accessor = Accessibility.NotApplicable Then 1101Return (accessor < [property]) AndAlso ((accessor <> Accessibility.Protected) OrElse ([property] <> Accessibility.Friend)) 1131Accessibility.Public,
Symbols\Source\SourceTypeParameterSymbol.vb (1)
369If (_container.DeclaredAccessibility = Accessibility.Private) AndAlso
Symbols\Source\SynthesizedEntryPointSymbol.vb (2)
123Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 125Return Accessibility.Private
Symbols\Source\SynthesizedFieldSymbol.vb (4)
33Optional accessibility As Accessibility = Accessibility.Private, 148Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 150Return CType((_flags And SourceMemberFlags.AccessibilityMask), Accessibility)
Symbols\Source\SynthesizedInteractiveInitializerMethod.vb (2)
45Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 47Return Accessibility.Friend
Symbols\Source\SynthesizedMainTypeEntryPoint.vb (2)
28Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 30Return Accessibility.Public
Symbols\Source\SynthesizedMyGroupCollectionPropertyBackingFieldSymbol.vb (1)
29MyBase.New(containingType, implicitlyDefinedBy, type, name, Accessibility.Public, isReadOnly:=False, isShared:=False)
Symbols\SubstitutedEventSymbol.vb (1)
205Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\SubstitutedFieldSymbol.vb (1)
121Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\SubstitutedMethodSymbol.vb (1)
154Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\SubstitutedNamedType.vb (1)
110Public NotOverridable Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\SubstitutedPropertySymbol.vb (1)
99Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\Symbol.vb (8)
94Case Accessibility.Public 97Case Accessibility.Private 104Case Accessibility.Friend 111Case Accessibility.Protected 118Case Accessibility.ProtectedAndFriend 122Case Accessibility.ProtectedOrFriend 441Public MustOverride ReadOnly Property DeclaredAccessibility As Accessibility 1235Private ReadOnly Property ISymbol_DeclaredAccessibility As Accessibility Implements ISymbol.DeclaredAccessibility, ISymbolInternal.DeclaredAccessibility
Symbols\SynthesizedSymbols\SynthesizedAccessor.vb (1)
70Public NotOverridable Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\SynthesizedSymbols\SynthesizedBackingFieldBase.vb (2)
95Public NotOverridable Overrides ReadOnly Property DeclaredAccessibility As Accessibility 97Return Accessibility.Private
Symbols\SynthesizedSymbols\SynthesizedConstructorBase.vb (5)
72''' Gets a <see cref="Accessibility" /> indicating the declared accessibility for the symbol. 75Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 79Return Accessibility.Private 81Return Accessibility.Protected 83Return Accessibility.Public
Symbols\SynthesizedSymbols\SynthesizedDelegateMethodSymbol.vb (3)
108''' Gets a <see cref="Accessibility" /> indicating the declared accessibility for the symbol. 111Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 113Return Accessibility.Public
Symbols\SynthesizedSymbols\SynthesizedEventDelegateSymbol.vb (1)
172Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\SynthesizedSymbols\SynthesizedGlobalMethodBase.vb (2)
180Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 182Return Accessibility.Friend
Symbols\SynthesizedSymbols\SynthesizedHotReloadExceptionSymbol.vb (3)
31New SynthesizedFieldSymbol(Me, implicitlyDefinedBy:=Me, intType, CodeFieldName, Accessibility.Public, isReadOnly:=True, isShared:=False)) 100Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 102Return Accessibility.Friend
Symbols\SynthesizedSymbols\SynthesizedInterfaceImplementationStubSymbol.vb (2)
118Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 120Return Accessibility.Private
Symbols\SynthesizedSymbols\SynthesizedIntrinsicOperatorSymbol.vb (2)
98Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 100Return Accessibility.Public
Symbols\SynthesizedSymbols\SynthesizedMethod.vb (2)
120Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 122Return Accessibility.Public
Symbols\SynthesizedSymbols\SynthesizedOverridingWitheventsProperty.vb (1)
100Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\SynthesizedSymbols\SynthesizedPropertyBase.vb (2)
62Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 64Return Accessibility.Public
Symbols\SynthesizedSymbols\SynthesizedSimpleMethodSymbol.vb (2)
58Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 60Return Accessibility.Public
Symbols\Tuples\TupleErrorFieldSymbol.vb (1)
44MyBase.New(container, container, type, name, Accessibility.Public)
Symbols\Tuples\TupleTypeSymbol.vb (3)
170Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 172Dim result As Accessibility 174result = Accessibility.[Public]
Symbols\TypeParameterSymbol.vb (2)
134Public NotOverridable Overrides ReadOnly Property DeclaredAccessibility As Accessibility 136Return Accessibility.NotApplicable
Symbols\UnboundGenericType.vb (1)
197Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\WellKnownMembers.vb (1)
458Not (m.DeclaredAccessibility = Accessibility.Public OrElse (accessWithinOpt IsNot Nothing AndAlso Symbol.IsSymbolAccessible(m, accessWithinOpt))) Then
Symbols\Wrapped\WrappedEventSymbol.vb (1)
58Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\Wrapped\WrappedFieldSymbol.vb (1)
34Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\Wrapped\WrappedMethodSymbol.vb (1)
78Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\Wrapped\WrappedNamedTypeSymbol.vb (1)
72Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\Wrapped\WrappedPropertySymbol.vb (1)
77Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Syntax\SyntaxFacts.vb (8)
525Public Shared Function GetText(accessibility As Accessibility) As String 528Case Accessibility.Friend 531Case Accessibility.NotApplicable 534Case Accessibility.Private 537Case Accessibility.Protected 540Case Accessibility.ProtectedAndFriend 543Case Accessibility.ProtectedOrFriend 546Case Accessibility.Public
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (24)
src\Analyzers\VisualBasic\Analyzers\AddAccessibilityModifiers\VisualBasicAddAccessibilityModifiers.vb (4)
65Private Shared Function MatchesDefaultAccessibility(accessibility As Accessibility, member As StatementSyntax) As Boolean 70Return accessibility = Accessibility.Friend 77Return accessibility = Accessibility.Private 82Return accessibility = Accessibility.Public
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (3)
98cancellationToken As CancellationToken) As Accessibility 100Return Accessibility.Private 164Return Accessibility.Private
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicAccessibilityFacts.vb (17)
90Public Function GetAccessibility(declaration As SyntaxNode) As Accessibility Implements IAccessibilityFacts.GetAccessibility 92Return Accessibility.NotApplicable 96Dim acc As Accessibility 185Public Shared Sub GetAccessibilityAndModifiers(modifierTokens As SyntaxTokenList, ByRef accessibility As Accessibility, ByRef modifiers As DeclarationModifiers, ByRef isDefault As Boolean) 186accessibility = Accessibility.NotApplicable 195accessibility = Accessibility.Public 197If accessibility = Accessibility.Protected Then 198accessibility = Accessibility.ProtectedAndFriend 200accessibility = Accessibility.Private 203If accessibility = Accessibility.Protected Then 204accessibility = Accessibility.ProtectedOrFriend 206accessibility = Accessibility.Friend 209If accessibility = Accessibility.Friend Then 210accessibility = Accessibility.ProtectedOrFriend 211ElseIf accessibility = Accessibility.Private Then 212accessibility = Accessibility.ProtectedAndFriend 214accessibility = Accessibility.Protected
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (37)
src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
127accessibility:=Accessibility.Protected,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ConstructorGenerator.vb (1)
88AddAccessibilityModifiers(constructor.DeclaredAccessibility, tokens, destination, options, Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (1)
170AddAccessibilityModifiers([event].DeclaredAccessibility, tokens, destination, options, Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
109AddAccessibilityModifiers(field.DeclaredAccessibility, tokens, destination, options, Accessibility.Private)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
147AddAccessibilityModifiers(method.DeclaredAccessibility, result, destination, options, Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (7)
168Case Accessibility.Public 170Case Accessibility.Protected 172Case Accessibility.Private 174Case Accessibility.Internal 176Case Accessibility.ProtectedAndInternal 179Case Accessibility.ProtectedOrInternal 182Case Accessibility.Internal
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (3)
160If accessor.DeclaredAccessibility = Accessibility.NotApplicable OrElse 168AddAccessibilityModifiers(accessor.DeclaredAccessibility, modifiers, destination, options, Accessibility.Public) 189AddAccessibilityModifiers([property].DeclaredAccessibility, tokens, destination, options, Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationHelpers.vb (9)
16accessibility As Accessibility, 20nonStructureAccessibility As Accessibility) 22If destination = CodeGenerationDestination.StructType AndAlso accessibility = Accessibility.Public Then 32Case Accessibility.Public 35Case Accessibility.Protected 38Case Accessibility.Private 41Case Accessibility.Internal 44Case Accessibility.ProtectedAndInternal 48Case Accessibility.ProtectedOrInternal
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (3)
641Public Overrides Function UpdateDeclarationAccessibility(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newAccessibility As Accessibility, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 649Private Overloads Shared Function UpdateDeclarationAccessibility(modifiersList As SyntaxTokenList, newAccessibility As Accessibility, options As VisualBasicCodeGenerationContextInfo) As SyntaxTokenList 652AddAccessibilityModifiers(newAccessibility, newModifierTokens, CodeGenerationDestination.Unspecified, options, Accessibility.NotApplicable)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (10)
177Optional accessibility As Accessibility = Accessibility.NotApplicable, 364Friend Shared Function GetModifierList(accessibility As Accessibility, modifiers As DeclarationModifiers, declaration As SyntaxNode, kind As DeclarationKind, Optional isDefault As Boolean = False) As SyntaxTokenList 378Case Accessibility.Internal 380Case Accessibility.Public 382Case Accessibility.Private 384Case Accessibility.Protected 386Case Accessibility.ProtectedOrInternal 388Case Accessibility.ProtectedAndInternal 390Case Accessibility.NotApplicable
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (3)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (3)
137accessibility:=Accessibility.Public, 188accessibility:=Accessibility.Private, 231accessibility:=Accessibility.Protected,
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (20)
CodeGen\CodeGenAsyncTests.vb (3)
9227Assert.Equal(Accessibility.Private, method.DeclaredAccessibility) 9235Assert.Equal(Accessibility.Friend, method.DeclaredAccessibility) 9255Assert.Equal(Accessibility.Private, type.DeclaredAccessibility)
CodeGen\CodeGenSelectCase.vb (1)
3371Assert.Equal(Accessibility.Friend, member.DeclaredAccessibility)
Emit\EmitMetadata.vb (10)
485Assert.Equal(Accessibility.Public, classA.DeclaredAccessibility) 488Assert.Equal(Accessibility.Friend, classB.DeclaredAccessibility) 491Assert.Equal(Accessibility.Friend, classC.DeclaredAccessibility) 498Assert.Equal(Accessibility.Public, classD.DeclaredAccessibility) 499Assert.Equal(Accessibility.Friend, classE.DeclaredAccessibility) 500Assert.Equal(Accessibility.Protected, classF.DeclaredAccessibility) 501Assert.Equal(Accessibility.ProtectedOrFriend, classH.DeclaredAccessibility) 505Assert.Equal(Accessibility.Private, classG.DeclaredAccessibility) 786Assert.Equal(Accessibility.Protected, ctor.DeclaredAccessibility) 807Assert.Equal(Accessibility.Private, cctor.DeclaredAccessibility)
Emit\NoPiaEmbedTypes.vb (4)
1107Assert.Equal(Accessibility.Public, value__.DeclaredAccessibility) 1119Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility) 1147Assert.Equal(Accessibility.Public, f3.DeclaredAccessibility) 1397Assert.Equal(Accessibility.Public, p1.DeclaredAccessibility)
PrivateProtected.vb (2)
139If Accessibility.ProtectedAndInternal <> member.DeclaredAccessibility Then 142Assert.Equal(Accessibility.ProtectedAndInternal, member.DeclaredAccessibility)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (11)
Symbols\DisplayClassVariable.vb (3)
107Private ReadOnly _accessibility As Accessibility 109Friend Sub New(container As NamedTypeSymbol, name As String, type As TypeSymbol, accessibility As Accessibility) 140Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility
Symbols\EEMethodSymbol.vb (2)
366Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 368Return Accessibility.Internal
Symbols\EENamedTypeSymbol.vb (2)
189Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 191Return Accessibility.Internal
Symbols\PlaceholderMethodSymbol.vb (2)
53Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 55Return Accessibility.Friend
Symbols\SynthesizedContextMethodSymbol.vb (2)
21Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 23Return Accessibility.NotApplicable
Microsoft.CodeAnalysis.VisualBasic.Features (30)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (4)
142attributes:=Nothing, accessibility:=Accessibility.Public, modifiers:=Nothing, 149accessibility:=Accessibility.Public, modifiers:=Nothing, 391attributes:=Nothing, accessibility:=Accessibility.Public, modifiers:=Nothing, 397attributes:=Nothing, accessibility:=Accessibility.Public, modifiers:=Nothing,
Completion\CompletionProviders\OverrideCompletionProvider.vb (12)
73ByRef seenAccessibility As Accessibility, 78seenAccessibility = Accessibility.NotApplicable 103If seenAccessibility = Accessibility.NotApplicable Then 104seenAccessibility = Accessibility.Public 108If seenAccessibility = Accessibility.NotApplicable Then 109seenAccessibility = Accessibility.Internal 113If seenAccessibility = Accessibility.Protected Then 114seenAccessibility = Accessibility.ProtectedOrInternal 118If seenAccessibility = Accessibility.NotApplicable Then 119seenAccessibility = Accessibility.Protected 123If seenAccessibility = Accessibility.Internal Then 124seenAccessibility = Accessibility.ProtectedOrInternal
EncapsulateField\VisualBasicEncapsulateFieldService.vb (1)
108If field.DeclaredAccessibility = Accessibility.Private OrElse IsShadows(field) Then
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (1)
76accessibility:=Accessibility.Private,
GenerateType\VisualBasicGenerateTypeService.vb (2)
397Protected Overrides Function GetAccessibility(state As State, semanticModel As SemanticModel, intoNamespace As Boolean, cancellationToken As CancellationToken) As Accessibility 687accessibility:=Accessibility.Public,
InitializeParameter\VisualBasicInitializeMemberFromParameterCodeRefactoringProvider.vb (5)
37Protected Overrides Function DetermineDefaultFieldAccessibility(containingType As INamedTypeSymbol) As Accessibility 38Return If(containingType.TypeKind = TypeKind.Class Or containingType.TypeKind = TypeKind.Module, Accessibility.Private, Accessibility.Public) 42Protected Overrides Function DetermineDefaultPropertyAccessibility() As Accessibility 43Return Accessibility.Public
src\Analyzers\VisualBasic\Analyzers\AddAccessibilityModifiers\VisualBasicAddAccessibilityModifiers.vb (4)
65Private Shared Function MatchesDefaultAccessibility(accessibility As Accessibility, member As StatementSyntax) As Boolean 70Return accessibility = Accessibility.Friend 77Return accessibility = Accessibility.Private 82Return accessibility = Accessibility.Public
src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
127accessibility:=Accessibility.Protected,
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (1)
EditAndContinue\TopLevelEditingTests.vb (1)
6580InstanceConstructors.Single(Function(ctor) ctor.DeclaredAccessibility = Accessibility.Private))},
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (41)
Binding\LookupTests.vb (36)
958Assert.Equal(Accessibility.Private, system.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 959Assert.Equal(Accessibility.Private, deployment.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 960Assert.Equal(Accessibility.Private, internal.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 961Assert.Equal(Accessibility.Private, isolation.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 964Assert.Equal(Accessibility.Friend, isolation.DeclaredAccessibilityOfMostAccessibleDescendantType) 966Assert.Equal(Accessibility.Friend, isolation.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 967Assert.Equal(Accessibility.Private, system.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 968Assert.Equal(Accessibility.Private, deployment.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 969Assert.Equal(Accessibility.Private, internal.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 976Assert.Equal(Accessibility.Private, system.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 977Assert.Equal(Accessibility.Private, io.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 978Assert.Equal(Accessibility.Private, isolatedStorage.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 981Assert.Equal(Accessibility.Public, isolatedStorage.DeclaredAccessibilityOfMostAccessibleDescendantType) 983Assert.Equal(Accessibility.Public, isolatedStorage.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 984Assert.Equal(Accessibility.Public, system.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 985Assert.Equal(Accessibility.Public, io.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1027Assert.Equal(Accessibility.Private, p.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1028Assert.Equal(Accessibility.Private, q.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1032Assert.Equal(Accessibility.Public, q.DeclaredAccessibilityOfMostAccessibleDescendantType) 1033Assert.Equal(Accessibility.Public, p.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1034Assert.Equal(Accessibility.Public, q.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1059Assert.Equal(Accessibility.Private, p.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1060Assert.Equal(Accessibility.Private, q.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1066Assert.Equal(Accessibility.Private, p.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1067Assert.Equal(Accessibility.Private, q.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1072Assert.Equal(Accessibility.Private, p.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1087Assert.Equal(Accessibility.Private, p.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1088Assert.Equal(Accessibility.Private, q.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1094Assert.Equal(Accessibility.Private, p.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1095Assert.Equal(Accessibility.Private, q.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1100Assert.Equal(Accessibility.Private, p.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1116Assert.Equal(Accessibility.Private, p.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1117Assert.Equal(Accessibility.Private, q.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1121Assert.Equal(Accessibility.Friend, q.DeclaredAccessibilityOfMostAccessibleDescendantType) 1122Assert.Equal(Accessibility.Private, p.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType) 1123Assert.Equal(Accessibility.Friend, q.RawLazyDeclaredAccessibilityOfMostAccessibleDescendantType)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (3)
1532Assert.Equal(Accessibility.NotApplicable, aliasSymbol.DeclaredAccessibility) 1942AssertEx.Equal(Of Accessibility)(Accessibility.NotApplicable, symLabel.DeclaredAccessibility)
Semantics\BinaryOperators.vb (1)
1268Assert.Equal(Accessibility.Public, symbol1.DeclaredAccessibility)
Semantics\UnaryOperators.vb (1)
779Assert.Equal(Accessibility.Public, symbol1.DeclaredAccessibility)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (240)
SymbolsTests\AnonymousTypes\AnonymousTypesEmittedSymbolsTests.vb (10)
380CheckMethod(m, constr, ".ctor", Accessibility.Public, isSub:=True, paramCount:=3) 416CheckMethod(m, toStr, "ToString", Accessibility.Public, 478CheckMethod(m, method, "Equals", Accessibility.Public, 513CheckMethod(m, method, "GetHashCode", Accessibility.Public, 553CheckMethod(m, method, "Equals", Accessibility.Public, 656Assert.Equal(Accessibility.Public, prop.DeclaredAccessibility) 671Accessibility.Public, 677Accessibility.Public, 690Assert.Equal(Accessibility.Private, field.DeclaredAccessibility) 699name As String, accessibility As Accessibility,
SymbolsTests\AssemblyAndNamespaceTests.vb (6)
47Assert.Equal(Accessibility.NotApplicable, sym.DeclaredAccessibility) 75Assert.Equal(Accessibility.NotApplicable, sym.DeclaredAccessibility) 111Assert.Equal(Accessibility.Friend, sym1.DeclaredAccessibility) 124Assert.Equal(Accessibility.Private, sym2.DeclaredAccessibility) 130Assert.Equal(Accessibility.Public, sym3.DeclaredAccessibility) 131Assert.Equal(Accessibility.Public, sym4.DeclaredAccessibility)
SymbolsTests\CompilationCreationTests.vb (4)
1867Assert.Equal(Accessibility.[Public], foo2.DeclaredAccessibility) 1883Assert.Equal(Accessibility.Friend, foo3.DeclaredAccessibility) 1904Assert.Equal(Accessibility.[Public], type3.DeclaredAccessibility) 1905Assert.Equal(Accessibility.Friend, typeC302.DeclaredAccessibility)
SymbolsTests\Metadata\MetadataMemberTests.vb (5)
169Assert.Equal(Accessibility.Protected, ctor.DeclaredAccessibility) 215Assert.Equal(Accessibility.Public, member1.DeclaredAccessibility) 274Assert.Equal(Accessibility.NotApplicable, p1.DeclaredAccessibility) ' chk C# 331Assert.Equal(Accessibility.Public, member2.DeclaredAccessibility) 385Assert.Equal(Accessibility.NotApplicable, p1.DeclaredAccessibility)
SymbolsTests\Metadata\MetadataTypeTests.vb (7)
45Assert.Equal(Accessibility.Public, ns.DeclaredAccessibility) 122Assert.Equal(Accessibility.Friend, class1.DeclaredAccessibility) 175Assert.Equal(Accessibility.Public, type1.DeclaredAccessibility) 230Assert.Equal(Accessibility.Public, type1.DeclaredAccessibility) 283Assert.Equal(Accessibility.Public, type1.DeclaredAccessibility) 333Assert.Equal(Accessibility.NotApplicable, type2.DeclaredAccessibility) 334Assert.Equal(Accessibility.NotApplicable, type3.DeclaredAccessibility)
SymbolsTests\Metadata\PE\LoadingFields.vb (5)
51Assert.Equal(Accessibility.Public, f1.DeclaredAccessibility) 60Assert.Equal(Accessibility.Protected, f2.DeclaredAccessibility) 67Assert.Equal(Accessibility.Friend, f3.DeclaredAccessibility) 74Assert.Equal(Accessibility.ProtectedOrFriend, f4.DeclaredAccessibility) 81Assert.Equal(Accessibility.Protected, f5.DeclaredAccessibility)
SymbolsTests\Metadata\PE\LoadingGenericTypeParameters.vb (1)
51Assert.Equal(Accessibility.NotApplicable, C1_T.DeclaredAccessibility)
SymbolsTests\Metadata\PE\LoadingMethods.vb (6)
54Assert.Equal(Accessibility.Public, (M1.DeclaredAccessibility)) 60Assert.Equal(Accessibility.Protected, (M2.DeclaredAccessibility)) 68Assert.Equal(Accessibility.NotApplicable, m1_1.DeclaredAccessibility) 77Assert.Equal(Accessibility.Protected, (M3.DeclaredAccessibility)) 81Assert.Equal(Accessibility.Friend, (M4.DeclaredAccessibility)) 85Assert.Equal(Accessibility.ProtectedOrFriend, (M5.DeclaredAccessibility))
SymbolsTests\Metadata\PE\TypeAccessibility.vb (6)
35Assert.Equal(Accessibility.Public, obj.DeclaredAccessibility) 40Assert.Equal(Accessibility.Friend, fxAssembly.DeclaredAccessibility) 51Assert.Equal(Accessibility.Friend, ControlKeyState.DeclaredAccessibility) 59Assert.Equal(Accessibility.Public, ContextForm.DeclaredAccessibility) 79Assert.Equal(Accessibility.Protected, SerializedArg.DeclaredAccessibility) 95Assert.Equal(Accessibility.ProtectedOrFriend, ExceptionFromErrorCode.DeclaredAccessibility)
SymbolsTests\Metadata\WinMdTypeTests.vb (1)
46Assert.Equal(value.DeclaredAccessibility, Accessibility.Public)
SymbolsTests\Retargeting\RetargetCustomModifiers.vb (1)
129Assert.Equal(Accessibility.[Public], volatileFld.DeclaredAccessibility)
SymbolsTests\Source\EnumTests.vb (1)
1376Assert.Equal(field.DeclaredAccessibility, Accessibility.Public)
SymbolsTests\Source\FieldTests.vb (9)
110Assert.Equal(Accessibility.Public, fieldP.DeclaredAccessibility) 118Assert.Equal(Accessibility.Public, fieldQ.DeclaredAccessibility) 125Assert.Equal(Accessibility.Private, fieldR.DeclaredAccessibility) 132Assert.Equal(Accessibility.Protected, fieldS.DeclaredAccessibility) 139Assert.Equal(Accessibility.Public, fieldT.DeclaredAccessibility) 146Assert.Equal(Accessibility.ProtectedOrFriend, fieldU.DeclaredAccessibility) 155Assert.Equal(Accessibility.Friend, fieldV.DeclaredAccessibility) 169Assert.Equal(Accessibility.Friend, fieldL.DeclaredAccessibility) 215Assert.Equal(Accessibility.Private, fieldC.DeclaredAccessibility)
SymbolsTests\Source\ImplementsTests.vb (1)
3894Assert.Equal(Accessibility.Private, m1_stub.DeclaredAccessibility)
SymbolsTests\Source\MethodTests.vb (46)
68Assert.Equal(Accessibility.Public, ctor.DeclaredAccessibility) 87Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility) 102Assert.Equal(Accessibility.Protected, m2.DeclaredAccessibility) 113Assert.Equal(Accessibility.Friend, m3.DeclaredAccessibility) 124Assert.Equal(Accessibility.ProtectedOrFriend, m4.DeclaredAccessibility) 134Assert.Equal(Accessibility.Protected, m5.DeclaredAccessibility) 144Assert.Equal(Accessibility.Friend, m6.DeclaredAccessibility) 195Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility) 244Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility) 263Assert.Equal(Accessibility.Friend, m2.DeclaredAccessibility) 317Assert.Equal(Accessibility.Private, m1.DeclaredAccessibility) 337Assert.Equal(Accessibility.Private, m2.DeclaredAccessibility) 390Assert.Equal(Accessibility.Public, m1.DeclaredAccessibility) 415Assert.Equal(Accessibility.Protected, m2.DeclaredAccessibility) 980Assert.Equal(Accessibility.Public, mem1.DeclaredAccessibility) 986Assert.Equal(Accessibility.Public, mem2.DeclaredAccessibility) 1074Assert.Equal(Accessibility.Friend, typemem.DeclaredAccessibility) 1076Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1078Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1082Assert.Equal(Accessibility.Friend, typemem.DeclaredAccessibility) 1084Assert.Equal(Accessibility.Private, mem.DeclaredAccessibility) 1086Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1088Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1090Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1092Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1094Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1096Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1102Assert.Equal(Accessibility.Friend, typemem.DeclaredAccessibility) 1104Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) ' private is better but Dev10 is public 1106Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1108Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1110Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1112Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1114Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1116Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1122Assert.Equal(Accessibility.Friend, typemem.DeclaredAccessibility) 1124Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1126Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1129Assert.Equal(Accessibility.Friend, typemem.DeclaredAccessibility) 1131Assert.Equal(Accessibility.Private, mem.DeclaredAccessibility) 1133Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1135Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1138Assert.Equal(Accessibility.Friend, typemem.DeclaredAccessibility) 1140Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) ' private is better but Dev10 is public 1142Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility) 1144Assert.Equal(Accessibility.Public, mem.DeclaredAccessibility)
SymbolsTests\Source\NamespaceGlobalTests.vb (3)
490Assert.Equal(Accessibility.Public, symbolC1(0).DeclaredAccessibility) 491Assert.Equal(Accessibility.Private, symbolC2(0).DeclaredAccessibility) 492Assert.Equal(Accessibility.Friend, symbolC3(0).DeclaredAccessibility)
SymbolsTests\Source\OperatorsTests.vb (3)
189Assert.Equal(Accessibility.Public, op.DeclaredAccessibility) 387Assert.Equal(Accessibility.Public, op.DeclaredAccessibility) 546Assert.Equal(Accessibility.Public, op.DeclaredAccessibility)
SymbolsTests\Source\PropertyTests.vb (91)
699VerifyProperty(type, "P", Accessibility.Public, isFromSource, hasGet:=True, hasSet:=True, hasField:=False) 700VerifyProperty(type, "Q", Accessibility.Public, isFromSource, hasGet:=True, hasSet:=False, hasField:=False) 701VerifyProperty(type, "R", Accessibility.Public, isFromSource, hasGet:=False, hasSet:=True, hasField:=False) 704VerifyProperty(type, "P", Accessibility.Public, isFromSource, hasGet:=True, hasSet:=True, hasField:=False) 705VerifyProperty(type, "Q", Accessibility.Public, isFromSource, hasGet:=True, hasSet:=False, hasField:=False) 706VerifyProperty(type, "R", Accessibility.Public, isFromSource, hasGet:=False, hasSet:=True, hasField:=False) 709VerifyProperty(type, "P", Accessibility.Public, isFromSource, hasGet:=True, hasSet:=True, hasField:=True) 710VerifyProperty(type, "Q", Accessibility.Public, isFromSource, hasGet:=True, hasSet:=False, hasField:=False) 711VerifyProperty(type, "R", Accessibility.Public, isFromSource, hasGet:=False, hasSet:=True, hasField:=False) 716Private Sub VerifyProperty(type As NamedTypeSymbol, name As String, declaredAccessibility As Accessibility, isFromSource As Boolean, hasGet As Boolean, hasSet As Boolean, hasField As Boolean) 740Assert.Equal(field.DeclaredAccessibility, Accessibility.Private) 1252VerifyAutoProperty(type, "P", Accessibility.Protected, isFromSource) 1253VerifyAutoProperty(type, "Q", Accessibility.Friend, isFromSource) 4512Dim privateOrNotApplicable = If(isFromSource, Accessibility.Private, Accessibility.NotApplicable) 4513CheckPropertyAccessibility(p1, Accessibility.Public, Accessibility.Public, Accessibility.Public) 4514CheckPropertyAccessibility(p2, Accessibility.Friend, Accessibility.Friend, Accessibility.NotApplicable) 4515CheckPropertyAccessibility(p3, Accessibility.ProtectedOrFriend, Accessibility.ProtectedOrFriend, Accessibility.NotApplicable) 4516CheckPropertyAccessibility(p4, Accessibility.Protected, Accessibility.Protected, Accessibility.NotApplicable) 4517CheckPropertyAccessibility(p10, Accessibility.ProtectedOrFriend, Accessibility.Protected, Accessibility.ProtectedOrFriend) 4518CheckPropertyAccessibility(p11, Accessibility.ProtectedOrFriend, Accessibility.Friend, Accessibility.ProtectedOrFriend) 4522CheckPropertyAccessibility(p5, Accessibility.Private, Accessibility.NotApplicable, Accessibility.Private) 4523CheckPropertyAccessibility(p6, Accessibility.Public, Accessibility.Public, Accessibility.NotApplicable) 4526CheckPropertyAccessibility(p7, Accessibility.Public, privateOrNotApplicable, Accessibility.Public) 4527CheckPropertyAccessibility(p8, Accessibility.Friend, Accessibility.Friend, privateOrNotApplicable) 4528CheckPropertyAccessibility(p9, Accessibility.Protected, Accessibility.Protected, privateOrNotApplicable) 4705Accessibility.ProtectedOrFriend, 4706Accessibility.[Protected], 4707Accessibility.[Friend]) 4710Accessibility.ProtectedOrFriend, 4711Accessibility.[Protected], 4712Accessibility.ProtectedOrFriend) 4715Accessibility.[Protected], 4716Accessibility.[Protected], 4717Accessibility.ProtectedAndFriend) 4720Accessibility.ProtectedOrFriend, 4721Accessibility.[Friend], 4722Accessibility.ProtectedOrFriend) 4725Accessibility.[Friend], 4726Accessibility.[Friend], 4727Accessibility.ProtectedAndFriend) 4730Accessibility.ProtectedOrFriend, 4731Accessibility.ProtectedOrFriend, 4732Accessibility.ProtectedOrFriend) 4735Accessibility.ProtectedOrFriend, 4736Accessibility.ProtectedOrFriend, 4737Accessibility.ProtectedAndFriend) 4740Accessibility.ProtectedAndFriend, 4741Accessibility.ProtectedAndFriend, 4742Accessibility.ProtectedAndFriend) 4745Accessibility.ProtectedAndFriend, 4746Accessibility.ProtectedAndFriend, 4747Accessibility.NotApplicable) 4750Accessibility.ProtectedOrFriend, 4751Accessibility.NotApplicable, 4752Accessibility.ProtectedOrFriend) 4755Accessibility.ProtectedOrFriend, 4756Accessibility.ProtectedAndFriend, 4757Accessibility.ProtectedOrFriend) 8116Private Shared Sub CheckPropertyAccessibility([property] As PropertySymbol, propertyAccessibility As Accessibility, getterAccessibility As Accessibility, setterAccessibility As Accessibility) 8124Private Shared Sub CheckPropertyAccessorAccessibility([property] As PropertySymbol, propertyAccessibility As Accessibility, accessor As MethodSymbol, accessorAccessibility As Accessibility) 8126Assert.Equal(accessorAccessibility, Accessibility.NotApplicable) 8138Private Shared Sub VerifyAutoProperty(type As NamedTypeSymbol, name As String, declaredAccessibility As Accessibility, isFromSource As Boolean) 8150Assert.Equal(field.DeclaredAccessibility, Accessibility.Private) 8220Private Shared Sub VerifyAccessibility([property] As PEPropertySymbol, propertyAccessibility As Accessibility, getAccessibility As Accessibility, setAccessibility As Accessibility) 8226Private Shared Sub VerifyAccessorAccessibility(accessor As MethodSymbol, accessorAccessibility As Accessibility) 8227If accessorAccessibility = Accessibility.NotApplicable Then
SymbolsTests\Source\TypeTests.vb (26)
94Assert.Equal(Accessibility.Friend, ifaceA.DeclaredAccessibility) 112Assert.Equal(Accessibility.Public, classB.DeclaredAccessibility) 129Assert.Equal(Accessibility.Friend, delegateB.DeclaredAccessibility) 150Assert.Equal(Accessibility.Friend, enumE.DeclaredAccessibility) 165Assert.Equal(Accessibility.Friend, structI.DeclaredAccessibility) 180Assert.Equal(Accessibility.Friend, moduleM.DeclaredAccessibility) 242Assert.Equal(Accessibility.Public, outerClass.DeclaredAccessibility) 258Assert.Equal(Accessibility.Private, i1Class.DeclaredAccessibility) 268Assert.Equal(Accessibility.ProtectedOrFriend, i3Interface.DeclaredAccessibility) 278Assert.Equal(Accessibility.Public, i4Enum.DeclaredAccessibility) 292Assert.Equal(Accessibility.Protected, i2Arity1.DeclaredAccessibility) 306Assert.Equal(Accessibility.Protected, i2Arity2.DeclaredAccessibility) 348Assert.Equal(Accessibility.NotApplicable, sym1.DeclaredAccessibility) 555Assert.Equal(Accessibility.Public, enumE.DeclaredAccessibility) 608Assert.Equal(Accessibility.Friend, classA.DeclaredAccessibility) 618Assert.Equal(Accessibility.Public, igoo.DeclaredAccessibility) 628Assert.Equal(Accessibility.Public, structS.DeclaredAccessibility) 659Assert.Equal(Accessibility.NotApplicable, typeParams(0).DeclaredAccessibility) 664Assert.Equal(Accessibility.NotApplicable, typeParams(1).DeclaredAccessibility) 669Assert.Equal(Accessibility.NotApplicable, typeParams(2).DeclaredAccessibility) 735Assert.Equal(Accessibility.Private, mem1.DeclaredAccessibility) 743Assert.Equal(Accessibility.Public, mem2.DeclaredAccessibility) 753Assert.Equal(Accessibility.Public, mem3.DeclaredAccessibility) 811Assert.Equal(Accessibility.Friend, type1.DeclaredAccessibility) ' NOTE: for erroneous symbols we return 'best guess' 813Assert.Equal(Accessibility.Friend, type1.DeclaredAccessibility) ' NOTE: for erroneous symbols we return 'best guess' 815Assert.Equal(Accessibility.Friend, type1.DeclaredAccessibility) ' NOTE: for erroneous symbols we return 'best guess'
SymbolsTests\SymbolErrorTests.vb (2)
20999Assert.Equal(Accessibility.Public, sym.DeclaredAccessibility) 22495Assert.Equal(Accessibility.Public, errTypeSym.DeclaredAccessibility)
SymbolsTests\WellKnownTypeValidationTests.vb (6)
40Assert.Equal(Accessibility.Public, special.DeclaredAccessibility) 45Assert.Equal(Accessibility.Internal, lookup.DeclaredAccessibility) 161Assert.Equal(Accessibility.Internal, wellKnown.DeclaredAccessibility) 164Assert.Equal(Accessibility.Public, wellKnown.DeclaredAccessibility) 169Assert.Equal(Accessibility.Internal, lookup.DeclaredAccessibility) 417Assert.Equal(Accessibility.Public, wellKnown.DeclaredAccessibility)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (5)
MockSymbols.vb (5)
94Friend Overrides ReadOnly Property DeclaredAccessibilityOfMostAccessibleDescendantType As Accessibility 191Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 193Return Accessibility.Public 434Public Overrides ReadOnly Property DeclaredAccessibility As Accessibility 436Return Accessibility.Public
Microsoft.CodeAnalysis.VisualBasic.Workspaces (105)
CodeGeneration\VisualBasicSyntaxGenerator.vb (38)
677Public Overrides Function FieldDeclaration(name As String, type As SyntaxNode, Optional accessibility As Accessibility = Nothing, Optional modifiers As DeclarationModifiers = Nothing, Optional initializer As SyntaxNode = Nothing) As SyntaxNode 690accessibility As Accessibility, 720Optional accessibility As Accessibility = Accessibility.NotApplicable, 727Private Protected Overrides Function OperatorDeclaration(operatorName As String, isImplicitConversion As Boolean, Optional parameters As IEnumerable(Of SyntaxNode) = Nothing, Optional returnType As SyntaxNode = Nothing, Optional accessibility As Accessibility = Accessibility.NotApplicable, Optional modifiers As DeclarationModifiers = Nothing, Optional statements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 852Public Overrides Function GetAccessorDeclaration(Optional accessibility As Accessibility = Accessibility.NotApplicable, Optional statements As IEnumerable(Of SyntaxNode) = Nothing) As SyntaxNode 858Private Protected Overrides Function SetAccessorDeclaration(accessibility As Accessibility, isInitOnly As Boolean, statements As IEnumerable(Of SyntaxNode)) As SyntaxNode 906Optional accessibility As Accessibility = Nothing, 925accessibility As Accessibility, 956Optional accessibility As Accessibility = Nothing, 1044declaration = WithAccessibility(declaration, Accessibility.Public) 1061declaration = WithAccessibility(declaration, Accessibility.Private) 1170Dim access As Accessibility 1180Dim access As Accessibility 1196Optional accessibility As Accessibility = Nothing, 1234accessibility As Accessibility, 1272accessibility As Accessibility, 1296accessibility As Accessibility, 1353Optional accessibility As Accessibility = Nothing, 1362Optional accessibility As Accessibility = Accessibility.NotApplicable, 1415accessibility As Accessibility, 2406Dim acc As Accessibility 2413Private Shared Sub GetAccessibilityAndModifiers(modifierTokens As SyntaxTokenList, ByRef accessibility As Accessibility, ByRef modifiers As DeclarationModifiers, ByRef isDefault As Boolean) 2428Dim acc As Accessibility 2508Public Overrides Function GetAccessibility(declaration As SyntaxNode) As Accessibility 2512Public Overrides Function WithAccessibility(declaration As SyntaxNode, accessibility As Accessibility) As SyntaxNode 2514accessibility <> Accessibility.NotApplicable Then 2525Private Function WithAccessibilityInternal(declaration As SyntaxNode, accessibility As Accessibility) As SyntaxNode 2531Dim currentAcc As Accessibility 2543If declaration.Kind = SyntaxKind.FieldDeclaration AndAlso accessibility = Accessibility.NotApplicable AndAlso newTokens.Count = 0 Then 2551Friend Shared Function GetModifierList(accessibility As Accessibility, modifiers As DeclarationModifiers, declaration As SyntaxNode, kind As DeclarationKind, Optional isDefault As Boolean = False) As SyntaxTokenList 3211Public Overrides Function EventDeclaration(name As String, type As SyntaxNode, Optional accessibility As Accessibility = Accessibility.NotApplicable, Optional modifiers As DeclarationModifiers = Nothing) As SyntaxNode 3225Optional accessibility As Accessibility = Accessibility.NotApplicable,
FindSymbols\VisualBasicDeclaredSymbolInfoFactoryService.vb (11)
262Accessibility.Public, 405Private Shared Function GetAccessibility(container As SyntaxNode, node As StatementSyntax, modifiers As SyntaxTokenList) As Accessibility 410Case SyntaxKind.PublicKeyword : Return Accessibility.Public 411Case SyntaxKind.PrivateKeyword : Return Accessibility.Private 412Case SyntaxKind.ProtectedKeyword : Return Accessibility.Protected 420Return Accessibility.Internal 429Return Accessibility.Private 434Return Accessibility.Private 437Return Accessibility.Public 440Return Accessibility.Public 444Return Accessibility.Internal
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (3)
98cancellationToken As CancellationToken) As Accessibility 100Return Accessibility.Private 164Return Accessibility.Private
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicAccessibilityFacts.vb (17)
90Public Function GetAccessibility(declaration As SyntaxNode) As Accessibility Implements IAccessibilityFacts.GetAccessibility 92Return Accessibility.NotApplicable 96Dim acc As Accessibility 185Public Shared Sub GetAccessibilityAndModifiers(modifierTokens As SyntaxTokenList, ByRef accessibility As Accessibility, ByRef modifiers As DeclarationModifiers, ByRef isDefault As Boolean) 186accessibility = Accessibility.NotApplicable 195accessibility = Accessibility.Public 197If accessibility = Accessibility.Protected Then 198accessibility = Accessibility.ProtectedAndFriend 200accessibility = Accessibility.Private 203If accessibility = Accessibility.Protected Then 204accessibility = Accessibility.ProtectedOrFriend 206accessibility = Accessibility.Friend 209If accessibility = Accessibility.Friend Then 210accessibility = Accessibility.ProtectedOrFriend 211ElseIf accessibility = Accessibility.Private Then 212accessibility = Accessibility.ProtectedAndFriend 214accessibility = Accessibility.Protected
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ConstructorGenerator.vb (1)
88AddAccessibilityModifiers(constructor.DeclaredAccessibility, tokens, destination, options, Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EventGenerator.vb (1)
170AddAccessibilityModifiers([event].DeclaredAccessibility, tokens, destination, options, Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\FieldGenerator.vb (1)
109AddAccessibilityModifiers(field.DeclaredAccessibility, tokens, destination, options, Accessibility.Private)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\MethodGenerator.vb (1)
147AddAccessibilityModifiers(method.DeclaredAccessibility, result, destination, options, Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (7)
168Case Accessibility.Public 170Case Accessibility.Protected 172Case Accessibility.Private 174Case Accessibility.Internal 176Case Accessibility.ProtectedAndInternal 179Case Accessibility.ProtectedOrInternal 182Case Accessibility.Internal
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (3)
160If accessor.DeclaredAccessibility = Accessibility.NotApplicable OrElse 168AddAccessibilityModifiers(accessor.DeclaredAccessibility, modifiers, destination, options, Accessibility.Public) 189AddAccessibilityModifiers([property].DeclaredAccessibility, tokens, destination, options, Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationHelpers.vb (9)
16accessibility As Accessibility, 20nonStructureAccessibility As Accessibility) 22If destination = CodeGenerationDestination.StructType AndAlso accessibility = Accessibility.Public Then 32Case Accessibility.Public 35Case Accessibility.Protected 38Case Accessibility.Private 41Case Accessibility.Internal 44Case Accessibility.ProtectedAndInternal 48Case Accessibility.ProtectedOrInternal
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (3)
641Public Overrides Function UpdateDeclarationAccessibility(Of TDeclarationNode As SyntaxNode)(declaration As TDeclarationNode, newAccessibility As Accessibility, options As VisualBasicCodeGenerationContextInfo, cancellationToken As CancellationToken) As TDeclarationNode 649Private Overloads Shared Function UpdateDeclarationAccessibility(modifiersList As SyntaxTokenList, newAccessibility As Accessibility, options As VisualBasicCodeGenerationContextInfo) As SyntaxTokenList 652AddAccessibilityModifiers(newAccessibility, newModifierTokens, CodeGenerationDestination.Unspecified, options, Accessibility.NotApplicable)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (10)
177Optional accessibility As Accessibility = Accessibility.NotApplicable, 364Friend Shared Function GetModifierList(accessibility As Accessibility, modifiers As DeclarationModifiers, declaration As SyntaxNode, kind As DeclarationKind, Optional isDefault As Boolean = False) As SyntaxTokenList 378Case Accessibility.Internal 380Case Accessibility.Public 382Case Accessibility.Private 384Case Accessibility.Protected 386Case Accessibility.ProtectedOrInternal 388Case Accessibility.ProtectedAndInternal 390Case Accessibility.NotApplicable
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (128)
CodeGeneration\SyntaxGeneratorTests.vb (128)
836Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), accessibility:=Accessibility.Public), 878Generator.MethodDeclaration("m", returnType:=Generator.IdentifierName("x"), accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.None), 883Generator.MethodDeclaration("m", returnType:=Generator.IdentifierName("x"), accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.Abstract), 887Generator.MethodDeclaration("m", accessibility:=Accessibility.Private, modifiers:=DeclarationModifiers.Partial), 1181Generator.GetAccessorDeclaration(Accessibility.NotApplicable, {Generator.ReturnStatement()})), 1191Generator.GetAccessorDeclaration(Accessibility.NotApplicable, {Generator.ReturnStatement()}), 1192Generator.SetAccessorDeclaration(Accessibility.NotApplicable, {Generator.ReturnStatement()})), 1206Generator.GetAccessorDeclaration(Accessibility.Protected, {Generator.ReturnStatement()})), 1216Generator.SetAccessorDeclaration(Accessibility.Protected, {Generator.ReturnStatement()})), 1229Generator.GetAccessorDeclaration(Accessibility.Protected, {Generator.ReturnStatement()})), 1239Generator.SetAccessorDeclaration(Accessibility.Protected, {Generator.ReturnStatement()})), 1337Generator.EventDeclaration("ev", Generator.IdentifierName("t"), accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.Static), 1377Generator.ConstructorDeclaration("c", accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.Static), 1408Generator.ClassDeclaration("c", accessibility:=Accessibility.Public), 1461Generator.StructDeclaration("s", accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.Partial), 1501members:={Generator.ConstructorDeclaration(accessibility:=Accessibility.NotApplicable, modifiers:=DeclarationModifiers.None)}), 1541Generator.InterfaceDeclaration("i", members:={Generator.MethodDeclaration("m", returnType:=Generator.IdentifierName("t"), accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.Sealed)}), 1549Generator.InterfaceDeclaration("i", members:={Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.Sealed)}), 1557Generator.InterfaceDeclaration("i", members:={Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.ReadOnly)}), 1565Generator.InterfaceDeclaration("i", members:={Generator.IndexerDeclaration({Generator.ParameterDeclaration("y", Generator.IdentifierName("x"))}, Generator.IdentifierName("t"), Accessibility.Public, DeclarationModifiers.Sealed)}), 1573Generator.InterfaceDeclaration("i", members:={Generator.IndexerDeclaration({Generator.ParameterDeclaration("y", Generator.IdentifierName("x"))}, Generator.IdentifierName("t"), Accessibility.Public, DeclarationModifiers.ReadOnly)}), 1647Generator.DelegateDeclaration("d", accessibility:=Accessibility.Public), 1769Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility:=Accessibility.Private, modifiers:=DeclarationModifiers.Abstract), 1781Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility:=Accessibility.Private, modifiers:=DeclarationModifiers.None), 1793Generator.IndexerDeclaration({Generator.ParameterDeclaration("p", Generator.IdentifierName("a"))}, Generator.IdentifierName("t"), Accessibility.Internal, DeclarationModifiers.Abstract), 1823Generator.MethodDeclaration("m", returnType:=Generator.IdentifierName("t"), accessibility:=Accessibility.Private, modifiers:=DeclarationModifiers.Abstract), 1830Generator.MethodDeclaration("m", returnType:=Generator.IdentifierName("t"), accessibility:=Accessibility.Private, modifiers:=DeclarationModifiers.Abstract), 1837Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility:=Accessibility.Internal, modifiers:=DeclarationModifiers.Abstract), 1849Generator.IndexerDeclaration({Generator.ParameterDeclaration("p", Generator.IdentifierName("a"))}, Generator.IdentifierName("t"), Accessibility.Protected, DeclarationModifiers.Abstract), 2641Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.ClassDeclaration("c", accessibility:=Accessibility.Internal))) 2642Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.StructDeclaration("s", accessibility:=Accessibility.Internal))) 2643Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.InterfaceDeclaration("i", accessibility:=Accessibility.Internal))) 2644Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.EnumDeclaration("e", accessibility:=Accessibility.Internal))) 2645Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.DelegateDeclaration("d", accessibility:=Accessibility.Internal))) 2646Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.MethodDeclaration("m", accessibility:=Accessibility.Internal))) 2647Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.ConstructorDeclaration(accessibility:=Accessibility.Internal))) 2648Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.ParameterDeclaration("p"))) 2649Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility:=Accessibility.Internal))) 2650Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.IndexerDeclaration({Generator.ParameterDeclaration("i")}, Generator.IdentifierName("t"), accessibility:=Accessibility.Internal))) 2651Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.FieldDeclaration("f", Generator.IdentifierName("t"), accessibility:=Accessibility.Internal))) 2652Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.EnumMember("v"))) 2653Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.EventDeclaration("ef", Generator.IdentifierName("t"), accessibility:=Accessibility.Internal))) 2654Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), accessibility:=Accessibility.Internal))) 2655Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.NamespaceDeclaration("n"))) 2656Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.NamespaceImportDeclaration("u"))) 2657Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc"))) 2658Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.Attribute("a"))) 2659Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(SyntaxFactory.TypeParameter("tp"))) 2664Assert.Equal(Accessibility.Public, Generator.GetAccessibility(m)) 2669Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ClassDeclaration("c", accessibility:=Accessibility.Internal), Accessibility.Private))) 2670Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.StructDeclaration("s", accessibility:=Accessibility.Internal), Accessibility.Private))) 2671Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EnumDeclaration("i", accessibility:=Accessibility.Internal), Accessibility.Private))) 2672Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EnumDeclaration("e", accessibility:=Accessibility.Internal), Accessibility.Private))) 2673Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.DelegateDeclaration("d", accessibility:=Accessibility.Internal), Accessibility.Private))) 2674Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.MethodDeclaration("m", accessibility:=Accessibility.Internal), Accessibility.Private))) 2675Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ConstructorDeclaration(accessibility:=Accessibility.Internal), Accessibility.Private))) 2676Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.ParameterDeclaration("p"), Accessibility.Private))) 2677Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility:=Accessibility.Internal), Accessibility.Private))) 2678Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.IndexerDeclaration({Generator.ParameterDeclaration("i")}, Generator.IdentifierName("t"), accessibility:=Accessibility.Internal), Accessibility.Private))) 2679Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.FieldDeclaration("f", Generator.IdentifierName("t"), accessibility:=Accessibility.Internal), Accessibility.Private))) 2680Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EnumMember("v"), Accessibility.Private))) 2681Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.EventDeclaration("ef", Generator.IdentifierName("t"), accessibility:=Accessibility.Internal), Accessibility.Private))) 2682Assert.Equal(Accessibility.Private, Generator.GetAccessibility(Generator.WithAccessibility(Generator.CustomEventDeclaration("ep", Generator.IdentifierName("t"), accessibility:=Accessibility.Internal), Accessibility.Private))) 2683Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.NamespaceDeclaration("n"), Accessibility.Private))) 2684Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.NamespaceImportDeclaration("u"), Accessibility.Private))) 2685Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.LocalDeclarationStatement(Generator.IdentifierName("t"), "loc"), Accessibility.Private))) 2686Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(Generator.Attribute("a"), Accessibility.Private))) 2687Assert.Equal(Accessibility.NotApplicable, Generator.GetAccessibility(Generator.WithAccessibility(SyntaxFactory.TypeParameter("tp"), Accessibility.Private))) 2692Assert.Equal(Accessibility.Internal, Generator.GetAccessibility(Generator.WithAccessibility(m, Accessibility.Internal))) 3066Assert.Equal(Accessibility.NotApplicable, _g.GetAccessibility(getAccessor)) 3071Assert.Equal(Accessibility.NotApplicable, _g.GetAccessibility(setAccessor)) 3078Assert.Equal(Accessibility.Public, _g.GetAccessibility(_g.WithAccessibility(getAccessor, Accessibility.Public))) 3079Assert.Equal(Accessibility.Private, _g.GetAccessibility(_g.WithAccessibility(setAccessor, Accessibility.Private))) 3091Dim newProp = _g.ReplaceNode(prop, getAccessor, _g.WithAccessibility(getAccessor, Accessibility.Public)) 3092Assert.Equal(Accessibility.Public, _g.GetAccessibility(_g.GetAccessor(newProp, DeclarationKind.GetAccessor))) 3094newProp = _g.ReplaceNode(prop, setAccessor, _g.WithAccessibility(setAccessor, Accessibility.Public)) 3095Assert.Equal(Accessibility.Public, _g.GetAccessibility(_g.GetAccessor(newProp, DeclarationKind.SetAccessor))) 3490Assert.Equal(Accessibility.Public, Generator.GetAccessibility(declX)) 3496Assert.Equal(Accessibility.Public, Generator.GetAccessibility(declY)) 3502Assert.Equal(Accessibility.Public, Generator.GetAccessibility(declZ)) 3520Dim xPrivate = Generator.WithAccessibility(declX, Accessibility.Private) 3523Assert.Equal(Accessibility.Private, Generator.GetAccessibility(xPrivate))
Microsoft.CodeAnalysis.Workspaces (236)
Editing\SyntaxEditorExtensions.cs (1)
13public static void SetAccessibility(this SyntaxEditor editor, SyntaxNode declaration, Accessibility accessibility)
Editing\SyntaxGenerator.cs (48)
124Accessibility accessibility = Accessibility.NotApplicable, 165Accessibility accessibility = Accessibility.NotApplicable, 179Accessibility accessibility, 259Accessibility accessibility = Accessibility.NotApplicable, 271Accessibility accessibility = Accessibility.NotApplicable, 355Accessibility accessibility = Accessibility.NotApplicable, 368var propertyAccessibility = property.DeclaredAccessibility; 377var getMethodAccessibility = getMethodSymbol.DeclaredAccessibility; 378getAccessor = GetAccessorDeclaration(getMethodAccessibility < propertyAccessibility ? getMethodAccessibility : Accessibility.NotApplicable, getAccessorStatements); 383var setMethodAccessibility = setMethodSymbol.DeclaredAccessibility; 385setMethodAccessibility < propertyAccessibility ? setMethodAccessibility : Accessibility.NotApplicable, 412Accessibility accessibility, 421Accessibility accessibility = Accessibility.NotApplicable, 425Accessibility accessibility = Accessibility.NotApplicable, 430Accessibility accessibility, bool isInitOnly, IEnumerable<SyntaxNode>? statements); 438Accessibility accessibility = Accessibility.NotApplicable, 484Accessibility accessibility = Accessibility.NotApplicable, 513Accessibility accessibility = Accessibility.NotApplicable, 546Accessibility accessibility = Accessibility.NotApplicable, 602Accessibility accessibility = Accessibility.NotApplicable, 616Accessibility accessibility, 628Accessibility accessibility = Accessibility.NotApplicable, 641Accessibility accessibility, 652Accessibility accessibility = Accessibility.NotApplicable, 663Accessibility accessibility, 672Accessibility accessibility = Accessibility.NotApplicable, 682Accessibility accessibility = Accessibility.NotApplicable, 699Accessibility accessibility = Accessibility.NotApplicable, 711Accessibility accessibility, 1216public abstract Accessibility GetAccessibility(SyntaxNode declaration); 1221public abstract SyntaxNode WithAccessibility(SyntaxNode declaration, Accessibility accessibility);
FindSymbols\SymbolFinder_Helpers.cs (4)
20var accessibility = symbol.DeclaredAccessibility; 21return accessibility is Accessibility.Public or 22Accessibility.Protected or 23Accessibility.ProtectedOrInternal;
FindSymbols\SymbolFinder_Hierarchy.cs (1)
129if (symbol is { DeclaredAccessibility: Accessibility.Public, ContainingType.TypeKind: TypeKind.Class or TypeKind.Struct })
FindSymbols\TopLevelSyntaxTree\DeclaredSymbolInfo.cs (4)
100public Accessibility Accessibility => GetAccessibility(_flags); 116Accessibility accessibility, 161private static Accessibility GetAccessibility(uint flags) 162=> (Accessibility)((flags >> 5) & Lower4BitMask);
LanguageServices\DeclaredSymbolFactoryService\AbstractDeclaredSymbolInfoFactoryService.cs (1)
315Accessibility.Public,
Rename\RenameUtilities.cs (1)
122if (symbol.DeclaredAccessibility != Accessibility.Private)
Shared\Extensions\ITypeSymbolExtensions.cs (1)
168where member.DeclaredAccessibility == Accessibility.Public &&
Shared\Extensions\SyntaxGeneratorExtensions.cs (4)
27accessibility: Accessibility.Public, 45var getAccessibility = overriddenProperty.GetMethod.ComputeResultantAccessibility(containingType); 46var setAccessibility = overriddenProperty.SetMethod.ComputeResultantAccessibility(containingType); 152if (overriddenProperty.SetMethod is { DeclaredAccessibility: not Accessibility.Private } &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\NamingStyles\NamingStyleOption.cs (1)
38EditorConfigOption<ImmutableArray<Accessibility>> Accessibilities,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AccessibilityUtilities.cs (19)
9public static Accessibility Minimum(Accessibility accessibility1, Accessibility accessibility2) 11if (accessibility1 == Accessibility.Private || accessibility2 == Accessibility.Private) 13return Accessibility.Private; 16if (accessibility1 == Accessibility.ProtectedAndInternal || accessibility2 == Accessibility.ProtectedAndInternal) 18return Accessibility.ProtectedAndInternal; 21if (accessibility1 == Accessibility.Protected || accessibility2 == Accessibility.Protected) 23return Accessibility.Protected; 26if (accessibility1 == Accessibility.Internal || accessibility2 == Accessibility.Internal) 28return Accessibility.Internal; 31if (accessibility1 == Accessibility.ProtectedOrInternal || accessibility2 == Accessibility.ProtectedOrInternal) 33return Accessibility.ProtectedOrInternal; 36return Accessibility.Public;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (3)
199m => m.DeclaredAccessibility is Accessibility.Public or Accessibility.Protected && 223return accessor != null && IsImplementable(accessor) && accessor.DeclaredAccessibility != Accessibility.Public;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (14)
55case Accessibility.NotApplicable: 56case Accessibility.Private: 61case Accessibility.Internal: 62case Accessibility.ProtectedAndInternal: 565public static Accessibility ComputeResultantAccessibility(this ISymbol? symbol, ITypeSymbol finalDestination) 569return Accessibility.Private; 576case Accessibility.ProtectedAndInternal: 578? Accessibility.ProtectedAndInternal 579: Accessibility.Internal; 580case Accessibility.ProtectedOrInternal: 582? Accessibility.ProtectedOrInternal 583: Accessibility.Protected; 718.Where(x => x.DeclaredAccessibility == Accessibility.Public) 758.Where(x => x.DeclaredAccessibility == Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (16)
211Accessibility declaredAccessibility, 220case Accessibility.NotApplicable: 221case Accessibility.Public: 225case Accessibility.Private: 226case Accessibility.Protected: 227case Accessibility.ProtectedAndInternal: 231case Accessibility.Internal: 232case Accessibility.ProtectedOrInternal: 246Accessibility declaredAccessibility, 268case Accessibility.NotApplicable: 275case Accessibility.Public: 279case Accessibility.Private: 292case Accessibility.Internal: 297case Accessibility.ProtectedAndInternal: 308case Accessibility.ProtectedOrInternal: 320case Accessibility.Protected:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
310public static Accessibility DetermineMinimalAccessibility(this ITypeSymbol typeSymbol) 700hasPrivateField |= fieldSymbol.DeclaredAccessibility == Accessibility.Private;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (14)
11private sealed class MinimalAccessibilityVisitor : SymbolVisitor<Accessibility> 13public static readonly SymbolVisitor<Accessibility> Instance = new MinimalAccessibilityVisitor(); 15public override Accessibility DefaultVisit(ISymbol node) 18public override Accessibility VisitAlias(IAliasSymbol symbol) 21public override Accessibility VisitArrayType(IArrayTypeSymbol symbol) 24public override Accessibility VisitDynamicType(IDynamicTypeSymbol symbol) 25=> Accessibility.Public; 27public override Accessibility VisitFunctionPointerType(IFunctionPointerTypeSymbol symbol) 29var accessibility = symbol.DeclaredAccessibility; 48public override Accessibility VisitNamedType(INamedTypeSymbol symbol) 50var accessibility = symbol.DeclaredAccessibility; 65public override Accessibility VisitPointerType(IPointerTypeSymbol symbol) 68public override Accessibility VisitTypeParameter(ITypeParameterSymbol symbol) 71return Accessibility.Public;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (28)
73(ImmutableArray<Accessibility> accessibilities, TData data), 208private static (ImmutableArray<Accessibility> accessibilities, TData data) GetSymbolsApplicableAccessibilities<T, TData>( 223private static readonly ImmutableArray<Accessibility> s_allAccessibility = 225Accessibility.NotApplicable, 226Accessibility.Public, 227Accessibility.Internal, 228Accessibility.Private, 229Accessibility.Protected, 230Accessibility.ProtectedAndInternal, 231Accessibility.ProtectedOrInternal, 234private static ImmutableArray<Accessibility> ParseAccessibilityKindList(string symbolSpecApplicableAccessibilities) 246var builder = ArrayBuilder<Accessibility>.GetInstance(); 252builder.Add(Accessibility.Public); 256builder.Add(Accessibility.Internal); 259builder.Add(Accessibility.Private); 262builder.Add(Accessibility.Protected); 266builder.Add(Accessibility.ProtectedOrInternal); 269builder.Add(Accessibility.ProtectedAndInternal); 272builder.Add(Accessibility.NotApplicable); 444public static string ToEditorConfigString(this ImmutableArray<Accessibility> accessibilities, string languageName) 459private static string ToEditorConfigString(this Accessibility accessibility, string languageName) 463case Accessibility.NotApplicable: 466case Accessibility.Private: 469case Accessibility.ProtectedAndInternal: 472case Accessibility.Protected: 475case Accessibility.Internal: 485case Accessibility.ProtectedOrInternal: 495case Accessibility.Public:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
84if (symbol.DeclaredAccessibility != Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (20)
32ImmutableArray<Accessibility> accessibilityList = default, 47public ImmutableArray<Accessibility> ApplicableAccessibilityList { get; } = accessibilityList.IsDefault ? DefaultSymbolSpecificationTemplate.ApplicableAccessibilityList : accessibilityList; 85Accessibility.NotApplicable, 86Accessibility.Public, 87Accessibility.Internal, 88Accessibility.Private, 89Accessibility.Protected, 90Accessibility.ProtectedAndInternal, 91Accessibility.ProtectedOrInternal, 101public bool AppliesTo(SymbolKind symbolKind, Accessibility accessibility) 104public bool AppliesTo(SymbolKindOrTypeKind kind, DeclarationModifiers modifiers, Accessibility? accessibility) 158private static Accessibility GetAccessibility(ISymbol symbol) 165return Accessibility.Public; 177return Accessibility.NotApplicable; 188return Accessibility.NotApplicable; 242reader.ReadArray(r => (Accessibility)r.ReadInt32()), 311private static ImmutableArray<Accessibility> GetAccessibilityListFromXElement(XElement accessibilityListElement) 314private static Accessibility ParseAccessibility(XElement accessibilityElement) 315=> (Accessibility)Enum.Parse(typeof(Accessibility), accessibilityElement.Value);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\IAccessibilityFacts.cs (1)
15Accessibility GetAccessibility(SyntaxNode declaration);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (1)
68(method2 == null || method2.DeclaredAccessibility != Accessibility.Public);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (2)
110public TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode 139public abstract TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, TCodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (20)
34ImmutableArray<AttributeData> attributes, Accessibility accessibility, 50Accessibility accessibility, 83ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, 109Accessibility accessibility, 126Accessibility accessibility, 155Accessibility accessibility, 178ImmutableArray<AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, 198Accessibility accessibility, 235accessibility: Accessibility.Public, 251Accessibility accessibility, 364Accessibility? accessibility = null, 389Accessibility accessibility, 421Accessibility accessibility, 440Accessibility accessibility, 466Accessibility accessibility, 477accessibility: Accessibility.Public, 518Accessibility? accessibility = null, 549Accessibility? accessibility = null, 576Accessibility? accessibility = null, 597Accessibility? accessibility = null,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (1)
114TDeclarationNode UpdateDeclarationAccessibility<TDeclarationNode>(TDeclarationNode declaration, Accessibility newAccessibility, CodeGenerationContextInfo info, CancellationToken cancellationToken) where TDeclarationNode : SyntaxNode;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractMethodSymbol.cs (1)
30Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
31Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (1)
10internal sealed class CodeGenerationArrayTypeSymbol(ITypeSymbol elementType, int rank, NullableAnnotation nullableAnnotation) : CodeGenerationTypeSymbol(null, null, default, Accessibility.NotApplicable, default, string.Empty, SpecialType.None, nullableAnnotation), IArrayTypeSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructorSymbol.cs (1)
20Accessibility accessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConversionSymbol.cs (1)
20Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationDestructorSymbol.cs (1)
15Accessibility.NotApplicable,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationEventSymbol.cs (1)
18Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationFieldSymbol.cs (1)
20Accessibility accessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
30Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (1)
31Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
23Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceSymbol.cs (1)
14internal sealed class CodeGenerationNamespaceSymbol(string name, IList<INamespaceOrTypeSymbol> members) : CodeGenerationNamespaceOrTypeSymbol(null, null, default, Accessibility.NotApplicable, default, name), INamespaceSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationOperatorSymbol.cs (1)
21Accessibility accessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationParameterSymbol.cs (1)
26object defaultValue) : CodeGenerationSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, new DeclarationModifiers(), name), IParameterSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (1)
9internal sealed class CodeGenerationPointerTypeSymbol(ITypeSymbol pointedAtType) : CodeGenerationTypeSymbol(null, null, default, Accessibility.NotApplicable, default, string.Empty, SpecialType.None, NullableAnnotation.None), IPointerTypeSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPropertySymbol.cs (1)
20Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (2)
29public Accessibility DeclaredAccessibility { get; } 38Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
24int ordinal) : CodeGenerationTypeSymbol(containingType?.ContainingAssembly, containingType, attributes, Accessibility.NotApplicable, default, name, SpecialType.None, nullableAnnotation), ITypeParameterSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
21Accessibility declaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (2)
303accessibility: Accessibility.Private, 325accessibility: Accessibility.Public,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (3)
53accessibility: Accessibility.Public, 445method.DeclaredAccessibility == Accessibility.Public && 463Accessibility accessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
207method.DeclaredAccessibility == Accessibility.Public &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\SemanticsFactsService\AbstractSemanticFactsService.cs (2)
133.FirstOrDefault(m => m is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, ReturnType: var returnType, Parameters.Length: 0 } && 149.FirstOrDefault(m => m is IMethodSymbol { DeclaredAccessibility: Accessibility.Public, ReturnsVoid: true, Parameters.Length: 0 }) is IMethodSymbol disposeMethodFromPattern)
Microsoft.CodeAnalysis.Workspaces.UnitTests (58)
Editing\SyntaxEditorTests.cs (5)
52editor.ReplaceNode(fieldX, editor.Generator.FieldDeclaration("Y", editor.Generator.TypeExpression(SpecialType.System_String), Accessibility.Public)); 103editor.InsertAfter(fieldX, editor.Generator.FieldDeclaration("Y", editor.Generator.TypeExpression(SpecialType.System_String), Accessibility.Public)); 130editor.InsertBefore(fieldX, editor.Generator.FieldDeclaration("Y", editor.Generator.TypeExpression(SpecialType.System_String), Accessibility.Public)); 178editor.InsertAfter(fieldX, editor.Generator.FieldDeclaration("Y", editor.Generator.TypeExpression(SpecialType.System_String), Accessibility.Public)); 179editor.InsertBefore(fieldX, editor.Generator.FieldDeclaration("Z", editor.Generator.TypeExpression(SpecialType.System_Object), Accessibility.Public));
EditorConfigParsing\NamingStyleParserTests.cs (52)
72accessibility => Assert.Equal(Accessibility.Public, accessibility), 73accessibility => Assert.Equal(Accessibility.Protected, accessibility), 74accessibility => Assert.Equal(Accessibility.Friend, accessibility), 75accessibility => Assert.Equal(Accessibility.ProtectedOrFriend, accessibility), 76accessibility => Assert.Equal(Accessibility.ProtectedAndFriend, accessibility)); 107accessibility => Assert.Equal(Accessibility.NotApplicable, accessibility), 108accessibility => Assert.Equal(Accessibility.Public, accessibility), 109accessibility => Assert.Equal(Accessibility.Friend, accessibility), 110accessibility => Assert.Equal(Accessibility.Private, accessibility), 111accessibility => Assert.Equal(Accessibility.Protected, accessibility), 112accessibility => Assert.Equal(Accessibility.ProtectedAndFriend, accessibility), 113accessibility => Assert.Equal(Accessibility.ProtectedOrFriend, accessibility)); 145accessibility => Assert.Equal(Accessibility.NotApplicable, accessibility), 146accessibility => Assert.Equal(Accessibility.Public, accessibility), 147accessibility => Assert.Equal(Accessibility.Friend, accessibility), 148accessibility => Assert.Equal(Accessibility.Private, accessibility), 149accessibility => Assert.Equal(Accessibility.Protected, accessibility), 150accessibility => Assert.Equal(Accessibility.ProtectedAndFriend, accessibility), 151accessibility => Assert.Equal(Accessibility.ProtectedOrFriend, accessibility)); 194accessibility => Assert.Equal(Accessibility.Public, accessibility), 195accessibility => Assert.Equal(Accessibility.Protected, accessibility), 196accessibility => Assert.Equal(Accessibility.Friend, accessibility), 197accessibility => Assert.Equal(Accessibility.ProtectedOrFriend, accessibility), 198accessibility => Assert.Equal(Accessibility.ProtectedAndFriend, accessibility)); 229accessibility => Assert.Equal(Accessibility.NotApplicable, accessibility), 230accessibility => Assert.Equal(Accessibility.Public, accessibility), 231accessibility => Assert.Equal(Accessibility.Friend, accessibility), 232accessibility => Assert.Equal(Accessibility.Private, accessibility), 233accessibility => Assert.Equal(Accessibility.Protected, accessibility), 234accessibility => Assert.Equal(Accessibility.ProtectedAndFriend, accessibility), 235accessibility => Assert.Equal(Accessibility.ProtectedOrFriend, accessibility)); 265accessibility => Assert.Equal(Accessibility.NotApplicable, accessibility), 266accessibility => Assert.Equal(Accessibility.Public, accessibility), 267accessibility => Assert.Equal(Accessibility.Friend, accessibility), 268accessibility => Assert.Equal(Accessibility.Private, accessibility), 269accessibility => Assert.Equal(Accessibility.Protected, accessibility), 270accessibility => Assert.Equal(Accessibility.ProtectedAndFriend, accessibility), 271accessibility => Assert.Equal(Accessibility.ProtectedOrFriend, accessibility)); 303accessibility => Assert.Equal(Accessibility.NotApplicable, accessibility), 304accessibility => Assert.Equal(Accessibility.Public, accessibility), 305accessibility => Assert.Equal(Accessibility.Friend, accessibility), 306accessibility => Assert.Equal(Accessibility.Private, accessibility), 307accessibility => Assert.Equal(Accessibility.Protected, accessibility), 308accessibility => Assert.Equal(Accessibility.ProtectedAndFriend, accessibility), 309accessibility => Assert.Equal(Accessibility.ProtectedOrFriend, accessibility)); 339accessibility => Assert.Equal(Accessibility.NotApplicable, accessibility), 340accessibility => Assert.Equal(Accessibility.Public, accessibility), 341accessibility => Assert.Equal(Accessibility.Friend, accessibility), 342accessibility => Assert.Equal(Accessibility.Private, accessibility), 343accessibility => Assert.Equal(Accessibility.Protected, accessibility), 344accessibility => Assert.Equal(Accessibility.ProtectedAndFriend, accessibility), 345accessibility => Assert.Equal(Accessibility.ProtectedOrFriend, accessibility));
SyntaxNodeTests.cs (1)
103var cgenField = gen.FieldDeclaration("X", gen.TypeExpression(SpecialType.System_Int32), Accessibility.Private);
Microsoft.Extensions.Logging.Generators (5)
LoggerMessageGenerator.Parser.cs (1)
651if (!onMostDerivedType && fs.DeclaredAccessibility == Accessibility.Private)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (4)
120case Accessibility.NotApplicable: 121case Accessibility.Private: 126case Accessibility.Internal: 127case Accessibility.ProtectedAndInternal:
Microsoft.Extensions.Options.SourceGeneration (6)
Parser.cs (1)
303if (member.DeclaredAccessibility != Accessibility.Public)
ParserUtilities.cs (1)
82property.Type.SpecialType == returnType && property.DeclaredAccessibility == Accessibility.Public &&
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (4)
120case Accessibility.NotApplicable: 121case Accessibility.Private: 126case Accessibility.Internal: 127case Accessibility.ProtectedAndInternal:
Microsoft.Gen.ContextualOptions (1)
Parser.cs (1)
91prop.GetMethod!.DeclaredAccessibility == Accessibility.Public;
Microsoft.Gen.Logging (18)
Parsing\Parser.cs (1)
662if (!onMostDerivedType && ms.DeclaredAccessibility == Accessibility.Private)
Parsing\Parser.LogProperties.cs (6)
250if ((property.DeclaredAccessibility != Accessibility.Public || property.IsStatic) 251|| (property.GetMethod == null || property.GetMethod.DeclaredAccessibility != Accessibility.Public)) 292if ((property.DeclaredAccessibility != Accessibility.Public || property.IsStatic) 293|| (property.GetMethod == null || property.GetMethod.DeclaredAccessibility != Accessibility.Public)) 306if ((property.DeclaredAccessibility != Accessibility.Public || property.IsStatic) 307|| (property.GetMethod == null || property.GetMethod.DeclaredAccessibility != Accessibility.Public)
Parsing\Parser.Records.cs (1)
57if (m.DeclaredAccessibility != Accessibility.Public ||
Parsing\Parser.TagProvider.cs (3)
188case Accessibility.NotApplicable: 189case Accessibility.Private: 190case Accessibility.Protected:
Parsing\TypeSymbolExtensions.cs (3)
24if (ts.DeclaredAccessibility == Accessibility.Public) 47if (ts.DeclaredAccessibility == Accessibility.Public) 82if (current.GetMembers("ToString").Where(m => m.Kind == SymbolKind.Method && m.DeclaredAccessibility == Accessibility.Public).Cast<IMethodSymbol>().Any(m => m.Parameters.Length == 0))
src\Generators\Shared\RoslynExtensions.cs (4)
169case Accessibility.NotApplicable: 170case Accessibility.Private: 175case Accessibility.Internal: 176case Accessibility.ProtectedAndInternal:
Microsoft.Gen.Metrics (4)
src\Generators\Shared\RoslynExtensions.cs (4)
169case Accessibility.NotApplicable: 170case Accessibility.Private: 175case Accessibility.Internal: 176case Accessibility.ProtectedAndInternal:
Microsoft.Interop.ComInterfaceGenerator (4)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (4)
120case Accessibility.NotApplicable: 121case Accessibility.Private: 126case Accessibility.Internal: 127case Accessibility.ProtectedAndInternal:
Microsoft.Interop.LibraryImportGenerator (23)
Analyzers\CustomMarshallerAttributeFixer.cs (19)
226accessibility: Accessibility.Public, 238accessibility: Accessibility.Public, 249Accessibility.Public, 265accessibility: Accessibility.Public, 281accessibility: Accessibility.Public, 296accessibility: Accessibility.Public, 312accessibility: Accessibility.Public, 328accessibility: Accessibility.Public, 343accessibility: Accessibility.Public, 421accessibility: Accessibility.Public, 431accessibility: Accessibility.Public, 441accessibility: Accessibility.Public, 451accessibility: Accessibility.Public, 461Accessibility.Public, 472accessibility: Accessibility.Public, 482accessibility: Accessibility.Public, 496accessibility: Accessibility.Public, 510accessibility: Accessibility.Public, 519accessibility: Accessibility.Public,
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (4)
120case Accessibility.NotApplicable: 121case Accessibility.Private: 126case Accessibility.Internal: 127case Accessibility.ProtectedAndInternal:
Microsoft.Interop.LibraryImportGenerator.Downlevel (4)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (4)
120case Accessibility.NotApplicable: 121case Accessibility.Private: 126case Accessibility.Internal: 127case Accessibility.ProtectedAndInternal:
Microsoft.Interop.SourceGeneration (7)
ISymbolExtensions.cs (2)
18if (symbol.DeclaredAccessibility - Accessibility.Internal < 0) 26if (current.DeclaredAccessibility - Accessibility.Internal < 0)
SafeHandleMarshallingInfoProvider.cs (1)
50hasDefaultConstructor = ctor.DeclaredAccessibility == Accessibility.Public;
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (4)
120case Accessibility.NotApplicable: 121case Accessibility.Private: 126case Accessibility.Internal: 127case Accessibility.ProtectedAndInternal:
Microsoft.Maui.Controls.BindingSourceGen (3)
ISymbolExtensions.cs (3)
8 symbol.DeclaredAccessibility == Accessibility.Public 9 || symbol.DeclaredAccessibility == Accessibility.Internal 10 || symbol.DeclaredAccessibility == Accessibility.ProtectedOrInternal;
Microsoft.Maui.Controls.SourceGen (2)
CodeBehindGenerator.cs (2)
586 if (type.DeclaredAccessibility == Accessibility.Public) 592 if (type.DeclaredAccessibility == Accessibility.Internal && internalsVisible.Contains(type.ContainingAssembly, SymbolEqualityComparer.Default))
Microsoft.ML.InternalCodeAnalyzer (3)
BestFriendAnalyzer.cs (2)
85case Accessibility.Friend: 86case Accessibility.ProtectedAndFriend:
BestFriendOnPublicDeclarationsAnalyzer.cs (1)
59if (context.Symbol.DeclaredAccessibility != Accessibility.Public)
Microsoft.VisualStudio.LanguageServices (42)
CommonControls\MemberSelectionViewModel.cs (1)
96=> SelectMembers(Members.WhereAsArray(v => v.Symbol.DeclaredAccessibility == Accessibility.Public));
GenerateType\GenerateTypeDialogViewModel.cs (8)
34private Dictionary<string, Accessibility> _accessListMap; 84public Accessibility SelectedAccessibility 159private void PopulateAccessList(string key, Accessibility accessibility, string languageName = null) 191PopulateAccessList("Default", Accessibility.NotApplicable); 192PopulateAccessList("internal", Accessibility.Internal, LanguageNames.CSharp); 193PopulateAccessList("Friend", Accessibility.Internal, LanguageNames.VisualBasic); 196PopulateAccessList("public", Accessibility.Public, LanguageNames.CSharp); 197PopulateAccessList("Public", Accessibility.Public, LanguageNames.VisualBasic);
Library\ObjectBrowser\AbstractListItemFactory.cs (2)
160return symbol.DeclaredAccessibility is Accessibility.Protected or Accessibility.ProtectedOrInternal
Library\ObjectBrowser\Lists\SymbolListItem.cs (1)
36public Accessibility Accessibility { get; }
Library\ObjectBrowser\ObjectList.cs (10)
173case Accessibility.Private: 177case Accessibility.Protected: 181case Accessibility.Internal: 182case Accessibility.ProtectedOrInternal: 183case Accessibility.ProtectedAndInternal: 249case Accessibility.Private: 253case Accessibility.Protected: 257case Accessibility.Internal: 258case Accessibility.ProtectedOrInternal: 259case Accessibility.ProtectedAndInternal:
Progression\GraphBuilder.cs (7)
437case Accessibility.Public: 441case Accessibility.Internal: 445case Accessibility.Protected: 449case Accessibility.Private: 453case Accessibility.ProtectedOrInternal: 457case Accessibility.ProtectedAndInternal: 462case Accessibility.NotApplicable:
Progression\GraphProvider.cs (2)
260if (nodes.Any(n => CheckAccessibility(n, Accessibility.Public) || 328private static bool CheckAccessibility(GraphNode node, Accessibility accessibility)
Progression\GraphQueries\IsUsedByGraphQuery.cs (1)
70locationNode[DgmlNodeProperties.Icon] = IconHelper.GetIconName("Reference", Accessibility.NotApplicable);
Progression\IconHelper.cs (8)
20public static string GetIconName(string groupName, Accessibility symbolAccessibility) 24case Accessibility.Private: 27case Accessibility.Protected: 28case Accessibility.ProtectedAndInternal: 29case Accessibility.ProtectedOrInternal: 32case Accessibility.Internal: 35case Accessibility.Public: 36case Accessibility.NotApplicable:
Progression\RoslynGraphProperties.cs (1)
90dataType: typeof(Accessibility),
Venus\ContainedLanguageCodeSupport.cs (1)
192accessibility: Accessibility.Protected,
Microsoft.VisualStudio.LanguageServices.CSharp (19)
CodeModel\CSharpCodeModelService.cs (13)
1006return symbol.DeclaredAccessibility is Accessibility.Public 1007or Accessibility.Protected 1008or Accessibility.ProtectedOrInternal; 1034Accessibility.Public => EnvDTE.vsCMAccess.vsCMAccessPublic, 1035Accessibility.Private => EnvDTE.vsCMAccess.vsCMAccessPrivate, 1036Accessibility.Internal => EnvDTE.vsCMAccess.vsCMAccessProject, 1037Accessibility.Protected => EnvDTE.vsCMAccess.vsCMAccessProtected, 1038Accessibility.ProtectedOrInternal => EnvDTE.vsCMAccess.vsCMAccessProjectOrProtected, 1039Accessibility.ProtectedAndInternal => 2985protected override Accessibility GetDefaultAccessibility(SymbolKind targetSymbolKind, CodeGenerationDestination destination) 2993return Accessibility.Private; 3002return Accessibility.Private; 3004return Accessibility.Internal;
ObjectBrowser\DescriptionBuilder.cs (6)
131case Accessibility.Public: 135case Accessibility.Private: 139case Accessibility.Protected: 143case Accessibility.Internal: 147case Accessibility.ProtectedOrInternal: 151case Accessibility.ProtectedAndInternal:
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (12)
GlyphExtensionsTests.cs (12)
41Accessibility.Private); 45Accessibility.Private, 50declaredAccessibility: Accessibility.ProtectedAndInternal); 53declaredAccessibility: Accessibility.Protected); 56declaredAccessibility: Accessibility.ProtectedOrInternal); 59declaredAccessibility: Accessibility.Internal); 62declaredAccessibility: Accessibility.Public); 65declaredAccessibility: Accessibility.Public, 178Accessibility declaredAccessibility = Accessibility.NotApplicable, 195Accessibility declaredAccessibility = Accessibility.NotApplicable,
Microsoft.VisualStudio.LanguageServices.VisualBasic (31)
CodeModel\VisualBasicCodeModelService.vb (18)
1405Return symbol.DeclaredAccessibility = Accessibility.Public OrElse 1406symbol.DeclaredAccessibility = Accessibility.Protected OrElse 1407symbol.DeclaredAccessibility = Accessibility.ProtectedOrFriend OrElse 1408symbol.DeclaredAccessibility = Accessibility.ProtectedAndFriend OrElse 1409symbol.DeclaredAccessibility = Accessibility.Friend 1434Case Accessibility.Private 1436Case Accessibility.Protected 1438Case Accessibility.Internal, Accessibility.Friend 1440Case Accessibility.ProtectedOrInternal, Accessibility.ProtectedOrFriend 1442Case Accessibility.ProtectedAndInternal, Accessibility.ProtectedAndFriend 1446Case Accessibility.Public 3608Protected Overrides Function GetDefaultAccessibility(targetSymbolKind As SymbolKind, destination As CodeGenerationDestination) As Accessibility 3610Return Accessibility.Public 3615Return Accessibility.Private 3620Return Accessibility.Public
CodeModel\VisualBasicCodeModelService_Prototype.vb (7)
142Private Shared Sub AppendAccessibility(builder As StringBuilder, accessibility As Accessibility) 144Case Accessibility.Private 146Case Accessibility.Protected 148Case Accessibility.Friend 150Case Accessibility.ProtectedOrFriend 152Case Accessibility.ProtectedAndFriend 154Case Accessibility.Public
ObjectBrowser\DescriptionBuilder.vb (6)
315Case Accessibility.Public 317Case Accessibility.Private 319Case Accessibility.Friend 321Case Accessibility.Protected 323Case Accessibility.ProtectedOrFriend 325Case Accessibility.ProtectedAndFriend
System.Text.Json.SourceGeneration (10)
Helpers\RoslynExtensions.cs (1)
112constructorInfo = namedType.GetExplicitlyDeclaredInstanceConstructors().FirstOrDefault(ctor => ctor.DeclaredAccessibility is Accessibility.Public && ctor.Parameters.Length == 0);
JsonSourceGenerator.Parser.cs (5)
1363if (getMethod.DeclaredAccessibility is Accessibility.Public) 1383if (setMethod.DeclaredAccessibility is Accessibility.Public) 1410if (fieldInfo.DeclaredAccessibility is Accessibility.Public) 1730IMethodSymbol[] publicCtors = namedType.GetExplicitlyDeclaredInstanceConstructors().Where(ctor => ctor.DeclaredAccessibility is Accessibility.Public).ToArray(); 1756foreach (IMethodSymbol constructor in namedType.GetExplicitlyDeclaredInstanceConstructors().Where(ctor => ctor.DeclaredAccessibility is not Accessibility.Public))
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (4)
120case Accessibility.NotApplicable: 121case Accessibility.Private: 126case Accessibility.Internal: 127case Accessibility.ProtectedAndInternal:
System.Text.RegularExpressions.Generator (5)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (4)
120case Accessibility.NotApplicable: 121case Accessibility.Private: 126case Accessibility.Internal: 127case Accessibility.ProtectedAndInternal:
UpgradeToGeneratedRegexCodeFixer.cs (1)
187accessibility: Accessibility.Private);
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationAnalyzer.cs (1)
42|| propertySymbol.DeclaredAccessibility < Accessibility.Internal)
System.Windows.Forms.Analyzers.VisualBasic (1)
Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb (1)
45propertySymbol.DeclaredAccessibility < Accessibility.Internal Then