6 implementations of DeclaredAccessibility
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
29public Accessibility DeclaredAccessibility { get; }
Microsoft.CodeAnalysis.CSharp (2)
Symbols\PublicModel\PreprocessingSymbol.cs (1)
66Accessibility ISymbol.DeclaredAccessibility => Accessibility.NotApplicable;
Symbols\PublicModel\Symbol.cs (1)
125Accessibility ISymbol.DeclaredAccessibility
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
41public Accessibility DeclaredAccessibility => _symbol.DeclaredAccessibility;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
1235Private ReadOnly Property ISymbol_DeclaredAccessibility As Accessibility Implements ISymbol.DeclaredAccessibility, ISymbolInternal.DeclaredAccessibility
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
29public Accessibility DeclaredAccessibility { get; }
466 references to DeclaredAccessibility
ConfigurationSchemaGenerator (5)
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 (1)
117switch (symbol.DeclaredAccessibility)
ILLink.CodeFixProvider (2)
BaseAttributeCodeFixProvider.cs (2)
136 if (m is not { DeclaredAccessibility: Accessibility.Public or Accessibility.Protected }) { 140 if (t.DeclaredAccessibility != Accessibility.Public) {
ILLink.RoslynAnalyzer (25)
CompilationExtensions.cs (1)
99 switch (symbol.DeclaredAccessibility) {
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 (2)
MakeExeTypesInternalAnalyzer.cs (1)
94if (type.DeclaredAccessibility == Accessibility.Public && type.ContainingType == null)
Utilities\SymbolExtensions.cs (1)
41switch (symbol.DeclaredAccessibility)
Microsoft.Analyzers.Local (1)
Utilities\SymbolExtensions.cs (1)
17switch (symbol.DeclaredAccessibility)
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 (9)
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 (3)
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 (4)
HubClientProxyGenerator.Parser.cs (2)
223GeneratorHelpers.GetAccessibilityString(registerCallbackProviderMethodSymbol.DeclaredAccessibility); 225GeneratorHelpers.GetAccessibilityString(registerCallbackProviderClassSymbol.DeclaredAccessibility);
HubServerProxyGenerator.Parser.cs (2)
212GeneratorHelpers.GetAccessibilityString(getProxyMethodSymbol.DeclaredAccessibility); 214GeneratorHelpers.GetAccessibilityString(getProxyClassSymbol.DeclaredAccessibility);
Microsoft.CodeAnalysis (2)
Symbols\ISymbolExtensions.cs (2)
152if (scopeType is not INamedTypeSymbol { Name: WellKnownMemberNames.LockScopeTypeName, Arity: 0, IsValueType: true, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public } || 183DeclaredAccessibility: Accessibility.Public,
Microsoft.CodeAnalysis.CodeStyle (25)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
164DeclaredAccessibility: Accessibility.Private,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
739if (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)
89.FirstOrDefault(m => m.DeclaredAccessibility == Accessibility.Public &&
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (1)
184DeclaredAccessibility: Accessibility.Private,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (2)
198return type.GetMembers().WhereAsArray(m => m.DeclaredAccessibility == Accessibility.Public && 221return accessor != null && IsImplementable(accessor) && accessor.DeclaredAccessibility != Accessibility.Public;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (5)
51switch (symbol.DeclaredAccessibility) 560switch (symbol.DeclaredAccessibility) 563return symbol.DeclaredAccessibility; 706.Where(x => x.DeclaredAccessibility == Accessibility.Public) 746.Where(x => x.DeclaredAccessibility == Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (3)
165return IsMemberAccessible(symbol.ContainingType, symbol.DeclaredAccessibility, within, throughType, out failedThroughTypeCheck); 203? IsNonNestedTypeAccessible(type.ContainingAssembly, type.DeclaredAccessibility, within) 204: IsMemberAccessible(type.ContainingType, type.DeclaredAccessibility, within, null, out _);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
700hasPrivateField |= fieldSymbol.DeclaredAccessibility == Accessibility.Private;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (2)
29var accessibility = symbol.DeclaredAccessibility; 50var accessibility = symbol.DeclaredAccessibility;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
84if (symbol.DeclaredAccessibility != Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
180return currentSymbol.DeclaredAccessibility; 184return currentSymbol.DeclaredAccessibility;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (1)
68(method2 == null || method2.DeclaredAccessibility != Accessibility.Public);
Microsoft.CodeAnalysis.CodeStyle.Fixes (31)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (1)
60return symbol.DeclaredAccessibility;
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
49if (method.DeclaredAccessibility != Accessibility.Public)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
141switch (symbol.DeclaredAccessibility)
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
56switch (symbol.DeclaredAccessibility)
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.AbstractCodeAction.cs (3)
91if (classType.IsAbstractClass() && baseConstructor.DeclaredAccessibility == Accessibility.Public) 97switch (baseConstructor.DeclaredAccessibility) 108return baseConstructor.DeclaredAccessibility;
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (8)
124if (first.DeclaredAccessibility <= Accessibility.NotApplicable || 125second.DeclaredAccessibility <= Accessibility.NotApplicable) 130if (first.DeclaredAccessibility < second.DeclaredAccessibility) 192if (first.DeclaredAccessibility <= Accessibility.NotApplicable || 193second.DeclaredAccessibility <= Accessibility.NotApplicable) 198if (first.DeclaredAccessibility < second.DeclaredAccessibility)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
415if (member1.DeclaredAccessibility != member2.DeclaredAccessibility ||
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Conflicts.cs (2)
77if (member1.DeclaredAccessibility != member2.DeclaredAccessibility ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (5)
369accessibility ?? accessor.DeclaredAccessibility, 530accessibility ?? method.DeclaredAccessibility, 558accessibility ?? property.DeclaredAccessibility, 582accessibility ?? @event.DeclaredAccessibility, 600accessibility ?? field.DeclaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs (1)
22namedType.DeclaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (2)
65method.DeclaredAccessibility, 91method.DeclaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (2)
28property.DeclaredAccessibility, 54property.DeclaredAccessibility,
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.CSharp (4)
SymbolDisplay\SymbolDisplayVisitor.cs (2)
393switch (symbol.DeclaredAccessibility) 418throw ExceptionUtilities.UnexpectedValue(symbol.DeclaredAccessibility);
SymbolDisplay\SymbolDisplayVisitor.Members.cs (2)
1031if (method.DeclaredAccessibility != property.DeclaredAccessibility)
Microsoft.CodeAnalysis.CSharp.CodeStyle (12)
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
109if (containingType.DeclaredAccessibility == Accessibility.Public)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
34=> !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 (1)
95DeclaredAccessibility: Accessibility.Private,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (6)
229variableDeclaration.Variables[0], cancellationToken).DeclaredAccessibility; 240variableDeclaration.Variables[0], cancellationToken).DeclaredAccessibility; 261type.Parent, cancellationToken).DeclaredAccessibility; 283type.Parent.Parent.Parent, cancellationToken).DeclaredAccessibility; 291return symbol.DeclaredAccessibility; 303return symbol.DeclaredAccessibility;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (24)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (10)
134if (propertySymbol.DeclaredAccessibility < Accessibility.Internal) 165getAccessor.DeclaredAccessibility < Accessibility.Internal) 174if (getAccessor.DeclaredAccessibility < propertySymbol.DeclaredAccessibility) 191if (setAccessor.DeclaredAccessibility != Accessibility.Public && 192setAccessor.DeclaredAccessibility != propertySymbol.DeclaredAccessibility) 207if (setAccessor.DeclaredAccessibility != Accessibility.Public && 208setAccessor.DeclaredAccessibility != propertySymbol.DeclaredAccessibility)
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (3)
71var minimalAccessibility = (Accessibility)Math.Min((int)propertySymbol.DeclaredAccessibility, (int)setMethod.DeclaredAccessibility); 81var accessibility = fieldSymbol.DeclaredAccessibility;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConstructorGenerator.cs (1)
127AddAccessibilityModifiers(constructor.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (1)
219AddAccessibilityModifiers(@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)
285AddAccessibilityModifiers(method.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
278AddAccessibilityModifiers(namedType.DeclaredAccessibility, tokens, info, defaultAccessibility);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (6)
332if (accessor.DeclaredAccessibility != Accessibility.NotApplicable && 333accessor.DeclaredAccessibility != property.DeclaredAccessibility) 335AddAccessibilityModifiers(accessor.DeclaredAccessibility, modifiers, info, property.DeclaredAccessibility); 371AddAccessibilityModifiers(property.DeclaredAccessibility, tokens, info, Accessibility.Private);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenDeconstructTests.cs (1)
3616Assert.Equal(Accessibility.Private, field.DeclaredAccessibility);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (2)
Semantics\PrimaryConstructorTests.cs (1)
1079Assert.Equal(Accessibility.Public, symbol.ContainingSymbol.DeclaredAccessibility);
Semantics\RecordTests.cs (1)
21151Assert.Equal(Accessibility.Public, symbol.ContainingSymbol.DeclaredAccessibility);
Microsoft.CodeAnalysis.CSharp.Features (29)
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
199=> namespaceSymbol != null && namespaceSymbol.GetTypeMembers(name).Any(static t => t.DeclaredAccessibility == Accessibility.Public);
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (2)
92method, useDeclaredAccessibity ? mainMethod.DeclaredAccessibility : Accessibility.NotApplicable); 104accessibility: useDeclaredAccessibity ? programType.DeclaredAccessibility : Accessibility.NotApplicable,
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
159if (field.DeclaredAccessibility == Accessibility.Private || IsNew(field))
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (3)
254if (getMethod.DeclaredAccessibility != setMethod.DeclaredAccessibility) 256accessor = (AccessorDeclarationSyntax)generator.WithAccessibility(accessor, setMethod.DeclaredAccessibility);
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
109if (containingType.DeclaredAccessibility == Accessibility.Public)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
34=> !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 (1)
95DeclaredAccessibility: Accessibility.Private,
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (10)
134if (propertySymbol.DeclaredAccessibility < Accessibility.Internal) 165getAccessor.DeclaredAccessibility < Accessibility.Internal) 174if (getAccessor.DeclaredAccessibility < propertySymbol.DeclaredAccessibility) 191if (setAccessor.DeclaredAccessibility != Accessibility.Public && 192setAccessor.DeclaredAccessibility != propertySymbol.DeclaredAccessibility) 207if (setAccessor.DeclaredAccessibility != Accessibility.Public && 208setAccessor.DeclaredAccessibility != propertySymbol.DeclaredAccessibility)
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (3)
71var minimalAccessibility = (Accessibility)Math.Min((int)propertySymbol.DeclaredAccessibility, (int)setMethod.DeclaredAccessibility); 81var accessibility = fieldSymbol.DeclaredAccessibility;
UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (3)
123if (fieldSymbol.DeclaredAccessibility != propertySymbol.DeclaredAccessibility) 124accessor = (AccessorDeclarationSyntax)generator.WithAccessibility(accessor, fieldSymbol.DeclaredAccessibility);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\AccessCheckTests.cs (1)
910Assert.Equal(Accessibility.Private, Private.DeclaredAccessibility);
Semantics\DelegateTypeTests.cs (1)
14353Assert.Equal(Accessibility.Internal, delegateType.DeclaredAccessibility);
Semantics\NativeIntegerTests.cs (1)
313if (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);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (16)
Symbols\AccessorOverriddenOrHiddenMembersTests.cs (1)
1039Assert.Equal(Accessibility.Public, methodDispose.DeclaredAccessibility);
Symbols\AssemblyAndNamespaceTests.cs (2)
38Assert.Equal(Accessibility.NotApplicable, sym.DeclaredAccessibility); 65Assert.Equal(Accessibility.NotApplicable, sym.DeclaredAccessibility);
Symbols\MissingSpecialMember.cs (4)
160Assert.Equal(Accessibility.NotApplicable, specialType.DeclaredAccessibility); 165Assert.Equal(Accessibility.Internal, lookupType.DeclaredAccessibility); 277Assert.Equal(Accessibility.Internal, lookupType.DeclaredAccessibility); 310Assert.NotEqual(Accessibility.NotApplicable, lookupType.DeclaredAccessibility);
Symbols\Source\DelegateTests.cs (1)
137Assert.Equal(Accessibility.Internal, v.DeclaredAccessibility);
Symbols\Source\MethodTests.cs (2)
81Assert.Equal(accessibility, ct.DeclaredAccessibility); 126Assert.Equal(Accessibility.Private, m.DeclaredAccessibility);
Symbols\Source\SourcePlusMetadataTests.cs (2)
238Assert.Equal(srcSym.DeclaredAccessibility, metaSym.DeclaredAccessibility);
Symbols\TypeTests.cs (4)
90Assert.Equal(Accessibility.Internal, a.DeclaredAccessibility); 91Assert.Equal(Accessibility.Internal, b.DeclaredAccessibility); 92Assert.Equal(Accessibility.Internal, s.DeclaredAccessibility); 671Assert.Equal(Accessibility.Public, v.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.Workspaces (17)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (6)
229variableDeclaration.Variables[0], cancellationToken).DeclaredAccessibility; 240variableDeclaration.Variables[0], cancellationToken).DeclaredAccessibility; 261type.Parent, cancellationToken).DeclaredAccessibility; 283type.Parent.Parent.Parent, cancellationToken).DeclaredAccessibility; 291return symbol.DeclaredAccessibility; 303return symbol.DeclaredAccessibility;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ConstructorGenerator.cs (1)
127AddAccessibilityModifiers(constructor.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EventGenerator.cs (1)
219AddAccessibilityModifiers(@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)
285AddAccessibilityModifiers(method.DeclaredAccessibility, tokens, info, Accessibility.Private);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
278AddAccessibilityModifiers(namedType.DeclaredAccessibility, tokens, info, defaultAccessibility);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\PropertyGenerator.cs (6)
332if (accessor.DeclaredAccessibility != Accessibility.NotApplicable && 333accessor.DeclaredAccessibility != property.DeclaredAccessibility) 335AddAccessibilityModifiers(accessor.DeclaredAccessibility, modifiers, info, property.DeclaredAccessibility); 371AddAccessibilityModifiers(property.DeclaredAccessibility, tokens, info, Accessibility.Private);
Microsoft.CodeAnalysis.Features (53)
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (1)
70accessibility: IncludeAccessibility(method, cancellationToken) ? method.DeclaredAccessibility : Accessibility.NotApplicable,
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
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);
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
155method.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 (2)
196var markFieldPrivate = field.DeclaredAccessibility != Accessibility.Private; 212originalField.DeclaredAccessibility,
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (3)
128if (symbol.DeclaredAccessibility == Accessibility.Private) 155if (symbol.DeclaredAccessibility == Accessibility.Private) 193return symbol.DeclaredAccessibility is Accessibility.Internal or
ExtractInterface\AbstractExtractInterfaceService.cs (6)
143accessibility: ShouldIncludeAccessibilityModifier(refactoringResult.TypeNode) ? refactoringResult.TypeToExtractFrom.DeclaredAccessibility : Accessibility.NotApplicable, 405var hasGetMethod = property.GetMethod != null && property.GetMethod.DeclaredAccessibility == Accessibility.Public; 423setMethod: property.SetMethod == null ? null : (property.SetMethod.DeclaredAccessibility == Accessibility.Public ? property.SetMethod : null), 438m.DeclaredAccessibility != Accessibility.Public || 453((prop.GetMethod != null && prop.GetMethod.DeclaredAccessibility == Accessibility.Public) || 454(prop.SetMethod != null && prop.SetMethod.DeclaredAccessibility == Accessibility.Public));
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
166compareMethod.DeclaredAccessibility != Accessibility.Public &&
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
646switch (symbol.DeclaredAccessibility)
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
113if (calleeMethodSymbol.DeclaredAccessibility != Accessibility.Private)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
41public Accessibility DeclaredAccessibility => _symbol.DeclaredAccessibility;
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
31where m.DeclaredAccessibility is Accessibility.Public or
PullMemberUp\MembersPuller.cs (1)
78return getterOrSetter?.DeclaredAccessibility == Accessibility.Public ? getterOrSetter : null;
Shared\Extensions\ISymbolExtensions_2.cs (1)
163switch (symbol.DeclaredAccessibility)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
164DeclaredAccessibility: Accessibility.Private,
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
739if (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)
89.FirstOrDefault(m => m.DeclaredAccessibility == Accessibility.Public &&
src\Analyzers\Core\Analyzers\UseObjectInitializer\UseNamedMemberInitializerAnalyzer.cs (1)
184DeclaredAccessibility: Accessibility.Private,
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (1)
60return symbol.DeclaredAccessibility;
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (1)
49if (method.DeclaredAccessibility != Accessibility.Public)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.cs (1)
141switch (symbol.DeclaredAccessibility)
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
56switch (symbol.DeclaredAccessibility)
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.AbstractCodeAction.cs (3)
91if (classType.IsAbstractClass() && baseConstructor.DeclaredAccessibility == Accessibility.Public) 97switch (baseConstructor.DeclaredAccessibility) 108return baseConstructor.DeclaredAccessibility;
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (8)
124if (first.DeclaredAccessibility <= Accessibility.NotApplicable || 125second.DeclaredAccessibility <= Accessibility.NotApplicable) 130if (first.DeclaredAccessibility < second.DeclaredAccessibility) 192if (first.DeclaredAccessibility <= Accessibility.NotApplicable || 193second.DeclaredAccessibility <= Accessibility.NotApplicable) 198if (first.DeclaredAccessibility < second.DeclaredAccessibility)
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (2)
415if (member1.DeclaredAccessibility != member2.DeclaredAccessibility ||
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator_Conflicts.cs (2)
77if (member1.DeclaredAccessibility != member2.DeclaredAccessibility ||
Microsoft.CodeAnalysis.VisualBasic (3)
SymbolDisplay\SymbolDisplayVisitor.vb (2)
351Select Case symbol.DeclaredAccessibility 369Throw ExceptionUtilities.UnexpectedValue(symbol.DeclaredAccessibility)
Symbols\Symbol.vb (1)
1235Private ReadOnly Property ISymbol_DeclaredAccessibility As Accessibility Implements ISymbol.DeclaredAccessibility, ISymbolInternal.DeclaredAccessibility
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (8)
src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\VisualBasicUseAutoPropertyAnalyzer.vb (4)
66prop.GetMethod.DeclaredAccessibility <> prop.DeclaredAccessibility Then 71prop.SetMethod.DeclaredAccessibility <> prop.DeclaredAccessibility Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (4)
129Return variableDeclaration.DeclaredAccessibility 144Return variableDeclaration.DeclaredAccessibility 156type.Parent.Parent, cancellationToken).DeclaredAccessibility 170type.Parent.Parent.Parent.Parent, cancellationToken).DeclaredAccessibility
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (11)
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 (2)
117[event].DeclaredAccessibility, 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 (1)
167Select Case namedType.DeclaredAccessibility
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (5)
160If accessor.DeclaredAccessibility = Accessibility.NotApplicable OrElse 161accessor.DeclaredAccessibility = [property].DeclaredAccessibility Then 168AddAccessibilityModifiers(accessor.DeclaredAccessibility, modifiers, destination, options, Accessibility.Public) 189AddAccessibilityModifiers([property].DeclaredAccessibility, tokens, destination, options, Accessibility.Public)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (2)
PrivateProtected.vb (2)
139If Accessibility.ProtectedAndInternal <> member.DeclaredAccessibility Then 142Assert.Equal(Accessibility.ProtectedAndInternal, member.DeclaredAccessibility)
Microsoft.CodeAnalysis.VisualBasic.Features (7)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (2)
292eventType.GetAttributes(), eventType.DeclaredAccessibility, 298boundEvent.GetAttributes(), boundEvent.DeclaredAccessibility,
EncapsulateField\VisualBasicEncapsulateFieldService.vb (1)
108If field.DeclaredAccessibility = Accessibility.Private OrElse IsShadows(field) Then
src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\VisualBasicUseAutoPropertyAnalyzer.vb (4)
66prop.GetMethod.DeclaredAccessibility <> prop.DeclaredAccessibility Then 71prop.SetMethod.DeclaredAccessibility <> prop.DeclaredAccessibility Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (15)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (4)
129Return variableDeclaration.DeclaredAccessibility 144Return variableDeclaration.DeclaredAccessibility 156type.Parent.Parent, cancellationToken).DeclaredAccessibility 170type.Parent.Parent.Parent.Parent, cancellationToken).DeclaredAccessibility
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 (2)
117[event].DeclaredAccessibility, 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 (1)
167Select Case namedType.DeclaredAccessibility
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\PropertyGenerator.vb (5)
160If accessor.DeclaredAccessibility = Accessibility.NotApplicable OrElse 161accessor.DeclaredAccessibility = [property].DeclaredAccessibility Then 168AddAccessibilityModifiers(accessor.DeclaredAccessibility, modifiers, destination, options, Accessibility.Public) 189AddAccessibilityModifiers([property].DeclaredAccessibility, tokens, destination, options, Accessibility.Public)
Microsoft.CodeAnalysis.Workspaces (51)
Editing\SyntaxGenerator.cs (15)
147field.DeclaredAccessibility, 196accessibility: method.DeclaredAccessibility, 288accessibility: method.DeclaredAccessibility, 368var propertyAccessibility = property.DeclaredAccessibility; 377var getMethodAccessibility = getMethodSymbol.DeclaredAccessibility; 383var setMethodAccessibility = setMethodSymbol.DeclaredAccessibility; 454indexer.DeclaredAccessibility, 495symbol.DeclaredAccessibility, 533symbol.DeclaredAccessibility, 562constructorMethod.DeclaredAccessibility, 764accessibility: type.DeclaredAccessibility, 773accessibility: type.DeclaredAccessibility, 780accessibility: type.DeclaredAccessibility, 788accessibility: type.DeclaredAccessibility, 796accessibility: type.DeclaredAccessibility,
FindSymbols\SymbolFinder_Helpers.cs (1)
20var accessibility = symbol.DeclaredAccessibility;
FindSymbols\SymbolFinder_Hierarchy.cs (1)
129if (symbol is { DeclaredAccessibility: Accessibility.Public, ContainingType.TypeKind: TypeKind.Class or TypeKind.Struct })
Rename\RenameUtilities.cs (1)
122if (symbol.DeclaredAccessibility != Accessibility.Private)
Shared\Extensions\ITypeSymbolExtensions.cs (1)
168where member.DeclaredAccessibility == Accessibility.Public &&
Shared\Extensions\SyntaxGeneratorExtensions.cs (1)
158if (overriddenProperty.SetMethod is { DeclaredAccessibility: not Accessibility.Private } &&
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (2)
198return type.GetMembers().WhereAsArray(m => m.DeclaredAccessibility == Accessibility.Public && 221return accessor != null && IsImplementable(accessor) && accessor.DeclaredAccessibility != Accessibility.Public;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (5)
51switch (symbol.DeclaredAccessibility) 560switch (symbol.DeclaredAccessibility) 563return symbol.DeclaredAccessibility; 706.Where(x => x.DeclaredAccessibility == Accessibility.Public) 746.Where(x => x.DeclaredAccessibility == Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (3)
165return IsMemberAccessible(symbol.ContainingType, symbol.DeclaredAccessibility, within, throughType, out failedThroughTypeCheck); 203? IsNonNestedTypeAccessible(type.ContainingAssembly, type.DeclaredAccessibility, within) 204: IsMemberAccessible(type.ContainingType, type.DeclaredAccessibility, within, null, out _);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
700hasPrivateField |= fieldSymbol.DeclaredAccessibility == Accessibility.Private;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (2)
29var accessibility = symbol.DeclaredAccessibility; 50var accessibility = symbol.DeclaredAccessibility;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
84if (symbol.DeclaredAccessibility != Accessibility.Public)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
180return currentSymbol.DeclaredAccessibility; 184return currentSymbol.DeclaredAccessibility;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (1)
68(method2 == null || method2.DeclaredAccessibility != Accessibility.Public);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (5)
369accessibility ?? accessor.DeclaredAccessibility, 530accessibility ?? method.DeclaredAccessibility, 558accessibility ?? property.DeclaredAccessibility, 582accessibility ?? @event.DeclaredAccessibility, 600accessibility ?? field.DeclaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\INamedTypeSymbolExtensions.cs (1)
22namedType.DeclaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (2)
65method.DeclaredAccessibility, 91method.DeclaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IPropertySymbolExtensions.cs (2)
28property.DeclaredAccessibility, 54property.DeclaredAccessibility,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
445method.DeclaredAccessibility == Accessibility.Public &&
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.Extensions.Logging.Generators (2)
LoggerMessageGenerator.Parser.cs (1)
651if (!onMostDerivedType && fs.DeclaredAccessibility == Accessibility.Private)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
117switch (symbol.DeclaredAccessibility)
Microsoft.Extensions.Options.SourceGeneration (3)
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 (1)
117switch (symbol.DeclaredAccessibility)
Microsoft.Gen.ContextualOptions (1)
Parser.cs (1)
91prop.GetMethod!.DeclaredAccessibility == Accessibility.Public;
Microsoft.Gen.Logging (13)
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 (1)
186switch (symbol.DeclaredAccessibility)
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 (1)
166switch (symbol.DeclaredAccessibility)
Microsoft.Gen.Metrics (1)
src\Generators\Shared\RoslynExtensions.cs (1)
166switch (symbol.DeclaredAccessibility)
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
117switch (symbol.DeclaredAccessibility)
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
117switch (symbol.DeclaredAccessibility)
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
117switch (symbol.DeclaredAccessibility)
Microsoft.Interop.SourceGeneration (6)
ISymbolExtensions.cs (4)
18if (symbol.DeclaredAccessibility - Accessibility.Internal < 0) 20details = string.Format(SR.TypeAccessibilityDetails, symbol.ToDisplayString(), symbol.DeclaredAccessibility.ToString().ToLowerInvariant()); 26if (current.DeclaredAccessibility - Accessibility.Internal < 0) 28details = string.Format(SR.ContainingTypeAccessibilityDetails, current.ToDisplayString(), current.DeclaredAccessibility.ToString().ToLowerInvariant());
SafeHandleMarshallingInfoProvider.cs (1)
50hasDefaultConstructor = ctor.DeclaredAccessibility == Accessibility.Public;
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
117switch (symbol.DeclaredAccessibility)
Microsoft.ML.InternalCodeAnalyzer (2)
BestFriendAnalyzer.cs (1)
83switch (symbol.DeclaredAccessibility)
BestFriendOnPublicDeclarationsAnalyzer.cs (1)
59if (context.Symbol.DeclaredAccessibility != Accessibility.Public)
Microsoft.VisualStudio.LanguageServices (12)
Library\ObjectBrowser\AbstractListItemFactory.cs (1)
159return symbol.DeclaredAccessibility is Accessibility.Protected or Accessibility.ProtectedOrInternal
Library\ObjectBrowser\Lists\SymbolListItem.cs (1)
27Accessibility = symbol.DeclaredAccessibility;
Progression\GraphBuilder.cs (9)
225node[RoslynGraphProperties.DeclaredAccessibility] = symbol.DeclaredAccessibility; 435switch (symbol.DeclaredAccessibility) 611node[DgmlNodeProperties.Icon] = IconHelper.GetIconName(iconGroupName, namedType.DeclaredAccessibility); 626? IconHelper.GetIconName("Operator", method.DeclaredAccessibility) 627: IconHelper.GetIconName("Method", method.DeclaredAccessibility); 644node[DgmlNodeProperties.Icon] = IconHelper.GetIconName("EnumMember", field.DeclaredAccessibility); 648node[DgmlNodeProperties.Icon] = IconHelper.GetIconName("Field", field.DeclaredAccessibility); 661node[DgmlNodeProperties.Icon] = IconHelper.GetIconName("Property", property.DeclaredAccessibility); 674node[DgmlNodeProperties.Icon] = IconHelper.GetIconName("Event", eventSymbol.DeclaredAccessibility);
Utilities\MemberSymbolViewModel.cs (1)
53public string Accessibility => Symbol.DeclaredAccessibility.ToString();
Microsoft.VisualStudio.LanguageServices.CSharp (7)
CodeModel\CSharpCodeModelService.cs (2)
1006return symbol.DeclaredAccessibility is Accessibility.Public 1032=> symbol.DeclaredAccessibility switch
ObjectBrowser\DescriptionBuilder.cs (5)
134switch (symbol.DeclaredAccessibility) 510if (propertySymbol.GetMethod.DeclaredAccessibility != propertySymbol.DeclaredAccessibility) 520if (propertySymbol.SetMethod.DeclaredAccessibility != propertySymbol.DeclaredAccessibility)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
GlyphExtensionsTests.cs (1)
209symbolMock.SetupGet(s => s.DeclaredAccessibility).Returns(declaredAccessibility);
Microsoft.VisualStudio.LanguageServices.VisualBasic (8)
CodeModel\VisualBasicCodeModelService.vb (6)
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 1433Select Case symbol.DeclaredAccessibility
CodeModel\VisualBasicCodeModelService_Prototype.vb (1)
118AppendAccessibility(builder, symbol.DeclaredAccessibility)
ObjectBrowser\DescriptionBuilder.vb (1)
290Select Case symbol.DeclaredAccessibility
System.Text.Json.SourceGeneration (7)
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 (1)
117switch (symbol.DeclaredAccessibility)
System.Text.RegularExpressions.Generator (1)
src\libraries\Common\src\Roslyn\GetBestTypeByMetadataName.cs (1)
117switch (symbol.DeclaredAccessibility)
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