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);
        }
        private void AddNewRenderFeature(AbstractNodeType abstractNodeType)
        {
            using (var transaction = UndoRedoService.CreateTransaction())
            {
                var renderFeature = abstractNodeType.GenerateValue(null);
                renderFeaturesNode.Add(renderFeature);

                UndoRedoService.SetName(transaction, "Create new render feature");
            }
        }
Beispiel #3
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);
        }
 public AbstractTokenElement(AbstractNodeType tokenNodeType) : base(tokenNodeType)
 {
 }
 public AbstractTokenElement(AbstractNodeType tokenNodeType) : base(tokenNodeType) { }