Exemple #1
0
        public override void UpdateLink()
        {
            var value = Accessor.RetrieveValue();

            foreach (var link in Links.Cast <GraphicsCompositorLinkViewModel>().ToList())
            {
                link.Destroy();
                link.SourceSlot.Links.Remove(link);
                link.TargetSlot.Links.Remove(link);
            }
            if (value != null)
            {
                var targetBlock = Block.Editor.GetBlock(value);
                if (targetBlock != null)
                {
                    // Shared renderers have a single input, representing the renderer itself.
                    var targetSlot = (GraphicsCompositorSlotViewModel)targetBlock.InputSlots[0];
                    var link       = Block.Editor.CreateLink(this, targetSlot);
                    Links.Add(link);
                    targetSlot.Links.Add(link);
                }
            }
        }