Example #1
0
        public void ClearAllEdges(IGraphicsCompositorSlotViewModel slot)
        {
            var linksToRemove = edges.Select(GetLink).Where(x => x.SourceSlot == slot || x.TargetSlot == slot).ToList();

            foreach (var link in linksToRemove)
            {
                RemoveEdge(link);
            }
        }
 private void AddOutputSlot(IGraphicsCompositorSlotViewModel slot)
 {
     OutputSlots.Add(slot);
     foreach (var link in slot.Links)
     {
         graph.CreateEdge(link);
     }
     slot.Links.CollectionChanged += LinksCollectionChanged;
 }
 private void RemoveOutputSlot(IGraphicsCompositorSlotViewModel slot)
 {
     foreach (var link in slot.Links)
     {
         graph.RemoveEdge(link);
     }
     slot.Links.CollectionChanged -= LinksCollectionChanged;
     OutputSlots.Remove(slot);
 }
 internal IGraphicsCompositorLinkViewModel CreateLink([NotNull] IGraphicsCompositorSlotViewModel source, [NotNull] IGraphicsCompositorSlotViewModel target)
 {
     if (source == null)
     {
         throw new ArgumentNullException(nameof(source));
     }
     if (target == null)
     {
         throw new ArgumentNullException(nameof(target));
     }
     return(new GraphicsCompositorLinkViewModel(ServiceProvider, (GraphicsCompositorSlotViewModel)source, (GraphicsCompositorSlotViewModel)target));
 }
Example #5
0
 public override void LinkTo(IGraphicsCompositorSlotViewModel target)
 {
     using (var transaction = ServiceProvider.Get <IUndoRedoService>().CreateTransaction())
     {
         var sharedRenderer = target as SharedRendererInputSlotViewModel;
         if (sharedRenderer != null)
         {
             if (Accessor.AcceptValue(sharedRenderer.GetSharedRenderer()))
             {
                 var newValue = sharedRenderer.GetSharedRenderer();
                 Accessor.UpdateValue(newValue);
             }
         }
         ServiceProvider.Get <IUndoRedoService>().SetName(transaction, $"Connect {Name} to {target.Name}");
     }
 }
 public override void LinkTo(IGraphicsCompositorSlotViewModel target)
 {
     // TODO: we could easily support linking in that direction
     throw new System.NotImplementedException();
 }
 private void RemoveInputSlot(IGraphicsCompositorSlotViewModel slot)
 {
     InputSlots.Remove(slot);
 }
 private void AddInputSlot(IGraphicsCompositorSlotViewModel slot)
 {
     InputSlots.Add(slot);
 }
 public abstract void LinkTo(IGraphicsCompositorSlotViewModel target);