5 implementations of IsReadOnly
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
CodeGenerationFieldSymbol.cs (1)
76public bool IsReadOnly
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\FieldSymbol.cs (1)
84bool IFieldSymbol.IsReadOnly => _underlying.IsReadOnly;
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedFieldSymbol.cs (1)
42public bool IsReadOnly => _symbol.IsReadOnly;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\FieldSymbol.vb (1)
85Public MustOverride ReadOnly Property IsReadOnly As Boolean Implements IFieldSymbol.IsReadOnly
Microsoft.CodeAnalysis.Workspaces (1)
CodeGenerationFieldSymbol.cs (1)
76public bool IsReadOnly
47 references to IsReadOnly
Microsoft.CodeAnalysis.CodeStyle (8)
AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
136IsReadOnly: false,
AbstractUseAutoPropertyAnalyzer.cs (2)
208if (getterField.IsReadOnly && !SupportsReadOnlyProperties(compilation)) 220if (!getterField.IsReadOnly && getterField.Type.IsMutableValueType() != false)
DeclarationModifiers.cs (1)
82isReadOnly: field?.IsReadOnly == true || property?.IsReadOnly == true || type?.IsReadOnly == true || method?.IsReadOnly == true,
INamedTypeSymbolExtensions.cs (1)
467!fieldSymbol.IsReadOnly &&
ISymbolExtensions.cs (1)
267IFieldSymbol fieldSymbol => !fieldSymbol.IsReadOnly && !fieldSymbol.IsConst,
ITypeSymbolExtensions.cs (1)
691if (!fieldSymbol.IsConst && !fieldSymbol.IsReadOnly && !fieldSymbol.IsStatic)
SymbolSpecification.cs (1)
535if (kind == SymbolKind.Field && ((IFieldSymbol)symbol).IsReadOnly)
Microsoft.CodeAnalysis.CSharp (1)
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
907if (symbol.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
74.Any(field => field is { AssociatedSymbol: null, IsStatic: false, IsReadOnly: true });
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
170if (operation is IFieldReferenceOperation { Field.IsReadOnly: false } fieldReference &&
CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
106if (!field.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
FieldGenerator.cs (1)
136if (field.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.Features (4)
CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
74.Any(field => field is { AssociatedSymbol: null, IsStatic: false, IsReadOnly: true });
CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
170if (operation is IFieldReferenceOperation { Field.IsReadOnly: false } fieldReference &&
CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
106if (!field.IsReadOnly)
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
102new DeclarationModifiers(isStatic: field.IsStatic, isReadOnly: field.IsReadOnly, isConst: field.IsConst),
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\RecordStructTests.cs (2)
1771Assert.False(xBackingField.IsReadOnly); 1818Assert.True(xBackingField.IsReadOnly);
Semantics\RecordTests.cs (1)
908Assert.True(xBackingField.IsReadOnly);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
FieldGenerator.cs (1)
136if (field.IsReadOnly)
Microsoft.CodeAnalysis.Features (12)
AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
136IsReadOnly: false,
AbstractUseAutoPropertyAnalyzer.cs (2)
208if (getterField.IsReadOnly && !SupportsReadOnlyProperties(compilation)) 220if (!getterField.IsReadOnly && getterField.Type.IsMutableValueType() != false)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (2)
3808oldField.IsReadOnly != newField.IsReadOnly ||
EncapsulateField\AbstractEncapsulateFieldService.cs (3)
266if (field.IsReadOnly) 380modifiers: new DeclarationModifiers(isStatic: field.IsStatic, isReadOnly: field.IsReadOnly, isUnsafe: field.RequiresUnsafeModifier()), 387setMethod: field.IsReadOnly || field.IsConst ? null : CreateSet(fieldName, field, factory)));
ExtractMethod\MethodExtractor.Analyzer.cs (1)
919if (!field.IsReadOnly)
GenerateMember\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
414=> symbol is IFieldSymbol field && field.IsReadOnly;
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
636!field.IsReadOnly &&
MetadataAsSource\AbstractMetadataAsSourceService.WrappedFieldSymbol.cs (1)
42public bool IsReadOnly => _symbol.IsReadOnly;
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
92if (!field.IsConst && !field.IsReadOnly && !assignedToFields.Contains(field))
Microsoft.CodeAnalysis.VisualBasic (2)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (1)
603If symbol.IsReadOnly Then
Symbols\FieldSymbol.vb (1)
85Public MustOverride ReadOnly Property IsReadOnly As Boolean Implements IFieldSymbol.IsReadOnly
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
CodeGeneration\FieldGenerator.vb (1)
118If field.IsReadOnly Then
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
84Return Not field.IsReadOnly AndAlso Not field.IsConst
Microsoft.CodeAnalysis.Workspaces (5)
Editing\DeclarationModifiers.cs (1)
82isReadOnly: field?.IsReadOnly == true || property?.IsReadOnly == true || type?.IsReadOnly == true || method?.IsReadOnly == true,
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs\INamedTypeSymbolExtensions.cs (1)
467!fieldSymbol.IsReadOnly &&
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs\ISymbolExtensions.cs (1)
267IFieldSymbol fieldSymbol => !fieldSymbol.IsReadOnly && !fieldSymbol.IsConst,
J\s\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs\ITypeSymbolExtensions.cs (1)
691if (!fieldSymbol.IsConst && !fieldSymbol.IsReadOnly && !fieldSymbol.IsStatic)
SymbolSpecification.cs (1)
535if (kind == SymbolKind.Field && ((IFieldSymbol)symbol).IsReadOnly)
Microsoft.VisualStudio.LanguageServices.CSharp (1)
ObjectBrowser\DescriptionBuilder.cs (1)
290if (fieldSymbol != null && fieldSymbol.IsReadOnly)
Microsoft.VisualStudio.LanguageServices.Implementation (2)
CodeModel\ExternalElements\ExternalCodeVariable.cs (2)
75|| fieldSymbol.IsReadOnly; 116else if (fieldSymbol.IsReadOnly)
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
ObjectBrowser\DescriptionBuilder.vb (1)
347If fieldSymbol IsNot Nothing AndAlso fieldSymbol.IsReadOnly Then