public void Dispose() { if (disposed) { throw new ObjectDisposedException(ToString()); } GenericPool <Flow> .Free(this); }
public void RestoreTo(IUnit unit) { if (disposed) { throw new ObjectDisposedException(ToString()); } // Restore inline values if possible foreach (var previousDefaultValue in defaultValues) { if (unit.defaultValues.ContainsKey(previousDefaultValue.Key) && unit.valueInputs.Contains(previousDefaultValue.Key) && unit.valueInputs[previousDefaultValue.Key].type.IsAssignableFrom(previousDefaultValue.Value)) { unit.defaultValues[previousDefaultValue.Key] = previousDefaultValue.Value; } } // Restore connections if possible foreach (var previousInputConnections in inputConnections) { var previousInputPort = new UnitPortPreservation(unit, previousInputConnections.Key); var previousOutputPorts = previousInputConnections.Value; foreach (var previousOutputPort in previousOutputPorts) { RestoreConnection(previousOutputPort, previousInputPort); } } foreach (var previousOutputConnections in outputConnections) { var previousOutputPort = new UnitPortPreservation(unit, previousOutputConnections.Key); var previousInputPorts = previousOutputConnections.Value; foreach (var previousInputPort in previousInputPorts) { RestoreConnection(previousOutputPort, previousInputPort); } } GenericPool <UnitPreservation> .Free(this); }
public void Dispose() { GenericPool <GraphStack> .Free(this); }
protected virtual void Free() { GenericPool <Recursion <T> > .Free(this); }