예제 #1
0
        public void Attach(StatusBar statusBar)
        {
            delegatedStatusBar = statusBar;
            if (autoPulse)
            {
                statusBar.AutoPulse = true;
            }
            if (inProgress)
            {
                if (progressImage != IconId.Null)
                {
                    statusBar.BeginProgress(progressImage, progressMessage);
                }
                else
                {
                    statusBar.BeginProgress(progressMessage);
                }
            }
            if (cancellationTokenSource != null)
            {
                statusBar.SetCancellationTokenSource(cancellationTokenSource);
            }
            if (messageSourcePad != null)
            {
                statusBar.SetMessageSourcePad(messageSourcePad);
            }
            if (progressFraction != null)
            {
                statusBar.SetProgressFraction(progressFraction.Value);
            }
            if (messageType != MessageType.None)
            {
                switch (messageType)
                {
                case MessageType.Error:
                    statusBar.ShowError(message);
                    break;

                case MessageType.Warning:
                    statusBar.ShowWarning(message);
                    break;

                case MessageType.Ready:
                    statusBar.ShowReady();
                    break;

                default:
                    statusBar.ShowMessage(messageIcon, message, messageIsMarkup);
                    break;
                }
            }
            foreach (var icon in icons)
            {
                icon.Attach(statusBar);
            }

            cancellationTokenSource = null;
            messageSourcePad        = null;
            icons.Clear();
        }
예제 #2
0
 public void BeginProgress(string name)
 {
     messageShownAfterProgress = false;
     image            = null;
     isMarkup         = false;
     progressFraction = 0;
     message          = name;
     showProgress     = true;
     if (InitialSetup())
     {
         return;
     }
     if (statusHandler.IsCurrentContext(this))
     {
         OnMessageChanged();
         statusBar.BeginProgress(name);
         statusBar.SetMessageSourcePad(sourcePad);
         lastMessageIsTransient = true;
     }
 }