/// <summary>
        /// Show selected properties from the <see cref="FactType.NestingType"/> and the
        /// <see cref="Objectification.NestedFactType"/> for an objectified <see cref="FactType"/>,
        /// as well as expandable nodes for each of the underlying instances.
        /// </summary>
        public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            FactType factType = ModelElement;

            if (FactTypeShape.ShouldDrawObjectification(factType))
            {
                FactTypeShape       factTypeShape              = PresentationElement;
                Objectification     objectification            = factType.Objectification;
                ObjectType          nestingType                = objectification.NestingType;
                bool                nestingTypeHasRelatedTypes = nestingType.IsSubtypeOrSupertype;
                DomainDataDirectory domainDataDirectory        = factType.Store.DomainDataDirectory;
                EnsureDomainAttributesInitialized(domainDataDirectory);

                PropertyDescriptorCollection retVal;
                if (factTypeShape.DisplayAsObjectType)
                {
                    retVal = new PropertyDescriptorCollection(null);
                    Type componentType = typeof(FactTypeShape);
                    foreach (PropertyDescriptor nestingTypeDescriptor in TypeDescriptor.GetProperties(nestingType))
                    {
                        if (nestingTypeDescriptor.Name == "NestedFactType")
                        {
                            continue;
                        }
                        retVal.Add(EditorUtility.RedirectPropertyDescriptor(nestingType, nestingTypeDescriptor, componentType));
                    }
                    retVal.Add(CreatePropertyDescriptor(factTypeShape, domainDataDirectory.FindDomainProperty(FactTypeShape.DisplayAsObjectTypeDomainPropertyId), DisplayAsObjectTypeDomainPropertyAttributes));
                    retVal.Add(CreatePropertyDescriptor(factTypeShape, domainDataDirectory.FindDomainProperty(FactTypeShape.ExpandRefModeDomainPropertyId), ExpandRefModeDomainPropertyAttributes));
                    retVal.Add(new ObjectifyingEntityTypePropertyDescriptor(factType, domainDataDirectory.FindDomainRole(Objectification.NestingTypeDomainRoleId), NestedFactTypeDomainRoleAttributes));
                    retVal.Add(new ObjectifiedFactTypePropertyDescriptor(nestingType, domainDataDirectory.FindDomainRole(Objectification.NestedFactTypeDomainRoleId), NestingTypeDomainRoleAttributes));
                    if (nestingTypeHasRelatedTypes)
                    {
                        retVal.Add(CreatePropertyDescriptor(factTypeShape, domainDataDirectory.FindDomainProperty(FactTypeShape.DisplayRelatedTypesDomainPropertyId), DisplayRelatedTypesDomainPropertyAttributes));
                    }
                }
                else
                {
                    PropertyDescriptor[] descriptors = new PropertyDescriptor[nestingTypeHasRelatedTypes ? 9 : 8];
                    descriptors[0] = CreatePropertyDescriptor(factTypeShape, domainDataDirectory.FindDomainProperty(FactTypeShape.ConstraintDisplayPositionDomainPropertyId), ConstraintDisplayPositionDomainPropertyAttributes);
                    descriptors[1] = CreatePropertyDescriptor(factTypeShape, domainDataDirectory.FindDomainProperty(FactTypeShape.DisplayOrientationDomainPropertyId), DisplayOrientationDomainPropertyAttributes);
                    descriptors[2] = CreatePropertyDescriptor(factTypeShape, domainDataDirectory.FindDomainProperty(FactTypeShape.DisplayRoleNamesDomainPropertyId), DisplayRoleNamesDomainPropertyAttributes);
                    descriptors[3] = CreatePropertyDescriptor(factTypeShape, domainDataDirectory.FindDomainProperty(FactTypeShape.DisplayAsObjectTypeDomainPropertyId), DisplayAsObjectTypeDomainPropertyAttributes);
                    descriptors[4] = CreatePropertyDescriptor(nestingType, domainDataDirectory.FindDomainProperty(ORMNamedElement.NameDomainPropertyId), NameDomainPropertyAttributes);
                    descriptors[5] = CreatePropertyDescriptor(nestingType, domainDataDirectory.FindDomainProperty(ObjectType.IsIndependentDomainPropertyId), IsIndependentDomainPropertyAttributes);
                    descriptors[6] = new ObjectifyingEntityTypePropertyDescriptor(factType, domainDataDirectory.FindDomainRole(Objectification.NestingTypeDomainRoleId), NestedFactTypeDomainRoleAttributes);
                    descriptors[7] = new ObjectifiedFactTypePropertyDescriptor(nestingType, domainDataDirectory.FindDomainRole(Objectification.NestedFactTypeDomainRoleId), NestingTypeDomainRoleAttributes);
                    if (nestingTypeHasRelatedTypes)
                    {
                        descriptors[8] = CreatePropertyDescriptor(factTypeShape, domainDataDirectory.FindDomainProperty(FactTypeShape.DisplayRelatedTypesDomainPropertyId), DisplayRelatedTypesDomainPropertyAttributes);
                    }
                    retVal = new PropertyDescriptorCollection(descriptors);
                }

                // This mockup of important properties means that extension providers cannot add properties
                // here by adding to the objecttype or facttype. Use an extension on the Objectification type
                // itself to add extension properties.
                ((IFrameworkServices)factType.Store).PropertyProviderService.GetProvidedProperties(objectification, retVal);
                return(retVal);
            }
            return(base.GetProperties(attributes));
        }