diff --git a/Extensions/dnSpy.Analyzer/TreeNodes/InterfaceEventImplementedByNode.cs b/Extensions/dnSpy.Analyzer/TreeNodes/InterfaceEventImplementedByNode.cs index 8ac48440e3..639ae6506f 100644 --- a/Extensions/dnSpy.Analyzer/TreeNodes/InterfaceEventImplementedByNode.cs +++ b/Extensions/dnSpy.Analyzer/TreeNodes/InterfaceEventImplementedByNode.cs @@ -1,14 +1,14 @@ // Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy of this // software and associated documentation files (the "Software"), to deal in the Software // without restriction, including without limitation the rights to use, copy, modify, merge, // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons // to whom the Software is furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE @@ -77,7 +77,7 @@ IEnumerable FindReferencesInType(TypeDef type) { foreach (EventDef ev in type.Events.Where(e => e.Name.EndsWith(analyzedEvent.Name))) { var accessor = GetAccessor(ev); // Don't include abstract accessors, they don't implement anything - if (accessor is null || !accessor.IsVirtual || accessor.IsAbstract) + if (accessor is null || (!accessor.IsVirtual && !accessor.IsStatic) || accessor.IsAbstract) continue; if (accessor.HasOverrides && accessor.Overrides.Any(m => CheckEquals(m.MethodDeclaration.ResolveMethodDef(), analyzedMethod))) { yield return new EventNode(ev) { Context = Context }; @@ -88,7 +88,7 @@ IEnumerable FindReferencesInType(TypeDef type) { foreach (EventDef ev in type.Events.Where(e => e.Name == analyzedEvent.Name)) { var accessor = GetAccessor(ev); // Don't include abstract accessors, they don't implement anything - if (accessor is null || !accessor.IsVirtual || accessor.IsAbstract) + if (accessor is null || (!accessor.IsVirtual && !accessor.IsStatic) || accessor.IsAbstract) continue; if (TypesHierarchyHelpers.MatchInterfaceMethod(accessor, analyzedMethod, implementedInterfaceRef)) { yield return new EventNode(ev) { Context = Context }; diff --git a/Extensions/dnSpy.Analyzer/TreeNodes/InterfaceMethodImplementedByNode.cs b/Extensions/dnSpy.Analyzer/TreeNodes/InterfaceMethodImplementedByNode.cs index f255c157e8..fc92dee9d1 100644 --- a/Extensions/dnSpy.Analyzer/TreeNodes/InterfaceMethodImplementedByNode.cs +++ b/Extensions/dnSpy.Analyzer/TreeNodes/InterfaceMethodImplementedByNode.cs @@ -1,14 +1,14 @@ // Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy of this // software and associated documentation files (the "Software"), to deal in the Software // without restriction, including without limitation the rights to use, copy, modify, merge, // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons // to whom the Software is furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE @@ -57,7 +57,7 @@ IEnumerable FindReferencesInType(TypeDef type) { foreach (var method in type.Methods) { // Don't include abstract methods, they don't implement anything - if (!method.IsVirtual || method.IsAbstract) + if ((!method.IsVirtual && !method.IsStatic) || method.IsAbstract) continue; if (method.HasOverrides && method.Overrides.Any(m => CheckOverride(m))) { yield return new MethodNode(method) { Context = Context }; @@ -80,7 +80,7 @@ IEnumerable FindReferencesInType(TypeDef type) { if (implementedInterfaceRef is not null) { foreach (var method in type.Methods) { // Don't include abstract methods, they don't implement anything - if (!method.IsVirtual || method.IsAbstract) + if ((!method.IsVirtual && !method.IsStatic) || method.IsAbstract) continue; if (method.Name != analyzedMethod.Name) continue; diff --git a/Extensions/dnSpy.Analyzer/TreeNodes/InterfacePropertyImplementedByNode.cs b/Extensions/dnSpy.Analyzer/TreeNodes/InterfacePropertyImplementedByNode.cs index 094896287a..2001707274 100644 --- a/Extensions/dnSpy.Analyzer/TreeNodes/InterfacePropertyImplementedByNode.cs +++ b/Extensions/dnSpy.Analyzer/TreeNodes/InterfacePropertyImplementedByNode.cs @@ -1,14 +1,14 @@ // Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy of this // software and associated documentation files (the "Software"), to deal in the Software // without restriction, including without limitation the rights to use, copy, modify, merge, // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons // to whom the Software is furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in all copies or // substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE @@ -65,7 +65,7 @@ IEnumerable FindReferencesInType(TypeDef type) { foreach (PropertyDef property in type.Properties.Where(e => e.Name.EndsWith(analyzedProperty.Name))) { MethodDef accessor = isGetter ? property.GetMethod : property.SetMethod; // Don't include abstract accessors, they don't implement anything - if (accessor is null || !accessor.IsVirtual || accessor.IsAbstract) + if (accessor is null || (!accessor.IsVirtual && !accessor.IsStatic) || accessor.IsAbstract) continue; if (accessor.HasOverrides && accessor.Overrides.Any(m => CheckEquals(m.MethodDeclaration.ResolveMethodDef(), analyzedMethod))) { yield return new PropertyNode(property) { Context = Context }; @@ -76,7 +76,7 @@ IEnumerable FindReferencesInType(TypeDef type) { foreach (PropertyDef property in type.Properties.Where(e => e.Name == analyzedProperty.Name)) { MethodDef accessor = isGetter ? property.GetMethod : property.SetMethod; // Don't include abstract accessors, they don't implement anything - if (accessor is null || !accessor.IsVirtual || accessor.IsAbstract) + if (accessor is null || (!accessor.IsVirtual && !accessor.IsStatic) || accessor.IsAbstract) continue; if (TypesHierarchyHelpers.MatchInterfaceMethod(accessor, analyzedMethod, implementedInterfaceRef)) { yield return new PropertyNode(property) { Context = Context };