private void UpdateAvailableTypes()
        {
            RenderFeatureTypes.Clear();
            RenderFeatureTypes.AddRange(AbstractNodeType.GetInheritedInstantiableTypes(typeof(RootRenderFeature)));

            var sharedRendererFactories = new List <SharedRendererFactoryViewModel>();

            foreach (var rendererType in typeof(ISharedRenderer).GetInheritedInstantiableTypes())
            {
                if (TypeDescriptorFactory.Default.AttributeRegistry.GetAttribute <NonInstantiableAttribute>(rendererType) != null)
                {
                    continue;
                }
                if (TypeDescriptorFactory.Default.AttributeRegistry.GetAttribute <ObsoleteAttribute>(rendererType) != null)
                {
                    continue;
                }

                sharedRendererFactories.Add(new SharedRendererFactoryViewModel(ServiceProvider, sharedRenderersNode, rendererType));
            }
            sharedRendererFactories.Sort((x, y) => string.Compare(x.Name, y.Name, StringComparison.Ordinal));

            SharedRendererFactories.Clear();
            SharedRendererFactories.AddRange(sharedRendererFactories);
        }
Ejemplo n.º 2
0
        public static IEnumerable <AbstractNodeEntry> FillDefaultAbstractNodeEntry(IAssetNodePresenter node)
        {
            var type = node.Descriptor.GetInnerCollectionType();

            IEnumerable <AbstractNodeEntry> abstractNodeMatchingEntries = AbstractNodeType.GetInheritedInstantiableTypes(type);

            if (abstractNodeMatchingEntries != null)
            {
                // Prepend the value that will allow to set the value to null, if this command is allowed.
                if (IsAllowingNull(node))
                {
                    abstractNodeMatchingEntries = AbstractNodeValue.Null.Yield().Concat(abstractNodeMatchingEntries);
                }
            }
            return(abstractNodeMatchingEntries);
        }