62 references to ReadOnly
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
104
=> (modifiers - DeclarationModifiers.Volatile) | DeclarationModifiers.
ReadOnly
;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableCodeFixProvider.cs (2)
56
(fieldDeclarationModifiers & DeclarationModifiers.
ReadOnly
) == DeclarationModifiers.
ReadOnly
;
Microsoft.CodeAnalysis.CSharp.Features (3)
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (1)
228
DeclarationModifiers.
ReadOnly
,
src\Analyzers\CSharp\CodeFixes\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableCodeFixProvider.cs (2)
56
(fieldDeclarationModifiers & DeclarationModifiers.
ReadOnly
) == DeclarationModifiers.
ReadOnly
;
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
CodeGeneration\CSharpSyntaxGenerator.cs (9)
409
var actualModifiers = modifiers - (DeclarationModifiers.
ReadOnly
| DeclarationModifiers.WriteOnly);
500
var actualModifiers = modifiers - (DeclarationModifiers.
ReadOnly
| DeclarationModifiers.WriteOnly);
1438
DeclarationModifiers.
ReadOnly
|
1452
DeclarationModifiers.
ReadOnly
|
1469
DeclarationModifiers.
ReadOnly
|
1481
DeclarationModifiers.
ReadOnly
|
1492
DeclarationModifiers.
ReadOnly
|
1518
DeclarationModifiers.
ReadOnly
|
1525
private static readonly DeclarationModifiers s_propertyAccessorModifiers = s_eventAccessorModifiers | DeclarationModifiers.
ReadOnly
;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
137
SyntaxKind.ReadOnlyKeyword => DeclarationModifiers.
ReadOnly
,
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (24)
CodeGeneration\SyntaxGeneratorTests.cs (24)
793
Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), accessibility: Accessibility.NotApplicable, modifiers: DeclarationModifiers.Static | DeclarationModifiers.
ReadOnly
),
1034
Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract | DeclarationModifiers.
ReadOnly
),
1042
Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.
ReadOnly
),
1046
Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.
ReadOnly
, getAccessorStatements: []),
1066
Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers: DeclarationModifiers.
ReadOnly
, getAccessorStatements: [Generator.IdentifierName("y")]),
1086
Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.Abstract | DeclarationModifiers.
ReadOnly
),
1098
Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.
ReadOnly
),
1106
Generator.IndexerDeclaration([Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))], Generator.IdentifierName("x"), modifiers: DeclarationModifiers.
ReadOnly
,
1638
Generator.InterfaceDeclaration("i", members: [Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility: Accessibility.Public, modifiers: DeclarationModifiers.
ReadOnly
)]),
1646
Generator.InterfaceDeclaration("i", members: [Generator.IndexerDeclaration([Generator.ParameterDeclaration("y", Generator.IdentifierName("x"))], Generator.IdentifierName("t"), Accessibility.Public, DeclarationModifiers.
ReadOnly
)]),
3045
DeclarationModifiers.New | DeclarationModifiers.Partial | DeclarationModifiers.Unsafe | DeclarationModifiers.
ReadOnly
,
3061
DeclarationModifiers.Const | DeclarationModifiers.New | DeclarationModifiers.
ReadOnly
| DeclarationModifiers.Static | DeclarationModifiers.Unsafe,
3073
DeclarationModifiers.Abstract | DeclarationModifiers.Async | DeclarationModifiers.New | DeclarationModifiers.Override | DeclarationModifiers.Partial | DeclarationModifiers.Sealed | DeclarationModifiers.Static | DeclarationModifiers.Virtual | DeclarationModifiers.Unsafe | DeclarationModifiers.
ReadOnly
,
3077
DeclarationModifiers.Abstract | DeclarationModifiers.New | DeclarationModifiers.Override | DeclarationModifiers.
ReadOnly
| DeclarationModifiers.Sealed | DeclarationModifiers.Static | DeclarationModifiers.Virtual | DeclarationModifiers.Unsafe,
3081
DeclarationModifiers.Abstract | DeclarationModifiers.New | DeclarationModifiers.Override | DeclarationModifiers.
ReadOnly
| DeclarationModifiers.Sealed | DeclarationModifiers.Static | DeclarationModifiers.Virtual | DeclarationModifiers.Unsafe,
3085
DeclarationModifiers.Abstract | DeclarationModifiers.New | DeclarationModifiers.Override | DeclarationModifiers.Sealed | DeclarationModifiers.Static | DeclarationModifiers.Virtual | DeclarationModifiers.Unsafe | DeclarationModifiers.
ReadOnly
,
3089
DeclarationModifiers.Abstract | DeclarationModifiers.New | DeclarationModifiers.Override | DeclarationModifiers.Sealed | DeclarationModifiers.Static | DeclarationModifiers.Virtual | DeclarationModifiers.Unsafe | DeclarationModifiers.
ReadOnly
,
3093
DeclarationModifiers.Abstract | DeclarationModifiers.New | DeclarationModifiers.Override | DeclarationModifiers.Virtual | DeclarationModifiers.
ReadOnly
,
3834
var xReadOnly = Generator.WithModifiers(declX, DeclarationModifiers.
ReadOnly
);
3837
Assert.Equal(DeclarationModifiers.
ReadOnly
, Generator.GetModifiers(xReadOnly));
4806
TestModifiersAsync(DeclarationModifiers.
ReadOnly
,
4830
TestModifiersAsync(DeclarationModifiers.Virtual | DeclarationModifiers.
ReadOnly
,
4841
TestModifiersAsync(DeclarationModifiers.
ReadOnly
| DeclarationModifiers.Required,
4885
TestModifiersAsync(DeclarationModifiers.
ReadOnly
| DeclarationModifiers.Sealed,
Microsoft.CodeAnalysis.Features (2)
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
303
DeclarationModifiers.
ReadOnly
,
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (1)
104
=> (modifiers - DeclarationModifiers.Volatile) | DeclarationModifiers.
ReadOnly
;
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (3)
22
Public Shared ReadOnly s_fieldModifiers As DeclarationModifiers = DeclarationModifiers.Const Or DeclarationModifiers.[New] Or DeclarationModifiers.
ReadOnly
Or DeclarationModifiers.Static Or DeclarationModifiers.WithEvents
25
Public Shared ReadOnly s_propertyModifiers As DeclarationModifiers = DeclarationModifiers.Abstract Or DeclarationModifiers.[New] Or DeclarationModifiers.Override Or DeclarationModifiers.
ReadOnly
Or DeclarationModifiers.WriteOnly Or DeclarationModifiers.Sealed Or DeclarationModifiers.Static Or DeclarationModifiers.Virtual
26
Public Shared ReadOnly s_indexerModifiers As DeclarationModifiers = DeclarationModifiers.Abstract Or DeclarationModifiers.[New] Or DeclarationModifiers.Override Or DeclarationModifiers.
ReadOnly
Or DeclarationModifiers.WriteOnly Or DeclarationModifiers.Sealed Or DeclarationModifiers.Static Or DeclarationModifiers.Virtual
Microsoft.CodeAnalysis.VisualBasic.Workspaces (5)
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
877
propertyBlock = DirectCast(WithModifiers(propertyBlock, GetModifiers(propertyBlock) Or DeclarationModifiers.
ReadOnly
), PropertyBlockSyntax)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicAccessibilityFacts.vb (1)
231
modifiers = modifiers Or DeclarationModifiers.
ReadOnly
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSyntaxGeneratorInternal.vb (3)
22
Public Shared ReadOnly s_fieldModifiers As DeclarationModifiers = DeclarationModifiers.Const Or DeclarationModifiers.[New] Or DeclarationModifiers.
ReadOnly
Or DeclarationModifiers.Static Or DeclarationModifiers.WithEvents
25
Public Shared ReadOnly s_propertyModifiers As DeclarationModifiers = DeclarationModifiers.Abstract Or DeclarationModifiers.[New] Or DeclarationModifiers.Override Or DeclarationModifiers.
ReadOnly
Or DeclarationModifiers.WriteOnly Or DeclarationModifiers.Sealed Or DeclarationModifiers.Static Or DeclarationModifiers.Virtual
26
Public Shared ReadOnly s_indexerModifiers As DeclarationModifiers = DeclarationModifiers.Abstract Or DeclarationModifiers.[New] Or DeclarationModifiers.Override Or DeclarationModifiers.
ReadOnly
Or DeclarationModifiers.WriteOnly Or DeclarationModifiers.Sealed Or DeclarationModifiers.Static Or DeclarationModifiers.Virtual
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (11)
CodeGeneration\SyntaxGeneratorTests.vb (11)
840
Generator.FieldDeclaration("fld", Generator.TypeExpression(SpecialType.System_Int32), modifiers:=DeclarationModifiers.Static Or DeclarationModifiers.
ReadOnly
Or DeclarationModifiers.WithEvents),
1119
Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers:=DeclarationModifiers.Abstract + DeclarationModifiers.
ReadOnly
),
1127
Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers:=DeclarationModifiers.
ReadOnly
),
1145
Generator.PropertyDeclaration("p", Generator.IdentifierName("x"), modifiers:=DeclarationModifiers.
ReadOnly
, getAccessorStatements:={Generator.IdentifierName("y")}),
1250
Generator.IndexerDeclaration({Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))}, Generator.IdentifierName("x"), modifiers:=DeclarationModifiers.Abstract + DeclarationModifiers.
ReadOnly
),
1262
Generator.IndexerDeclaration({Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))}, Generator.IdentifierName("x"), modifiers:=DeclarationModifiers.
ReadOnly
),
1276
Generator.IndexerDeclaration({Generator.ParameterDeclaration("z", Generator.IdentifierName("y"))}, Generator.IdentifierName("x"), modifiers:=DeclarationModifiers.
ReadOnly
,
1557
Generator.InterfaceDeclaration("i", members:={Generator.PropertyDeclaration("p", Generator.IdentifierName("t"), accessibility:=Accessibility.Public, modifiers:=DeclarationModifiers.
ReadOnly
)}),
1573
Generator.InterfaceDeclaration("i", members:={Generator.IndexerDeclaration({Generator.ParameterDeclaration("y", Generator.IdentifierName("x"))}, Generator.IdentifierName("t"), Accessibility.Public, DeclarationModifiers.
ReadOnly
)}),
3525
Dim xReadOnly = Generator.WithModifiers(declX, DeclarationModifiers.
ReadOnly
)
3528
Assert.Equal(DeclarationModifiers.
ReadOnly
, Generator.GetModifiers(xReadOnly))
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
EditorConfigParsing\NamingStyleParserTests.cs (1)
201
modifier => Assert.Equal(new ModifierKind(DeclarationModifiers.
ReadOnly
), modifier));