Catel.Fody.CatelPropertyWeaver.GetChangeNotificationHandlerFieldName C# (CSharp) Метод

GetChangeNotificationHandlerFieldName() приватный Метод

private GetChangeNotificationHandlerFieldName ( Mono.Cecil.PropertyDefinition property ) : string
property Mono.Cecil.PropertyDefinition
Результат string
        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++;
            }
        }