public void AddSpreadsheet(out string spreadsheetId, string spreadsheetTitle, IList <Tuple <string, int, int, IList <IList <string> > > > spreadsheetBlueprint)
        {
            // Add Sheet.
            Spreadsheet     spreadsheetData  = this._apisSheetsService.AddSpreadsheetSync(spreadsheetTitle, spreadsheetBlueprint);
            LiveSpreadsheet addedSpreadsheet = LiveSpreadsheet.Factory.Get(spreadsheetData);

            // Assign value of the out spreadsheetId parameter from constructed spreadsheet
            spreadsheetId = addedSpreadsheet.SpreadsheetId;

            // Construct row entry data - representing newly added spreadsheet in the database spreadsheet index.
            IList <string> rowData = new List <string>();

            rowData.Add(addedSpreadsheet.SpreadsheetId);
            rowData.Add(addedSpreadsheet.Title);

            // Insert row in the DBIndex representing newly created spreadsheet
            this.DbSpreadsheetsIndexSheet.InsertRows(this, this.DbSpreadsheetsIndexSheet.RowCount, 1, new IList <string>[1] {
                rowData
            });
        }
        private bool disposed = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!this.disposed)
            {
                if (disposing)
                {
                    // TODO: dispose managed state (managed objects).
                    // Obtain all of the loaded spreadsheets requiring destruction
                    foreach (LiveSpreadsheet spreadsheet in LiveSpreadsheet.Factory.GetAllExisting().Values)
                    {
                        spreadsheet.Dispose();
                    }
                }

                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                // TODO: set large fields to null.
                this._apisSheetsService = null;
                this._dbSpreadsheetsIndexSpreadsheet = null;

                // Set disposed flag value to be true
                this.disposed = true;
            }
        }
Ejemplo n.º 3
0
 // Adds constructed instance of LiveSpreadsheet class into the production index.
 internal void AddSpreadsheet(LiveSpreadsheet spreadsheet)
 {
     this._producedSpreadsheets.Add(spreadsheet.SpreadsheetId, spreadsheet);
 }
 // Obtains the current version of the db spreadsheets index.
 private async Task ObtainDBSpreadsheetsIndexAsync()
 {
     // Get spreadsheets index, spreadsheet status.
     this._dbSpreadsheetsIndexSpreadsheet
         = LiveSpreadsheet.Factory.Get(await this._apisSheetsService.GetSpreadsheetAsync(this.SpreadsheetsDbSpreadsheetId), true, true);
 }
 // Obtains the current version of the db spreadsheets index.
 private void ObtainDBSpreadsheetsIndex()
 {
     // Get spreadsheets index, spreadsheet status.
     this._dbSpreadsheetsIndexSpreadsheet
         = LiveSpreadsheet.Factory.Get(this._apisSheetsService.GetSpreadsheetSync(this.SpreadsheetsDbSpreadsheetId), true, true);
 }