Beispiel #1
0
        private bool ProcessSync(VirtualStudio virtualStudio)
        {
            var component = virtualStudio.FindStudioComponentById(componentId);

            if (component is null)
            {
                Error = new OperationError(ErrorType.NotFound, $"Component with ID {componentId} not found.");
                return(false);
            }
            if (component is PlaceholderStudioComponent placeholderStudioComponent)
            {
                var input = placeholderStudioComponent.Inputs.FirstOrDefault(i => i.Id == endpointId);
                if (input is null)
                {
                    Error = new OperationError(ErrorType.NotFound, $"Input with ID {endpointId} not found on component with ID {componentId}.");
                    return(false);
                }
                placeholderStudioComponent.RemoveInput(input);
                return(true);
            }
            else
            {
                Error = new OperationError(ErrorType.InvalidOperation, $"Component with ID {componentId} is not of type PlaceholderComponent.");
                return(false);
            }
        }
        private bool ProcessSync(VirtualStudio virtualStudio)
        {
            var component = virtualStudio.FindStudioComponentById(componentId);

            if (component is null)
            {
                Error = new OperationError(ErrorType.NotFound, $"Component with ID {componentId} not found.");
                return(false);
            }

            return(ChangeProperty(component, propertyName, value));
        }
        private bool ProcessSync(VirtualStudio virtualStudio)
        {
            var component = virtualStudio.FindStudioComponentById(componentId);

            if (component is null)
            {
                Error = new OperationError(ErrorType.NotFound, $"StudioComponent with ID {componentId} not found.");
                return(false);
            }
            if (component is PlaceholderStudioComponent placeholderComponent)
            {
                placeholderComponent.AddOutput(endpoint.Name, endpoint.DataKind, endpoint.ConnectionType);
                return(true);
            }
            else
            {
                Error = new OperationError(ErrorType.NotFound, $"StudioComponent with ID {component} is not a Placeholder.");
                return(false);
            }
        }