Пример #1
0
        private void ActivateGoogleDrive(object obj)
        {
            if (!IsGoogleDriveEnabled)
            {
                if (_googleDriveService == null)
                {
                    _googleDriveService = Container.Resolve <IGoogleDriveService>();
                }

                if (_googleDriveService != null && _googleDriveService.IsInitalized())
                {
                    _googleDriveService.CreateApplicationFolder();

                    _configService.SaveAppSettingsValue(AppSettingConstants.IsGoogleDriveEnabled, "true");

                    IsGoogleDriveEnabled = true;
                }
                else
                {
                    _messenger.Send(new GoogleDriveAccessDeniedMsg());
                    _googleDriveService = null;
                }
            }
            else
            {
                _messenger.Send(new GoogleDriveAlreadyEnabledMsg());
            }
        }