Пример #1
0
        // Build sheets index based on the provided dimensions.
        private void BuildEmptySheetsIndexFromDiemensions(IDictionary <string, string> sheetDimensionsRanges)
        {
            // Build sheets index dictionary placeholder.
            this._sheetsIndex = new Dictionary <string, LiveSheet>();

            // Base on the provided sheet dimensions ranges, create appropriate
            // number of empty sheets of appropriate size and add it
            // into the spreadsheet sheetIndex
            foreach (var sheetDimensionsRange in sheetDimensionsRanges)
            {
                // Translate range string in to the separate parameters.
                RangeTranslator.RangeStringToParameters(sheetDimensionsRange.Value, out string sheetTitleId, out int leftIndex, out int topIndex, out int columnCount, out int rowCount);

                // Create empty sheet based on the parameters obtained from the translation
                // of the dimensions range string back in to the separate parameters.
                LiveSheet emptySheet = LiveSheet.Factory.GetSheet(this.SpreadsheetId, sheetTitleId, columnCount, rowCount);

                // Add newly created empty sheet in to the spreadsheet sheets index.
                this._sheetsIndex.Add(sheetTitleId, emptySheet);
            }
        }