private string GetChangeNotificationHandlerFieldName(PropertyDefinition property)
{
string key = $"{property.DeclaringType.FullName}|{property.Name}";
if (_cachedFieldNames.ContainsKey(key))
{
return _cachedFieldNames[key];
}
int counter = 2; // start at 2
while (true)
{
string fieldName = $"CS$<>9__CachedAnonymousMethodDelegate{counter}";
if (GetFieldDefinition(property.DeclaringType, fieldName, false) == null)
{
_cachedFieldNames[key] = fieldName;
return fieldName;
}
counter++;
}
}