public BaseUIElement(string name, int width, int height, DrawingImage picture, MouseButtonEventHandler onMouseDown, BaseElement element) { InitializeComponent(); Element = element; Width = width; Height = height; ElementPicture.Source = picture; ElementPicture.Width = width; ElementPicture.Height = height; if (name != "") { ElementName.Visibility = System.Windows.Visibility.Visible; ElementName.Content = name; Element.Name = name; } if (onMouseDown != null) { MouseDown += onMouseDown; } }
public RouterElement(int width, int height, DrawingImage picture, MouseButtonEventHandler onMouseDown, double x, double y, int pinCount, BaseElement element, string name = "Безымянный") : base(name, width, height, picture, onMouseDown, element) { SetLocation(x, y); for (var i = 0; i < pinCount; i++) { AddPin(string.Format("Pin {0}", i), i); } }