public PiscesFolder GetFolder(int id) { TimeSeriesDatabaseDataSet.SeriesCatalogRow sr = db.GetSeriesRow(id); PiscesObject o = CreateObject(sr); if (!(o is PiscesFolder)) { throw new ArgumentException("this object is not a PiscesFolder " + id); } return(o as PiscesFolder); }