Exemplo n.º 1
0
        internal void MoveOperatorTo(Guid opIdToMove, Guid newParentId)
        {
            var opToMove  = InternalOps.Single(op => op.ID == opIdToMove);
            var newParent = InternalOps.Single(op => op.ID == newParentId);

            RemoveOperatorInternal(opToMove, disposeOpResources: false);
            newParent.AddOperator(opToMove);
        }
Exemplo n.º 2
0
 public void Dispose()
 {
     Inputs.ForEach(i => i.Dispose());
     Outputs.ForEach(o => o.Dispose());
     InternalOps.ForEach(o => o.Dispose());
     InternalParts.ForEach(p => p.Dispose());
     Definition.RemoveInstance(this);
 }
Exemplo n.º 3
0
        internal void ReplaceConnectionAt(Connection connection)
        {
            // first extract prev connection that should be replaced
            var prevSourceOpPart = connection.TargetOpPart.Connections[connection.Index];
            var opResult         = InternalOps.Find(op => op.Outputs.Exists(opPart => opPart == prevSourceOpPart));
            var prevSourceOp     = opResult ?? this;

            RemoveConnection(new Connection(prevSourceOp, prevSourceOpPart, connection.TargetOp, connection.TargetOpPart, connection.Index));
            InsertConnectionAt(connection);
        }
Exemplo n.º 4
0
        internal void RemoveOperatorInternal(Operator op, bool disposeOpResources)
        {
            InternalOps.Remove(op);

            EventExt.Raise(OperatorRemovedEvent, this, new OperatorChangedEventArgs(op));

            if (disposeOpResources)
            {
                op.Dispose(); // clean up all resources locked by op
            }
        }
Exemplo n.º 5
0
 internal void AddOperator(Operator op)
 {
     InternalOps.Add(op);
     op.Parent = this;
     EventExt.Raise(OperatorAddedEvent, this, new OperatorChangedEventArgs(op));
 }