Example #1
0
        /// <summary>
        /// Update the context menu regarding the current transfer state, show a balloon tooltip
        /// if the transfer status has changed.
        /// </summary>
        private void UpdateTxInProgressState()
        {
            if (_txInProgress == _status.TransferInProgress &&
                _txSize == _status.CurrentTransferSize)
            {
                return;
            }

            _txInProgress = _status.TransferInProgress;
            _txSize       = _status.CurrentTransferSize;
            if (_txInProgress)
            {
                _miTxProgress.Text      = $@"Transfer in progress (size: {Conv.BytesToString(_txSize)})";
                _miTxProgress.BackColor = Color.LightGreen;
                _notifyIcon.ShowBalloonTip(500, AppTitle,
                                           "New transfer started (size: " +
                                           Conv.BytesToString(_txSize) + ").", ToolTipIcon.Info);
            }
            else
            {
                _miTxProgress.Text = @"No transfer running.";
                _miTxProgress.ResetBackColor();
                _notifyIcon.ShowBalloonTip(500, AppTitle,
                                           "Transfer completed.", ToolTipIcon.Info);
            }
        }