Esempio n. 1
0
        private void LoadStorageUsageUICallback(object sender, SimpleEventArgs evt)
        {
            StorageUsageResponse storageUsage = (StorageUsageResponse)evt.param;

            long quota    = storageUsage.storages.waveface.quota.month_total_objects;
            long usage    = storageUsage.storages.waveface.usage.month_total_objects;
            int  daysLeft = storageUsage.storages.waveface.interval.quota_interval_left_days;

            if (quota < 0)
            {
                label_MonthlyLimitValue.Text = I18n.L.T("MonthlyUsage_Unlimited");
            }
            else
            {
                label_MonthlyLimitValue.Text = quota.ToString();
            }

            label_DaysLeftValue.Text  = daysLeft.ToString();
            label_UsedCountValue.Text = usage.ToString();

            if (quota < 0)
            {
                barCloudUsage.Value = (int)(usage * 100 / int.MaxValue);
            }
            else
            {
                barCloudUsage.Value = (int)(usage * 100 / quota);
            }

            RestoreCursor();
        }
Esempio n. 2
0
        private void LoadDropboxUICallback(object sender, SimpleEventArgs evt)
        {
            ListCloudStorageResponse cloudStorage = (ListCloudStorageResponse)evt.param;

            if (cloudStorage.cloudstorages.Count > 0 && cloudStorage.cloudstorages[0].connected)
            {
                btnDropboxAction.Text     = I18n.L.T("DropboxUI_Disconnect");
                label_dropboxAccount.Text = cloudStorage.cloudstorages[0].account;
                btnDropboxAction.Click   -= btnConnectDropbox_Click;
                btnDropboxAction.Click   -= btnUnlinkDropbox_Click;
                btnDropboxAction.Click   += btnUnlinkDropbox_Click;
            }
            else
            {
                btnDropboxAction.Text     = I18n.L.T("DropboxUI_ConnectNow");
                label_dropboxAccount.Text = I18n.L.T("MonthlyUsage_NotConnectedYet");
                btnDropboxAction.Click   -= btnUnlinkDropbox_Click;
                btnDropboxAction.Click   -= btnConnectDropbox_Click;
                btnDropboxAction.Click   += btnConnectDropbox_Click;
            }

            btnDropboxAction.Enabled = true;

            RestoreCursor();
        }
Esempio n. 3
0
        private void WavefaceClientUICallback(object sender, SimpleEventArgs evt)
        {
            int exitCode = (int)evt.param;

            if (exitCode == -2)              // client logout
            {
                GotoTabPage(tabSignIn, userloginContainer.GetLastUserLogin());
            }
        }
Esempio n. 4
0
        private void ConnectDropboxUIError(object sender, SimpleEventArgs evt)
        {
            messenger.ShowMessage(I18n.L.T("ConnectCloudStorageFail"));
            btnDropboxAction.Enabled = true;

            Exception ex = (Exception)evt.param;

            if (ex is ConnectToCloudException)
            {
                mainform.CurrentState.Offlined();
            }
        }
Esempio n. 5
0
        private void GetStationStatusUIError(object sender, SimpleEventArgs evt)
        {
            lblLocalStorageUsage.Text = I18n.L.T("NoData");
            lblDeviceName.Text        = I18n.L.T("NoData");

            Exception ex = (Exception)evt.param;

            if (ex is ConnectToCloudException)
            {
                mainform.CurrentState.Offlined();
            }

            RestoreCursor();
        }
Esempio n. 6
0
        private void TestConnectionUIError(object sender, SimpleEventArgs evt)
        {
            labelConnectionStatus.Text = I18n.L.T("NotConnected");
            btnTestConnection.Enabled  = true;

            Exception ex = (Exception)evt.param;

            if (ex is AuthenticationException)
            {
                mainform.CurrentState.SessionExpired();
            }
            else if (ex is ConnectToCloudException)
            {
                mainform.CurrentState.Offlined();
            }
        }
Esempio n. 7
0
        private void GetStationStatusUICallback(object sender, SimpleEventArgs evt)
        {
            GetStatusResponse stationStatus = (GetStatusResponse)evt.param;

            long _usedSize = 0;

            foreach (DiskUsage _du in stationStatus.station_status.diskusage)
            {
                _usedSize += _du.used;
            }

            lblLocalStorageUsage.Text = string.Format("{0:0.0} MB", _usedSize / (1024 * 1024));
            lblDeviceName.Text        = stationStatus.station_status.computer_name;

            RestoreCursor();
        }
Esempio n. 8
0
        private void ResumeServiceUIError(object sender, SimpleEventArgs evt)
        {
            Exception ex = (Exception)evt.param;

            if (ex is AuthenticationException)
            {
                CurrentState.SessionExpired();
            }
            else if (ex is UserAlreadyHasStationException)
            {
                messenger.ShowMessage(I18n.L.T("StationExpired"));
                ReregisterStation();
            }
            else
            {
                CurrentState.Error();
            }
        }
Esempio n. 9
0
        private void LoadStorageUsageUIError(object sender, SimpleEventArgs evt)
        {
            label_MonthlyLimitValue.Text = I18n.L.T("NoData");
            label_DaysLeftValue.Text     = I18n.L.T("NoData");
            label_UsedCountValue.Text    = I18n.L.T("NoData");

            Exception ex = (Exception)evt.param;

            if (ex is AuthenticationException)
            {
                mainform.CurrentState.SessionExpired();
            }
            else if (ex is ConnectToCloudException)
            {
                mainform.CurrentState.Offlined();
            }

            RestoreCursor();
        }
Esempio n. 10
0
        private void LoadDropboxUIError(object sender, SimpleEventArgs evt)
        {
            btnDropboxAction.Text     = I18n.L.T("DropboxUI_ConnectNow");
            label_dropboxAccount.Text = I18n.L.T("MonthlyUsage_NotConnectedYet");

            btnDropboxAction.Click -= btnUnlinkDropbox_Click;
            btnDropboxAction.Click -= btnConnectDropbox_Click;
            btnDropboxAction.Click += btnConnectDropbox_Click;

            btnDropboxAction.Enabled = true;

            Exception ex = (Exception)evt.param;

            if (ex is AuthenticationException)
            {
                mainform.CurrentState.SessionExpired();
            }
            else if (ex is ConnectToCloudException)
            {
                mainform.CurrentState.Offlined();
            }

            RestoreCursor();
        }
Esempio n. 11
0
 private void ResumeServiceUICallback(object sender, SimpleEventArgs evt)
 {
     CurrentState.Onlined();
 }
Esempio n. 12
0
 private void PauseServiceUICallback(object sender, SimpleEventArgs evt)
 {
     CurrentState.Offlined();
 }
Esempio n. 13
0
        private void WavefaceClientUIError(object sender, SimpleEventArgs evt)
        {
            Exception ex = (Exception)evt.param;

            messenger.ShowMessage(ex.Message);
        }
Esempio n. 14
0
 private void TestConnectionUICallback(object sender, SimpleEventArgs evt)
 {
     labelConnectionStatus.Text = I18n.L.T("Connected");
     btnTestConnection.Enabled  = true;
 }
Esempio n. 15
0
 private void UnlinkDropboxUICallback(object sender, SimpleEventArgs evt)
 {
     btnDropboxAction.Enabled = true;
 }