|
1 | 1 | using Microsoft.CodeAnalysis; |
| 2 | + |
2 | 3 | using System; |
3 | 4 | using System.Collections; |
4 | 5 | using System.Collections.Generic; |
@@ -109,23 +110,23 @@ void GenerateClassExtensionBody() |
109 | 110 | (_.Type.Name.Contains(nameof(IList)) || _.Type.AllInterfaces.Any(e => e.Name.Contains(nameof(IList))) || _.Type.Name.Contains(nameof(ICollection)) || _.Type.AllInterfaces.Any(e => e.Name.Contains(nameof(ICollection)))) && |
110 | 111 | _.Type.AllInterfaces.Any(e => e.Name.Contains(nameof(IEnumerable))) && |
111 | 112 | !_.Type.Name.Equals(nameof(String), StringComparison.InvariantCultureIgnoreCase)) |
| 113 | + .Where(_ => !(_.Type.Name.Contains("IReadOnlyList") || _.Type.AllInterfaces.Any(e => e.Name.Contains("IReadOnlyList")))) |
112 | 114 | .ToList(); |
113 | 115 |
|
114 | | - |
115 | 116 |
|
116 | | - var events = mainSymbol |
117 | | - .GetMembers() |
118 | | - .Where(_ => _.Kind == SymbolKind.Event) |
119 | | - .Where(_ => _.DeclaredAccessibility == Accessibility.Public) |
120 | | - .Cast<IEventSymbol>() |
121 | | - .Where(_ => !_.Name.Contains('.')) |
122 | | - .Where(_ => (_.ContainingType is INamedTypeSymbol namedTypeSymbol) && namedTypeSymbol.GetFullyQualifiedName() == mainSymbol.GetFullyQualifiedName()) |
123 | | - .Where(_ => !_.GetAttributes().Any(_ => _.AttributeClass.EnsureNotNull().Equals(editorBrowsableAttribute, SymbolEqualityComparer.Default))) |
124 | | - .Where(_ => !_.GetAttributes().Any(_ => _.AttributeClass.EnsureNotNull().Name == "ObsoleteAttribute" || _.AttributeClass.EnsureNotNull().Name == "Obsolete")) |
125 | | - .GroupBy(_ => _.Name, StringComparer.OrdinalIgnoreCase) |
126 | | - .Select(_ => _.First()) |
127 | | - .OrderBy(_ => _.Name) |
128 | | - .ToArray(); |
| 117 | + var events = mainSymbol |
| 118 | + .GetMembers() |
| 119 | + .Where(_ => _.Kind == SymbolKind.Event) |
| 120 | + .Where(_ => _.DeclaredAccessibility == Accessibility.Public) |
| 121 | + .Cast<IEventSymbol>() |
| 122 | + .Where(_ => !_.Name.Contains('.')) |
| 123 | + .Where(_ => (_.ContainingType is INamedTypeSymbol namedTypeSymbol) && namedTypeSymbol.GetFullyQualifiedName() == mainSymbol.GetFullyQualifiedName()) |
| 124 | + .Where(_ => !_.GetAttributes().Any(_ => _.AttributeClass.EnsureNotNull().Equals(editorBrowsableAttribute, SymbolEqualityComparer.Default))) |
| 125 | + .Where(_ => !_.GetAttributes().Any(_ => _.AttributeClass.EnsureNotNull().Name == "ObsoleteAttribute" || _.AttributeClass.EnsureNotNull().Name == "Obsolete")) |
| 126 | + .GroupBy(_ => _.Name, StringComparer.OrdinalIgnoreCase) |
| 127 | + .Select(_ => _.First()) |
| 128 | + .OrderBy(_ => _.Name) |
| 129 | + .ToArray(); |
129 | 130 |
|
130 | 131 | if (attachedModel == null) |
131 | 132 | { |
@@ -243,7 +244,7 @@ void GenerateExtensionMethod(IPropertySymbol propertySymbol, bool isOnlyList = f |
243 | 244 | GenerateExtensionMethod_AnimateTo(info, "ColorTransform"); |
244 | 245 | } |
245 | 246 | } |
246 | | - |
| 247 | + |
247 | 248 | isGeneratedExtension = true; |
248 | 249 | } |
249 | 250 | } |
|
0 commit comments