コード例 #1
0
        /// <summary>
        /// loads a spreadsheet using its name, if 2 or more spreadsheets share a name will load the first found instance
        /// </summary>
        /// <param name="managerV3"></param>
        /// <param name="spreadSheetName"></param>
        /// <returns></returns>
        public static GS2U_SpreadSheet LoadSpreadSheet(this SpreadSheetManager manager, string spreadSheetName)
        {
            SpreadsheetQuery query = new SpreadsheetQuery();

            query.Title = spreadSheetName;

            SpreadsheetFeed feed = SpreadSheetManager.service.Query(query) as SpreadsheetFeed;

            if (feed.Entries.Count == 0)
            {
                return(null);
            }

            return(new GS2U_SpreadSheet((SpreadsheetEntry)feed.Entries[0]));
        }
コード例 #2
0
        /// <summary>
        /// Load a spreadsheet from its unique id, usefull if 2 or more spreadsheets have the same name
        /// </summary>
        /// <param name="managerV3"></param>
        /// <param name="spreadSheetID"></param>
        /// <param name="isSheetId"></param>
        /// <returns></returns>
        public static GS2U_SpreadSheet LoadSpreadSheet(this SpreadSheetManager manager, string spreadSheetID, bool isSheetId)
        {
            SpreadsheetQuery query = new SpreadsheetQuery();

            query.Uri = new Uri("https://spreadsheets.google.com/feeds/spreadsheets/private/full/" + spreadSheetID);

            SpreadsheetFeed feed = SpreadSheetManager.service.Query(query) as SpreadsheetFeed;

            if (feed.Entries.Count == 0)
            {
                return(null);
            }

            return(new GS2U_SpreadSheet((SpreadsheetEntry)feed.Entries[0]));
        }