[linker] Add API to notify subclasses of removed attributes.
[mono.git] / mcs / tools / tuner / Mono.Tuner / RemoveAttributesBase.cs
index 9f7872f7a7d9ec0cd976fcecc79368e3c9839707..61101809fd47af8f7320e2c926186f64972f380e 100644 (file)
@@ -88,13 +88,16 @@ namespace Mono.Tuner {
                                return;
 
                        for (int i = 0; i < provider.CustomAttributes.Count; i++) {
-                               if (!IsRemovedAttribute (provider.CustomAttributes [i]))
+                               var attrib = provider.CustomAttributes [i];
+                               if (!IsRemovedAttribute (attrib))
                                        continue;
 
+                               WillRemoveAttribute (provider, attrib);
                                provider.CustomAttributes.RemoveAt (i--);
                        }
                }
 
                protected abstract bool IsRemovedAttribute (CustomAttribute attribute);
+               protected virtual void WillRemoveAttribute (ICustomAttributeProvider provider, CustomAttribute attribute) { }
        }
 }