コード例 #1
0
        public override ReferenceReader Initialize()
        {
            LoadCache();

            if (!IsAllDataCached() || CardMakerInstance.ForceDataCacheRefresh)
            {
                var zSpreadsheet =
                    new GoogleSpreadsheet(CardMakerInstance.GoogleInitializerFactory);
                try
                {
                    zSpreadsheet.MakeSimpleSpreadsheetRequest();
                }
                catch (GoogleApiException e)
                {
                    if (GoogleApi.IsAuthorizationError(e))
                    {
                        CardMakerInstance.GoogleCredentialsInvalid = true;
                    }
                }
                catch (Exception e)
                {
                    Logger.AddLogLine("Google Access Error: {0}".FormatString(e.Message));
                }
            }

            return(this);
        }
コード例 #2
0
        public GoogleReferenceReader()
        {
            LoadCache();

            if (!IsAllDataCached() || CardMakerInstance.ForceDataCacheRefresh)
            {
                var zSpreadsheet =
                    new GoogleSpreadsheet(CardMakerInstance.GoogleInitializerFactory);
                try
                {
                    zSpreadsheet.MakeSimpleSpreadsheetRequest();
                }
                catch (GoogleApiException e)
                {
                    if (GoogleApi.IsAuthorizationError(e))
                    {
                        CardMakerInstance.GoogleCredentialsInvalid = true;
                    }
                }
            }
        }