コード例 #1
0
        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);
        }
コード例 #2
0
        /// <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();
        }
コード例 #3
0
ファイル: FederateCOBie.cs プロジェクト: bnaand/xBim-Toolkit
        /// <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;
            }
        }