private void UpdateInstruments(IEnumerable <string> instruments) { foreach (string instrument in instruments) { if (!Instruments.Contains(instrument)) { Instruments.Add(instrument); } } }
public void Add(Strategy strategy) { this.list_1.Add(strategy); strategy.Portfolio.Parent = Portfolio; foreach (Instrument current in strategy.Instruments) { List <Strategy> list; if (this.idArray_3[current.Id] == null) { list = new List <Strategy>(); this.idArray_3[current.Id] = list; } else { list = this.idArray_3[current.Id]; } list.Add(strategy); if (!Instruments.Contains(current)) { Instruments.Add(current); } } }
/// <summary> /// Determines if this member plays the given instrument or not. /// </summary> /// <param name="instrument">The instrument to check for.</param> /// <returns>True if this member plays that instrument, false otherwise.</returns> public bool DoesPlayInstrument(Marimba.Instrument instrument) { return(Instruments.Contains(instrument)); }