/// <summary> /// Create a fragment event type. /// </summary> /// <param name="propertyType">property return type</param> /// <param name="genericType">property generic type parameter, or null if none</param> /// <param name="beanEventTypeFactory">for event types</param> /// <param name="publicFields">indicator whether classes are public-field-property-accessible</param> /// <returns>fragment type</returns> public static FragmentEventType CreateNativeFragmentType( Type propertyType, Type genericType, BeanEventTypeFactory beanEventTypeFactory, bool publicFields) { var isIndexed = false; if (propertyType.IsArray) { isIndexed = true; propertyType = propertyType.GetElementType(); } else if (propertyType.IsGenericDictionary()) { // Ignore this - technically enumerable } else if (propertyType.IsGenericEnumerable()) { propertyType = GenericExtensions .FindGenericEnumerationInterface(propertyType) .GetGenericArguments()[0]; isIndexed = true; #if false if (genericType == null) { return null; } propertyType = genericType; #endif } if (!propertyType.IsFragmentableType()) { return null; } EventType type = beanEventTypeFactory.GetCreateBeanType(propertyType, publicFields); return new FragmentEventType(type, isIndexed, true); }