protected void AddParameter(Fitter fitter) { if (fitter == null) { throw new ArgumentNullException("fitter", "Can't add a parameter without providing a fitter."); } BlockSlot parameter = new BlockSlot(fitter); AddParameter(parameter); }
protected void AddParameter(BlockSlot parameter) { if (parameter == null) { throw new ArgumentNullException("parameter", "Can't add a null parameter."); } parameter.Changed += delegate { OnChanged(new EventArgs()); }; mainPanel.Children.Add(parameter); }
public List <BlockSlot> GetSlots() { List <BlockSlot> slots = new List <BlockSlot>(2); foreach (UIElement element in mainPanel.Children) { BlockSlot slot = element as BlockSlot; if (slot != null) { slots.Add(slot); } } return(slots); }