Esempio n. 1
0
 // 6.0 TODO: Move to IComponentAttributesMapper
 public static void LazyGroup(this IComponentAttributesMapper mapper, string name)
 {
     if (mapper is ComponentMapper component)
     {
         component.LazyGroup(name);
     }
 }
Esempio n. 2
0
 // 6.0 TODO: Move to IComponentAttributesMapper<TComponent>
 public static void LazyGroup <TComponent>(this IComponentAttributesMapper <TComponent> mapper, string name)
 {
     if (mapper is ComponentCustomizer <TComponent> component)
     {
         component.LazyGroup(name);
     }
     else if (mapper is ComponentElementCustomizer <TComponent> componentElement)
     {
         componentElement.LazyGroup(name);
     }
 }
		protected virtual void ComponentParentNoSetterToField(IModelInspector modelInspector, PropertyPath member, IComponentAttributesMapper componentMapper)
		{
			System.Type componentType = member.LocalMember.GetPropertyOrFieldType();
			IEnumerable<MemberInfo> persistentProperties =
				MembersProvider.GetComponentMembers(componentType).Where(p => ModelInspector.IsPersistentProperty(p));

			MemberInfo parentReferenceProperty = GetComponentParentReferenceProperty(persistentProperties, member.LocalMember.ReflectedType);
			if (parentReferenceProperty != null && MatchNoSetterProperty(parentReferenceProperty))
			{
				componentMapper.Parent(parentReferenceProperty, cp => cp.Access(Accessor.NoSetter));
			}
		}
        protected virtual void ComponentParentNoSetterToField(IModelInspector modelInspector, PropertyPath member, IComponentAttributesMapper componentMapper)
        {
            Type componentType = member.LocalMember.GetPropertyOrFieldType();
            IEnumerable <MemberInfo> persistentProperties = MembersProvider
                                                            .GetComponentMembers(componentType)
                                                            .Where(p => ModelInspector.IsPersistentProperty(p));

            MemberInfo parentReferenceProperty = GetComponentParentReferenceProperty(persistentProperties, member.LocalMember.ReflectedType);

            if (parentReferenceProperty != null && MatchNoSetterProperty(parentReferenceProperty))
            {
                componentMapper.Parent(parentReferenceProperty, cp => cp.Access(Accessor.NoSetter));
            }
        }
Esempio n. 5
0
 public static void MapComponent(IModelInspector modelInspector, PropertyPath member, IComponentAttributesMapper map)
 {
 }
 public void InvokeCustomizers(PropertyPath member, IComponentAttributesMapper mapper)
 {
     InvokeCustomizers(componentPropertyCustomizers, member, mapper);
 }
 public void InvokeCustomizers(System.Type type, IComponentAttributesMapper mapper)
 {
     InvokeCustomizers(componentClassCustomizers, type, mapper);
 }
 protected virtual void OnBeforeMapComponent(IModelInspector modelInspector, PropertyPath member, IComponentAttributesMapper propertyCustomizer)
 {
 }
        private void DisableComponentParentAutomapping(IModelInspector inspector, PropertyPath member, IComponentAttributesMapper customizer)
        {
            var parentMapping = member.LocalMember.GetPropertyOrFieldType().GetFirstPropertyOfType(member.Owner());

            DisableAutomappingFor(parentMapping);
        }
Esempio n. 10
0
 protected virtual void OnAfterMapComponent(IModelInspector modelInspector, PropertyPath member, IComponentAttributesMapper propertyCustomizer)
 {
 }
 private void DisableComponentParentAutomapping(IModelInspector inspector, PropertyPath member, IComponentAttributesMapper customizer)
 {
     var parentMapping = member.LocalMember.GetPropertyOrFieldType().GetFirstPropertyOfType(member.Owner());
     DisableAutomappingFor(parentMapping);
 }