5 implementations of IsReadOnly
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
CodeGenerationAbstractMethodSymbol.cs (1)
51public abstract bool IsReadOnly { get; }
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\MethodSymbol.cs (1)
140bool IMethodSymbol.IsReadOnly
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
33public bool IsReadOnly => _symbol.IsReadOnly;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
108Private ReadOnly Property IMethodSymbol_IsReadOnly As Boolean Implements IMethodSymbol.IsReadOnly
Microsoft.CodeAnalysis.Workspaces (1)
CodeGenerationAbstractMethodSymbol.cs (1)
51public abstract bool IsReadOnly { get; }
66 references to IsReadOnly
Microsoft.CodeAnalysis.CodeStyle (1)
DeclarationModifiers.cs (1)
82isReadOnly: field?.IsReadOnly == true || property?.IsReadOnly == true || type?.IsReadOnly == true || method?.IsReadOnly == true,
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
CastSimplifier.cs (1)
574if (methodSymbol.IsReadOnly)
CSharpMakeStructMemberReadOnlyAnalyzer.cs (3)
75IsReadOnly: false, 191!propertyReference.Property.GetMethod.IsReadOnly) 244if (methodReference.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (7)
EventGenerator.cs (1)
227if (@event.AddMethod?.IsReadOnly == true && !@event.ContainingType.IsReadOnly)
MethodGenerator.cs (1)
296if (method.IsReadOnly && (method.ContainingSymbol as INamedTypeSymbol)?.IsReadOnly != true)
PropertyGenerator.cs (5)
332var hasNonReadOnlyAccessor = property.GetMethod?.IsReadOnly == false || property.SetMethod?.IsReadOnly == false; 333if (hasNonReadOnlyAccessor && accessor.IsReadOnly) 375var hasAllReadOnlyAccessors = property.GetMethod?.IsReadOnly != false && property.SetMethod?.IsReadOnly != false;
Microsoft.CodeAnalysis.CSharp.Features (7)
CSharpMakeStructMemberReadOnlyAnalyzer.cs (3)
75IsReadOnly: false, 191!propertyReference.Property.GetMethod.IsReadOnly) 244if (methodReference.IsReadOnly)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (4)
1325if (oldPropertySymbol.GetMethod != null && newPropertySymbol.GetMethod != null && oldPropertySymbol.GetMethod.IsReadOnly != newPropertySymbol.GetMethod.IsReadOnly) 1330if (oldPropertySymbol.SetMethod != null && newPropertySymbol.SetMethod != null && oldPropertySymbol.SetMethod.IsReadOnly != newPropertySymbol.SetMethod.IsReadOnly)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (30)
Semantics\InitOnlyMemberTests.cs (7)
4250Assert.False(i.SetMethod.IsReadOnly); 4289Assert.False(i.SetMethod.IsReadOnly); 4329Assert.False(i.SetMethod.IsReadOnly); 4371Assert.False(i.SetMethod.IsReadOnly); 4394Assert.False(i.SetMethod.IsReadOnly); 4425Assert.False(i1.SetMethod.IsReadOnly); 4427Assert.False(i2.SetMethod.IsReadOnly);
Semantics\ReadOnlyStructsTests.cs (23)
1192Assert.False(getMethod(s1, "M1").IsReadOnly); 1194Assert.True(getMethod(s1, "M2").IsReadOnly); 1196Assert.True(getProperty(s1, "P1").GetMethod.IsReadOnly); 1197Assert.False(getProperty(s1, "P1").SetMethod.IsReadOnly); 1199Assert.True(getProperty(s1, "P2").GetMethod.IsReadOnly); 1201Assert.True(getProperty(s1, "P3").GetMethod.IsReadOnly); 1203Assert.True(getProperty(s1, "P4").SetMethod.IsReadOnly); 1205Assert.False(getProperty(s1, "P5").GetMethod.IsReadOnly); 1206Assert.False(getProperty(s1, "P5").SetMethod.IsReadOnly); 1208Assert.True(getEvent(s1, "E").AddMethod.IsReadOnly); 1209Assert.True(getEvent(s1, "E").RemoveMethod.IsReadOnly); 1212Assert.True(getMethod(s2, "M1").IsReadOnly); 1213Assert.False(getMethod(s2, "M2").IsReadOnly); 1215Assert.True(getProperty(s2, "P1").GetMethod.IsReadOnly); 1217Assert.True(getProperty(s2, "P2").GetMethod.IsReadOnly); 1219Assert.True(getProperty(s2, "P3").SetMethod.IsReadOnly); 1221Assert.False(getProperty(s2, "P4").GetMethod.IsReadOnly); 1222Assert.False(getProperty(s2, "P4").SetMethod.IsReadOnly); 1224Assert.True(getEvent(s2, "E").AddMethod.IsReadOnly); 1225Assert.True(getEvent(s2, "E").RemoveMethod.IsReadOnly); 1287Assert.Equal(isEffectivelyReadOnly, symbol.IsReadOnly); 1292Assert.False(((IMethodSymbol)reducedFrom).IsReadOnly); 1327Assert.Equal(isReadOnly, property.GetMethod.GetPublicSymbol().IsReadOnly);
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
CastSimplifier.cs (1)
574if (methodSymbol.IsReadOnly)
EventGenerator.cs (1)
227if (@event.AddMethod?.IsReadOnly == true && !@event.ContainingType.IsReadOnly)
MethodGenerator.cs (1)
296if (method.IsReadOnly && (method.ContainingSymbol as INamedTypeSymbol)?.IsReadOnly != true)
PropertyGenerator.cs (5)
332var hasNonReadOnlyAccessor = property.GetMethod?.IsReadOnly == false || property.SetMethod?.IsReadOnly == false; 333if (hasNonReadOnlyAccessor && accessor.IsReadOnly) 375var hasAllReadOnlyAccessors = property.GetMethod?.IsReadOnly != false && property.SetMethod?.IsReadOnly != false;
Microsoft.CodeAnalysis.Features (7)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (6)
3831if (oldMethod.IsReadOnly != newMethod.IsReadOnly) 3923if (oldEvent.AddMethod != null && newEvent.AddMethod != null && oldEvent.AddMethod.IsReadOnly != newEvent.AddMethod.IsReadOnly || 3924oldEvent.RemoveMethod != null && newEvent.RemoveMethod != null && oldEvent.RemoveMethod.IsReadOnly != newEvent.RemoveMethod.IsReadOnly)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedMethodSymbol.cs (1)
33public bool IsReadOnly => _symbol.IsReadOnly;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\MethodSymbol.vb (1)
108Private ReadOnly Property IMethodSymbol_IsReadOnly As Boolean Implements IMethodSymbol.IsReadOnly
Microsoft.CodeAnalysis.Workspaces (1)
Editing\DeclarationModifiers.cs (1)
82isReadOnly: field?.IsReadOnly == true || property?.IsReadOnly == true || type?.IsReadOnly == true || method?.IsReadOnly == true,