Ejemplo n.º 1
0
        public void DoWorkbookQuery(object in_instance)
        {
            var instance = in_instance as Google2uData;

            if (instance == null || InstanceData.Service == null)
            {
                return;
            }

            try
            {
                instance.AccountWorkbooks.Clear();
                var spreadsheetQuery = new Google.GData.Spreadsheets.SpreadsheetQuery();
                var spreadsheetFeed  = InstanceData.Service.Query(spreadsheetQuery);

                foreach (var entry in spreadsheetFeed.Entries)
                {
                    var workbook = new Google2uAccountWorkbook(entry as SpreadsheetEntry, instance.Service);

                    instance.AccountWorkbooks.Add(workbook);
                }
            }
            catch (Exception)
            {
                if (!instance.Commands.Contains(GFCommand.DoLogout))
                {
                    instance.Commands.Add(GFCommand.DoLogout);
                }

                PushNotification("There is a problem with your credentials. Clear the credentials and Re-Authorize G2U");
                //instance.Messages.Add(new G2GUIMessage(GFGUIMessageType.InvalidLogin, ex.Message));
            }

            instance.Commands.Remove(GFCommand.WaitForRetrievingWorkbooks);
        }
Ejemplo n.º 2
0
        public void DoWorkbookQuery(object in_instance)
        {
            var instance = in_instance as Google2uData;
            if (instance == null || InstanceData.Service == null)
                return;

            try
            {
                instance.AccountWorkbooks.Clear();
                var spreadsheetQuery = new Google.GData.Spreadsheets.SpreadsheetQuery();
                var spreadsheetFeed = InstanceData.Service.Query(spreadsheetQuery);

                foreach (var entry in spreadsheetFeed.Entries)
                {
                    var workbook = new Google2uAccountWorkbook(entry as SpreadsheetEntry, instance.Service);

                    instance.AccountWorkbooks.Add(workbook);
                }
            }
            catch (Exception)
            {
                if (!instance.Commands.Contains(GFCommand.DoLogout))
                {
                    instance.Commands.Add(GFCommand.DoLogout);
                }

                PushNotification("There is a problem with your credentials. Clear the credentials and Re-Authorize G2U");
                //instance.Messages.Add(new G2GUIMessage(GFGUIMessageType.InvalidLogin, ex.Message));
            }

            instance.Commands.Remove(GFCommand.WaitForRetrievingWorkbooks);
        }