[linker] Add API to notify subclasses of removed attributes.
authorRolf Bjarne Kvinge <rolf@xamarin.com>
Sat, 23 Jan 2016 02:08:56 +0000 (03:08 +0100)
committerRolf Bjarne Kvinge <rolf@xamarin.com>
Sat, 23 Jan 2016 02:11:07 +0000 (03:11 +0100)
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) { }
        }
 }