public void AddInstrument(Instrument instrument) { if (this.instrumentNodes.ContainsKey(instrument)) return; InstrumentNode instrumentNode = new InstrumentNode(instrument); this.instrumentNodes.Add(instrument, instrumentNode); this.Nodes.Add(instrumentNode); this.UpdateToolTipText(); }
public void AddInstrument(Instrument instrument) { if (this.instrumentNodes.ContainsKey(instrument)) { return; } InstrumentNode instrumentNode = new InstrumentNode(instrument); this.instrumentNodes.Add(instrument, instrumentNode); this.Nodes.Add(instrumentNode); this.UpdateToolTipText(); }
protected Instrument GetSelectedInstrument() { InstrumentNode instrumentNode = this.trvInstruments.SelectedNode as InstrumentNode; if (instrumentNode != null) { return(instrumentNode.Instrument); } else { return((Instrument)null); } }
public void RemoveInstrument(Instrument instrument) { if (!this.instrumentNodes.ContainsKey(instrument)) { return; } InstrumentNode instrumentNode = this.instrumentNodes[instrument]; this.instrumentNodes.Remove(instrument); instrumentNode.Remove(); if (this.Nodes.Count == 0) { this.Remove(); } else { this.UpdateToolTipText(); } }