namespace IndexFormula.Finance { using System; using System.Collections; using System.Reflection; using System.Text; public class ParamCollection : CollectionBase { public int Add(FormulaParam fp) { return base.List.Add(fp); } public string[] GetParamList() { ArrayList list = new ArrayList(); foreach (object obj2 in base.List) { list.Add(((FormulaParam) obj2).Name); } return (string[]) list.ToArray(typeof(string)); } public void Remove(FormulaParam fp) { base.List.Remove(fp); } public override string ToString() { StringBuilder builder = new StringBuilder(); for (int i = 0; i < base.Count; i++) { if (i != 0) { builder.Append(","); } string str = this[i].Value; if (str.IndexOf(',') >= 0) { str = "\"" + str + "\""; } builder.Append(str); } return builder.ToString(); } public FormulaParam this[int Index] { get { return (FormulaParam) base.List[Index]; } } public FormulaParam this[string Name] { get { foreach (object obj2 in base.List) { if (((FormulaParam) obj2).Name == Name) { return (FormulaParam) obj2; } } return null; } } } }