Exemplo n.º 1
0
        private void onDisplayUpdateDownloadState(string version, Toggl.DownloadStatus status)
        {
            if (this.TryBeginInvoke(this.onDisplayUpdateDownloadState, version, status))
            {
                return;
            }

            string format;

            switch (status)
            {
            case Toggl.DownloadStatus.Started:
            {
                format = "Downloading version {0}";
                this.restartButton.Visibility = Visibility.Collapsed;
                break;
            }

            case Toggl.DownloadStatus.Done:
            {
                format = "Version {0} available,\nrestart Toggl Desktop to upgrade.";
                this.restartButton.IsEnabled  = true;
                this.restartButton.Visibility = Visibility.Visible;
                break;
            }

            default:
                throw new ArgumentOutOfRangeException("status", status, null);
            }

            this.updateText.Text       = string.Format(format, version);
            this.updateText.Visibility = Visibility.Visible;
        }
Exemplo n.º 2
0
 public UpdateStatus(Version version, Toggl.DownloadStatus downloadStatus)
 {
     HasUpdate      = true;
     Version        = version;
     DownloadStatus = downloadStatus;
 }