/// <summary>
        ///     Packs the spreadsheet information response.
        /// </summary>
        /// <param name="result">The result.</param>
        /// <returns></returns>
        private static SpreadsheetInfo PackSpreadsheetInfoResponse(Interface.SpreadsheetInfo result)
        {
            ImportFormat importFormat;
            var          sheetInfo = new SpreadsheetInfo
            {
                FileName        = result.FileName,
                SheetCollection = result.SheetCollection != null && result.SheetCollection.Count > 0
                                        ? new List <SheetInfo>(result.SheetCollection.Select(sheet => new SheetInfo
                {
                    SheetName = sheet.SheetName,
                    SheetId   = sheet.SheetId
                }))
                                        : null,
                ImportFileFormat =
                    Enum.TryParse(result.ImportFileFormat.ToString( ), true, out importFormat) ? importFormat : ImportFormat.Excel
            };

            return(sheetInfo);
        }