예제 #1
0
파일: Wizard.cs 프로젝트: windygu/AnkhSVN
        /// <see cref="WizardFramework.IWizardContainer.UpdateMessage" />
        public void UpdateMessage()
        {
            if (_curPage == null)
            {
                return;
            }

            WizardMessage message = _curPage.Message;

            if (message != null && !string.IsNullOrEmpty(message.Message))
            {
                Image newImg;
                // Display the message panel
                // Bora: statusIcon images are set be read from the MergeWizard resources.
                // otherwise, runtime throws an exception and quits the Wizard.
                switch (message.Type)
                {
                case WizardMessage.MessageType.Error:
                    newImg = Ankh.UI.MergeWizard.MergeStrings.ErrorIcon;
                    break;

                case WizardMessage.MessageType.Information:
                    newImg = Ankh.UI.MergeWizard.MergeStrings.InfoIcon;
                    break;

                case WizardMessage.MessageType.Warning:
                    newImg = Ankh.UI.MergeWizard.MergeStrings.WarningIcon;
                    break;

                case WizardMessage.MessageType.None:
                default:
                    newImg = null;
                    break;
                }

                if (statusIcon.Image != newImg)
                {
                    statusIcon.Image = newImg;
                }

                if (message.Message != null && statusMessage.Text != message.Message)
                {
                    statusMessage.Text = message.Message;
                }

                statusPanel.Visible = true;
            }
            else
            {
                // Hide the message panel
                statusPanel.Visible = false;
            }
        }
예제 #2
0
 private void logToolControl1_BatchFinished(object sender, BatchFinishedEventArgs e)
 {
     if (e.TotalCount == 0)
     {
         Message = new WizardMessage(MergeStrings.NoLogItems, WizardMessage.MessageType.Error);
     }
     else
     {
         Message = new WizardMessage("", WizardMessage.MessageType.None);
     }
 }
예제 #3
0
        /// <summary>
        /// Sets the merge sources for the mergeFromComboBox.
        /// </summary>
        private void SetMergeSources(ICollection<Uri> mergeSources)
        {
            if (InvokeRequired)
            {
                SetMergeSourcesCallBack c = new SetMergeSourcesCallBack(SetMergeSources);
                BeginInvoke(c, new object[] { mergeSources });
                return;
            }
            bool containsAtLeastOne = false;

            foreach (Uri u in mergeSources)
            {
                containsAtLeastOne = true;
                suggestedSources.Add(u.ToString());
            }

            if (containsAtLeastOne)
            {
                UIUtils.ResizeDropDownForLongestEntry(mergeFromComboBox);
            }
            else if (MergeType == MergeWizard.MergeType.ManuallyRemove)
            {
                Message = new WizardMessage(MergeStrings.NoRevisionsToUnblock, WizardMessage.MessageType.Error);
                mergeFromComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
            }

            ((Wizard)ParentForm).EnablePageAndButtons(true);
        }