Beispiel #1
0
        private void Initialize()
        {
            // These keys will be replaced when the app is pushed to Google Play :-)
            // Test account for Audio Files
            //string appKey = "6tc6565743i743n";
            //string appSecret = "fbkt3neevjjl0l2";
            // Test account for App Folder
            string appKey = "m1bcpax276elhfi";
            string appSecret = "2azbuj2eelkranm";

            try
            {
                _watchedFiles = new List<DbxFile>();

                _accountManager = DbxAccountManager.GetInstance(SessionsApplication.GetApplicationContext(), appKey, appSecret);
                _accountManager.AddListener(this);

                if (_accountManager.HasLinkedAccount)
                    _account = _accountManager.LinkedAccount;

                if (_account != null)
                {
                    //_store = DbxDatastore.OpenDefault(_account);
                    //_store.AddSyncStatusListener(this);

                    _fileSystem = DbxFileSystem.ForAccount(_account);
                    _fileSystem.AddPathListener(this, new DbxPath("/"), DbxFileSystem.PathListenerMode.PathOrDescendant);
                    _fileSystem.AddSyncStatusListener(this);
                    //InitializeAppFolder();
                }
            }
            catch (Exception ex)
            {
                Tracing.Log("AndroidDropboxService - Initialize - Failed to initialize: {0}", ex);
                throw;
            }
        }
Beispiel #2
0
        public void OnPathChange(DbxFileSystem fileSystem, DbxPath registeredPath, DbxFileSystem.PathListenerMode registeredMode)
        {
            Tracing.Log("AndroidDropboxService - OnPathChange - path: {0}", registeredPath.Name);

            if (OnCloudPathChanged != null)
                OnCloudPathChanged(registeredPath.Name);

            //Task.Factory.StartNew(() =>
            //{
            //    var fileInfos = fileSystem.ListFolder(registeredPath);
            //    foreach(var fileInfo in fileInfos)
            //    {
            //        Tracing.Log("AndroidDropboxService - OnPathChange - path: {0} size: {1} modifiedTime: {2} isFolder: {3}", fileInfo.Path.Name, fileInfo.Size, fileInfo.ModifiedTime, fileInfo.IsFolder);
            //    }
            //});
        }
Beispiel #3
0
 public void OnSyncStatusChange(DbxFileSystem fileSystem)
 {
     Tracing.Log("AndroidDropboxService - OnSyncStatusChange - anyInProgress: {0}", fileSystem.SyncStatus.AnyInProgress());
 }