Exemple #1
0
 public StudioComponentEndpointViewModel(ComponentViewModel componentViewModel, EndpointIOType endpointIOType, int id, DataKind dataKind, string connectionType)
 {
     ComponentViewModel = componentViewModel;
     IOType             = endpointIOType;
     Id             = id;
     DataKind       = dataKind;
     ConnectionType = connectionType;
 }
        private bool TryFindComponentInComponentNodes(int componentId, out ComponentViewModel component)
        {
            if (TryFindComponentNode(componentId, out ComponentNodeViewModel componentNode))
            {
                component = componentNode.Component;
            }
            else
            {
                component = null;
            }

            return(component != null);
        }
 private bool TryFindComponent(int componentId, out ComponentViewModel component)
 {
     if (TryFindComponentInComponentNodes(componentId, out component))
     {
         return(true);
     }
     if (TryFindComponentInRepositoryClients(componentId, out component))
     {
         return(true);
     }
     if (TryFindComponentInRepositoryPlaceholders(componentId, out component))
     {
         return(true);
     }
     return(false);
 }
        private bool TryFindOutputOnComponent(ComponentViewModel component, int outputId, out StudioComponentEndpointViewModel output)
        {
            output = component.Outputs.FirstOrDefault(o => o.Id == outputId);

            return(output != null);
        }
        private bool TryFindInputOnComponent(ComponentViewModel component, int inputId, out StudioComponentEndpointViewModel input)
        {
            input = component.Inputs.FirstOrDefault(i => i.Id == inputId);

            return(input != null);
        }
 private bool TryFindComponentInRepositoryPlaceholders(int componentId, out ComponentViewModel component)
 {
     component = virtualStudioViewModel.ComponentRepository.Placeholders.FirstOrDefault(c => c.Id == componentId);
     return(component != null);
 }
Exemple #7
0
 public StudioComponentEndpointViewModel(ComponentViewModel componentViewModel, StudioComponentEndpointDto dto)
     : this(componentViewModel, dto.IOType, dto.Id, dto.DataKind, dto.ConnectionType)
 {
     Name = dto.Name;
 }