private void AddCatelTypeIfRequired(TypeDefinition typeDefinition)
{
if (typeDefinition == null)
{
return;
}
if (typeDefinition.BaseType == null)
{
return;
}
if (typeDefinition.IsDecoratedWithAttribute("Catel.Fody.NoWeavingAttribute"))
{
FodyEnvironment.LogDebug($"\t{typeDefinition.FullName} is decorated with the NoWeaving attribute, type will be ignored.");
typeDefinition.RemoveAttribute("Catel.Fody.NoWeavingAttribute");
return;
}
if (!typeDefinition.ImplementsCatelModel())
{
return;
}
var typeNode = new CatelType(typeDefinition);
if (typeNode.Ignore || CatelTypes.Contains(typeNode))
{
return;
}
CatelTypes.Add(typeNode);
}
#endregion