Ejemplo n.º 1
0
 public Connection(Component input, ObservingComponent output, Polyline line)
 {
     Input = input;
     Input.Subscribe(this);
     Subscribe(output);
     Output.AddInput(this);
     Polyline = new Polyline
     {
         Points = line.Points, Stroke = IsActive ? Brushes.Red : Brushes.Gray, ZIndex = -9999
     };
     App.MainWindow.GridCanvas.Canvas.Children.Add(Polyline);
     Notify();
 }
Ejemplo n.º 2
0
 /**
  * Subscribes the Observer to this Connection.
  */
 public IDisposable Subscribe(IObserver <Connection> observer)
 {
     Output = (ObservingComponent)observer;
     return((observer as IDisposable) !);
 }