private static bool IsDecimalConstant(FieldDefinition field)
{
var fieldType = field.FieldType;
if (fieldType.Name == "Decimal" && fieldType.Namespace == "System")
{
if (field.HasCustomAttributes)
{
var attrs = field.CustomAttributes;
for (int i = 0; i < attrs.Count; i++)
{
var attrType = attrs[i].AttributeType;
if (attrType.Name == "DecimalConstantAttribute" && attrType.Namespace == "System.Runtime.CompilerServices")
return true;
}
}
}
return false;
}