internal NamedRangeCollection(ExcelWorksheet worksheet, NamedRangeCollection sourceNamedRanges) { this.namesList = new ArrayList(); this.namedRanges = new ArrayList(); this.worksheet = worksheet; for (int i = 0; i < sourceNamedRanges.NamedRanges.Count; i++) { NamedRange range = sourceNamedRanges.NamedRanges[i] as NamedRange; this.Add(range.Options, range.Name, range.Range); } }
public NamedRange this[string name] { get { for (int i = 0; i < this.namedRanges.Count; i++) { NamedRange range = this.namedRanges[i] as NamedRange; if (range.Name == name) { return(range); } } return(null); } }