Ejemplo n.º 1
0
 internal async Task <Boolean> DeleteContent(SynchroHandle _syncHandle)
 {
     if (_syncHandle.Requested)
     {
         StorageServer _manager = CloudServerFromName(_syncHandle.Server);
         return(await _manager.DeleteContent(_syncHandle.TripSummary));
     }
     else
     {
         return(true);
     }
 }
Ejemplo n.º 2
0
        internal async Task Synchronize()
        {
            if (_syncInProgress)
            {
                return;
            }

            _syncInProgress = true;

            while (_listSyncHandle.Count > 0)
            {
                SynchroHandle _syncHandle = _listSyncHandle.First <SynchroHandle>();
                Status        _status     = SynchroManager.Status.ErrorOrNotConnected;

                StorageServer _server = CloudServerFromName(_syncHandle.Server);
                _server.SyncMngr    = this;
                _server.Compression = _syncHandle.Compression;
                if (Parent != null)
                {
                    _server.Parent = Parent;
                }

                // start synchronization, reset Cts before
                _syncHandle.InProgress = true;
                _server.ResetCts();
                _status = await _server.Synchronize(_syncHandle);

                _syncHandle.InProgress = false;

                if (_status == Status.Synchronized)
                {
                    _syncHandle.Finished = true;
                }

                _syncHandle.SetSynchroStatus(_status);

                removeFromQueue(_syncHandle);

                if ((_listSyncHandle.Count == 0) && (Parent != null) && (Parent is ViewHome))
                {
                    await(Parent as ViewHome).SaveSummary();
                }
            }

            _syncInProgress = false;
        }
Ejemplo n.º 3
0
        public async Task <Boolean> Login(ServerName _server)
        {
            StorageServer _manager = CloudServerFromName(_server);

            if (_manager.LoggedIn != WebAccountState.Connected)
            {
                await _manager.Login();

                if ((_manager.Token != null) && (_manager.UserName != null) &&
                    (_manager.Token != "") && (_manager.UserName != ""))
                {
                    _manager.LoggedIn = WebAccountState.Connected;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 4
0
        public WebAccountCommand GetAccount(ServerName providerName)
        {
            StorageServer _manager = CloudServerFromName(providerName);

            return(_manager.GetAccount());
        }
Ejemplo n.º 5
0
        internal WebAccountProvider GetProvider(ServerName providerName)
        {
            StorageServer _manager = CloudServerFromName(providerName);

            return(_manager.Provider);
        }
Ejemplo n.º 6
0
        public void Cancel(SynchroHandle _syncHandle)
        {
            StorageServer _manager = CloudServerFromName(_syncHandle.Server);

            _manager.Cancel();
        }