/// <summary> /// Returns the first item in the collection with the given description. /// </summary> /// <param name="description">The description to search for.</param> /// <returns>The first item in the collection with the description, otherwise null.</returns> public LookupValue getByDescription(string description) { int size = this.getSize(); for (int index = 0; index < size; index++) { LookupValue testValue = (LookupValue)this.collection[index]; if (testValue.Description.Equals(description)) { return(testValue); } } return(null); }
/// <summary> /// Returns the first item in the collection with the given value. /// </summary> /// <param name="description">The value to search for.</param> /// <returns>The first item in the collection with the value, otherwise null.</returns> public LookupValue getByValue(int intValue) { int size = this.getSize(); for (int index = 0; index < size; index++) { LookupValue testValue = (LookupValue)this.collection[index]; if (testValue.IntValue == intValue) { return(testValue); } } return(null); }
/// <summary> /// Adds and item to the collection. /// </summary> /// <param name="lookupValue"></param> public void add(LookupValue lookupValue) { this.collection.Add(lookupValue); }