Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 public PropertyWeaverBase(CatelType catelType, CatelTypeProperty propertyData, ModuleWeaver moduleWeaver,
                           MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _catelType             = catelType;
     _propertyData          = propertyData;
     _moduleWeaver          = moduleWeaver;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
Ejemplo n.º 4
0
 public ObservableObjectPropertyWeaver(CatelType catelType, CatelTypeProperty propertyData, ModuleWeaver moduleWeaver,
                                       MsCoreReferenceFinder msCoreReferenceFinder)
     : base(catelType, propertyData, moduleWeaver, msCoreReferenceFinder)
 {
 }
Ejemplo n.º 5
0
 public ModelBasePropertyWeaver(CatelType catelType, CatelTypeProperty propertyData, Configuration configuration,
                                ModuleWeaver moduleWeaver, MsCoreReferenceFinder msCoreReferenceFinder)
     : base(catelType, propertyData, moduleWeaver, msCoreReferenceFinder)
 {
     _configuration = configuration;
 }
Ejemplo n.º 6
0
 public CatelPropertyWeaver(CatelType catelType, CatelTypeProperty propertyData, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _catelType             = catelType;
     _propertyData          = propertyData;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }
Ejemplo n.º 7
0
 public CatelPropertyWeaver(CatelType catelType, CatelTypeProperty propertyData, MsCoreReferenceFinder msCoreReferenceFinder)
 {
     _catelType = catelType;
     _propertyData = propertyData;
     _msCoreReferenceFinder = msCoreReferenceFinder;
 }