Example #1
0
        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);
        }
        private void AddCatelTypeIfRequired(TypeDefinition typeDefinition)
        {
            if (typeDefinition?.BaseType is null)
            {
                return;
            }

            if (typeDefinition.IsDecoratedWithAttribute("Catel.Fody.NoWeavingAttribute"))
            {
                FodyEnvironment.WriteDebug($"\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, _msCoreReferenceFinder);

            if (typeNode.Ignore || CatelTypes.Contains(typeNode))
            {
                return;
            }

            CatelTypes.Add(typeNode);
        }
 public PropertyWeaverBase(CatelType catelType, CatelTypeProperty propertyData, ModuleWeaver moduleWeaver,
                           MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _catelType             = catelType;
     _propertyData          = propertyData;
     _moduleWeaver          = moduleWeaver;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
Example #4
0
 public ObservableObjectPropertyWeaver(CatelType catelType, CatelTypeProperty propertyData, ModuleWeaver moduleWeaver,
                                       MsCoreReferenceFinder msCoreReferenceFinder)
     : base(catelType, propertyData, moduleWeaver, msCoreReferenceFinder)
 {
 }
Example #5
0
 public ModelBasePropertyWeaver(CatelType catelType, CatelTypeProperty propertyData, Configuration configuration,
                                ModuleWeaver moduleWeaver, MsCoreReferenceFinder msCoreReferenceFinder)
     : base(catelType, propertyData, moduleWeaver, msCoreReferenceFinder)
 {
     _configuration = configuration;
 }
Example #6
0
 public CatelPropertyWeaver(CatelType catelType, CatelTypeProperty propertyData, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _catelType             = catelType;
     _propertyData          = propertyData;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
Example #7
0
 public CatelPropertyWeaver(CatelType catelType, CatelTypeProperty propertyData, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _catelType = catelType;
     _propertyData = propertyData;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }