Beispiel #1
0
        /// <summary>
        /// Reads the cell values from the rows of the first sheet in the
        /// excel document <param name="path">file path</param>
        /// , considering the <param name="columns">columns</param> defined.
        /// </summary>
        /// <param name="path">The full path to the excel file</param>
        /// <param name="columns">
        ///	The excel columns used to define the structure of the excel sheet.
        ///	If null, then the default columns are used to identify the languages.
        /// </param>
        internal List <ExcelRow> ReadLanguages(string path, List <ExcelColumn> columns = null)
        {
            if (string.IsNullOrEmpty(path))
            {
                throw new Exception(PluginResources.Warning_FilePathNull);
            }

            if (!File.Exists(path))
            {
                // create the default languages file
                _common.SaveDefaultLanguagesDocument(path);
            }

            if (columns == null)
            {
                columns = _common.GetDefaultExcelColumns();
            }

            // reads the rows from the first sheet
            var excelRows = GetExcelRows(path, columns);

            return(excelRows);
        }