コード例 #1
0
        public ExcelSheet this[string name]
        {
            get
            {
                var retVal =
                    Worksheets.FirstOrDefault(w => w.Sheet.SheetName.Equals(name, StringComparison.OrdinalIgnoreCase));

                if (retVal == null)
                {
                    var mesg = $"Could not find worksheet '{name}'";
                    _logger.Error(mesg);

                    throw new ArgumentException(mesg);
                }

                return(retVal);
            }
        }
コード例 #2
0
 public IWorksheet GetSheetByName(string name)
 {
     return(Worksheets.FirstOrDefault(i => i.Name == name));
 }