public COBieWorkbook Deserialise() { BinaryFormatter formatter = new BinaryFormatter(); COBieWorkbook workBook = null; using (Stream stream = new FileStream(_file, FileMode.Open, FileAccess.Read, FileShare.None)) { workBook = (COBieWorkbook)formatter.Deserialize(stream); } workBook.CreateIndices(); return(workBook); }
/// <summary> /// Build Error lists on workbook /// </summary> /// <param name="fedWorkBook"></param> private void PopulateErrors(COBieWorkbook fedWorkBook) { cOBieProgress.Initialise("Validating Workbooks", fedWorkBook.Count, 0); cOBieProgress.ReportMessage("Building Indices..."); fedWorkBook.CreateIndices(); cOBieProgress.ReportMessage("Building Indices...Finished"); // Validate the workbook cOBieProgress.ReportMessage("Starting Validation..."); fedWorkBook.Validate(ErrorRowStartIndex, null, (lastProcessedSheetIndex) => { // When each sheet has been processed, increment the progress bar cOBieProgress.IncrementAndUpdate(); }); cOBieProgress.ReportMessage("Finished Validation"); cOBieProgress.Finalise(); }
/// <summary> /// Build Error lists on workbook /// </summary> /// <param name="fedWorkBook"></param> private void PopulateErrors(COBieWorkbook fedWorkBook) { try { cOBieProgress.Initialise("Validating Workbooks", fedWorkBook.Count, 0); cOBieProgress.ReportMessage("Building Indices..."); fedWorkBook.CreateIndices(); cOBieProgress.ReportMessage("Building Indices...Finished"); // Validate the workbook cOBieProgress.ReportMessage("Starting Validation..."); fedWorkBook.Validate(ErrorRowStartIndex, null, (lastProcessedSheetIndex) => { // When each sheet has been processed, increment the progress bar cOBieProgress.IncrementAndUpdate(); }); cOBieProgress.ReportMessage("Finished Validation"); cOBieProgress.Finalise(); } catch (Exception) { // TODO: Handle throw; } }