Exemplo n.º 1
0
 protected Jack(Instrument instrument)
 {
     if (instrument is Cable cable)
     {
         Cable = cable;
     }
     else
     {
         Instrument = instrument;
     }
 }
Exemplo n.º 2
0
 public static void Disconnect(this Jack jack, Cable cable)
 {
     cable.OnDisonnect();
     if (jack is OutputJack outputJack)
     {
         cable.OutputJacks = new List <OutputJack>();
     }
     else
     {
         cable.InputJacks = new List <InputJack>();
     }
     jack.Cable = null;
 }
Exemplo n.º 3
0
 public static void Connect(this Jack jack, Cable cable)
 {
     if (jack is OutputJack outputJack)
     {
         cable.OutputJacks = new List <OutputJack>()
         {
             outputJack
         };
     }
     else
     {
         cable.InputJacks = new List <InputJack>()
         {
             (InputJack)jack
         };
     }
     jack.Cable = cable;
     cable.OnConnect();
 }