Exemplo n.º 1
0
        public ForkedEvaluationCell GetOrCreateUpdatableCell(String sheetName, int rowIndex,
                                                             int columnIndex)
        {
            ForkedEvaluationSheet sheet = GetSharedSheet(sheetName);

            return(sheet.GetOrCreateUpdatableCell(rowIndex, columnIndex));
        }
Exemplo n.º 2
0
 public ForkedEvaluationCell(ForkedEvaluationSheet sheet, IEvaluationCell masterCell)
 {
     _sheet      = sheet;
     _masterCell = masterCell;
     // start with value blank, but expect construction to be immediately
     SetValue(BlankEval.instance); // followed by a proper call to SetValue()
 }
Exemplo n.º 3
0
 public int GetSheetIndex(IEvaluationSheet sheet)
 {
     if (sheet is ForkedEvaluationSheet)
     {
         ForkedEvaluationSheet mes = (ForkedEvaluationSheet)sheet;
         return(mes.GetSheetIndex(_masterBook));
     }
     return(_masterBook.GetSheetIndex(sheet));
 }
Exemplo n.º 4
0
 public void CopyUpdatedCells(IWorkbook workbook)
 {
     String[] sheetNames = new String[_sharedSheetsByName.Count];
     _sharedSheetsByName.Keys.CopyTo(sheetNames, 0);
     OrderedSheet[] oss = new OrderedSheet[sheetNames.Length];
     for (int i = 0; i < sheetNames.Length; i++)
     {
         String sheetName = sheetNames[i];
         oss[i] = new OrderedSheet(sheetName, _masterBook.GetSheetIndex(sheetName));
     }
     for (int i = 0; i < oss.Length; i++)
     {
         String sheetName            = oss[i].GetSheetName();
         ForkedEvaluationSheet sheet = _sharedSheetsByName[(sheetName)];
         sheet.CopyUpdatedCells(workbook.GetSheet(sheetName));
     }
 }
Exemplo n.º 5
0
        private ForkedEvaluationSheet GetSharedSheet(String sheetName)
        {
            ForkedEvaluationSheet result = null;

            if (_sharedSheetsByName.ContainsKey(sheetName))
            {
                result = _sharedSheetsByName[(sheetName)];
            }
            if (result == null)
            {
                result = new ForkedEvaluationSheet(_masterBook.GetSheet(_masterBook
                                                                        .GetSheetIndex(sheetName)));
                if (_sharedSheetsByName.ContainsKey(sheetName))
                {
                    _sharedSheetsByName[sheetName] = result;
                }
                else
                {
                    _sharedSheetsByName.Add(sheetName, result);
                }
            }
            return(result);
        }
Exemplo n.º 6
0
        public IEvaluationCell GetEvaluationCell(String sheetName, int rowIndex, int columnIndex)
        {
            ForkedEvaluationSheet sheet = GetSharedSheet(sheetName);

            return(sheet.GetCell(rowIndex, columnIndex));
        }