using OfficeOpenXml.FormulaParsing.LexicalAnalysis; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace OfficeOpenXml.FormulaParsing { /// /// This class should be implemented to be able to deliver excel data /// to the formula parser. /// public abstract class ExcelDataProvider : IDisposable { public interface ICellInfo : IEnumerator, IEnumerable { string Address { get; } int Row { get; } int Column { get; } string Formula { get; } object Value { get; } double ValueDouble { get; } double ValueDoubleLogical { get; } bool IsHiddenRow { get; } bool IsEmpty { get; } bool IsMulti { get; } bool NextCell(); IList Tokens { get; } int GetNCells(); } public interface INameInfo { ulong Id { get; set; } string Name { get; set; } string Formula { get; set; } IList Tokens { get; } object Value { get; set; } } /// /// Returns the names of all worksheet names /// /// public abstract ExcelNamedRangeCollection GetWorksheetNames(); /// /// Returns all defined names in a workbook /// /// public abstract ExcelNamedRangeCollection GetWorkbookNameValues(); /// /// Returns values from the required range. /// /// An Excel address /// values from the required cells public abstract ICellInfo GetRange(string worksheetName, int row, int column, string address); public abstract INameInfo GetName(string worksheet, string name); public abstract IEnumerable GetRangeValues(string address); public abstract string GetRangeFormula(string worksheetName, int row, int column); public abstract List GetRangeFormulaTokens(string worksheetName, int row, int column); public abstract bool IsRowHidden(string worksheetName, int row); ///// ///// Returns a single cell value ///// ///// ///// //public abstract object GetCellValue(int sheetID, string address); /// /// Returns a single cell value /// /// /// /// public abstract object GetCellValue(string sheetName, int row, int col); ///// ///// Sets the value on the cell ///// ///// ///// //public abstract void SetCellValue(string address, object value); /// /// Use this method to free unmanaged resources. /// public abstract void Dispose(); /// /// Max number of columns in a worksheet that the Excel data provider can handle. /// public abstract int ExcelMaxColumns { get; } /// /// Max number of rows in a worksheet that the Excel data provider can handle /// public abstract int ExcelMaxRows { get; } public abstract object GetRangeValue(string worksheetName, int row, int column); } }