public void AddOutput(OutputInitializer output)
 {
     if (!_outputs.ContainsKey(output.Key))
     {
         _outputs.Add(output.Key, output);
     }
 }
        public void RemoveOutput(OutputInitializer output)
        {
            _outputs.Remove(output.Key);

            if (IsMaskBuilt) // Todo: Do we need to keep this code in case of initialize is call for each new connections
            {
                var mask = new BitArray(_mask.Length, true);
                mask.Set(output.Index, false);
                _mask.And(mask);
                _pulseSource->UpdateMask(_mask);
            }

            if (_outputs.Count == 0)
            {
                Dispose();
            }
        }
Beispiel #3
0
        public RelayConnector(
            string key,
            InputInitializer input,
            OutputInitializer output,
            LazyInitializer lazy,
            Action <RelayConnector> onDispose)
        {
            Key        = key;
            _input     = input;
            _output    = output;
            _lazy      = lazy;
            _onDispose = onDispose;

            _output.AddInput(input);
            _input.AddOutput(output);

            _lazy.ForceInitialize();
        }