Пример #1
0
            public override void Init(object[] argumentObjects)
            {
                Router router = argumentObjects[0] as Router;

                if (router == null)
                {
                    CurrentValue = "?";
                    return;
                }

                output = router.GetOutput((int)argumentObjects[1]);
                if (output == null)
                {
                    CurrentValue = "?";
                    return;
                }
                output.CurrentSourceChanged += currentSourceChangedHandler;

                labelset = argumentObjects[2] as Labelset;
                if (labelset == null)
                {
                    CurrentValue = "?";
                    return;
                }
                labelset.LabelTextChanged += labelsetTextChangedHandler;

                currentSource = output.CurrentSource;
                if (currentSource == null)
                {
                    CurrentValue = "?";
                    return;
                }
                CurrentValue = labelset.GetLabel(currentSource).Text ?? "?";
            }
Пример #2
0
 private void currentSourceChangedHandler(ISignalDestination signalDestination, ISignalSource newSource)
 {
     if (signalDestination != output)
     {
         return;
     }
     currentSource = newSource;
     CurrentValue  = labelset.GetLabel(currentSource).Text ?? "?";
 }
Пример #3
0
 private void currentInputChangedHandler(RouterOutput output, RouterInput newInput)
 {
     if (output != this.output)
     {
         return;
     }
     currentInput = newInput;
     CurrentValue = labelset.GetLabel(currentInput).Text ?? "?";
 }