Exemplo n.º 1
0
 private void RemoveLine(RecorderLine line)
 {
     if (line.Port.Connection != null)
     {
         var graph = Parent;
         graph.Disconnect(line.Port.Connection, line.Port);
     }
     RemovePort(line.Port);
     _lines.Remove(line);
 }
Exemplo n.º 2
0
        private void CreateLine(PortDataType type)
        {
            Func <int> PortCount = () => _lines.Count(l => l.Port.DataType.Equals(type));

            RecorderLine line = null;

            if (type == PortDataTypes.TypeIdValueDouble)
            {
                var port = new NodeSystemLib2.FormatValue.InputPortValueDouble(this, $"{_portTypePrefix[type]}{PortCount()}");
                line = new RecorderLineValue(port, this);
            }
            else if (type == PortDataTypes.TypeIdSignal1D)
            {
                var port = new NodeSystemLib2.FormatData1D.InputPortData1D(this, $"{_portTypePrefix[type]}{PortCount()}");
                line = new RecorderLine1D(port, this);
            }
            else
            {
                throw new ArgumentException(nameof(type));
            }
            line.Port.ConnectionChanged += LineStateChanged;
            _lines.Add(line);
        }