public bool CanCreateStudioConnection(StudioComponentOutput output, StudioComponentInput input) { return ((output.Component != null) && (input.Component != null) && input.ConnectionType == output.ConnectionType && (input.DataKind & output.DataKind) != Shared.DataKind.Nothing); }
public bool CanCreateConnection(StudioComponentOutput output, StudioComponentInput input) { if (IsInputInComponents(input) && IsOutputInComponents(output)) { return(connectionFactory.CanCreateStudioConnection(output, input)); } return(false); }
public IStudioConnection CreateStudioConnection(StudioComponentOutput output, StudioComponentInput input) { if (!CanCreateStudioConnection(output, input)) { return(null); } return(new StudioConnection(idGenerator.GetNewId(), output, input)); }
private bool IsOutputInComponents(StudioComponentOutput output) { foreach (var component in _components) { if (component.Outputs?.FirstOrDefault(c => c == output) != null) { return(true); } } return(false); }
public IStudioConnection CreateConnection(StudioComponentOutput output, StudioComponentInput input) { if (IsInputInComponents(input) && !_connections.Exists(c => c.Input == input) && IsOutputInComponents(output)) { var connection = connectionFactory.CreateStudioConnection(output, input); if (connection != null) { _connections.Add(connection); ConnectionAdded?.Invoke(this, connection); connection.SetTargetState(Shared.ConnectionState.Connected); return(connection); } } throw new InvalidOperationException(); }
private void Component_OutputRemoved(object sender, StudioComponentOutput output) { operationHandler.RemoveOutputFromComponent(VirtualStudioName, output.Component.Id, output.Id); }
private void Component_OutputAdded(object sender, StudioComponentOutput output) { operationHandler.AddOutputToComponent(VirtualStudioName, output.Component.Id, output.ToDto()); }