示例#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;
            }
        }
 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);
        }