Пример #1
0
        public bool Connect()
        {
            try
            {
                var res = true;

                if (File.Exists(AuthInfoPath))
                {
                    _authInfo = GAPIBaseObject.LoadFromFile <GAPIClientAuthorizationInfo>(AuthInfoPath);
                }
                else
                {
                    Logger.Info($"Missing {AuthInfoPath}");
                    res = false;
                }

                if (File.Exists(JournalPath))
                {
                    _uploadedJournal = GAPIBaseObject.LoadFromFile <UploadedJournal>(JournalPath);
                }
                else
                {
                    Logger.Debug($"Missing {JournalPath}");
                }

                if (res)
                {
                    _accountConnection = new GAPIAccountConnection(_authInfo);
                    _accountConnection.Connect();
                }

                return(res);
            } catch (Exception ex)
            {
                Logger.Error(ex);
                throw;
            }
        }
Пример #2
0
 public PhotoUpload()
 {
     Logger.Debug("Starting PhotoUploader process");
     _authInfo = new GAPIClientAuthorizationInfo();
 }