Exemple #1
0
        public static Uri DisplayBrowseDialogAndGetResult(WizardPage page, SvnItem target, Uri baseUri)
        {
            IAnkhServiceProvider context = ((MergeWizard)page.Wizard).Context;

            if (((MergeWizard)page.Wizard).MergeTarget.IsDirectory)
            {
                using (RepositoryFolderBrowserDialog dlg = new RepositoryFolderBrowserDialog())
                {
                    dlg.SelectedUri = baseUri;

                    if (dlg.ShowDialog(context) == DialogResult.OK)
                    {
                        return dlg.SelectedUri;
                    }
                }
            }
            else
            {
                using (RepositoryOpenDialog dlg = new RepositoryOpenDialog())
                {
                    string fileName = Path.GetFileName(target.FullPath);

                    dlg.Context = context;
                    dlg.Filter = fileName + "|" + fileName + "|All Files (*.*)|*";

                    dlg.SelectedUri = baseUri;

                    if (dlg.ShowDialog(context) == DialogResult.OK)
                        return dlg.SelectedUri;
                }
            }

            return null;
        }
Exemple #2
0
        public static Uri DisplayBrowseDialogAndGetResult(WizardPage page, SvnItem target, string baseUri)
        {
            Uri u;
            if(Uri.TryCreate(baseUri, UriKind.Absolute, out u))
                return DisplayBrowseDialogAndGetResult(page, target, u);

            page.Message = MergeUtils.INVALID_FROM_URL;

            return null;
        }
Exemple #3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="utils"></param>
        public MergeWizard(IAnkhServiceProvider context, SvnItem mergeTarget)
        {
            InitializeComponent();

            DefaultPageImage = MergeStrings.MergeWizardHeaderImage;

            MergeUtils = new MergeUtils(context);
            MergeTarget = mergeTarget;

            Text = MergeStrings.MergeWizardTitle;

            mergeTypePage = new MergeTypePage();
            bestPracticesPage = new MergeBestPracticesPage();
            mergeSourceRangeOfRevisionsPage = new MergeSourceRangeOfRevisionsPage();
            mergeSourceReintegratePage = new MergeSourceReintegratePage();
            mergeSourceTwoDifferentTreesPage = new MergeSourceTwoDifferentTreesPage();
            mergeSourceManuallyRecordPage = new MergeSourceManuallyRecordPage();
            mergeSourceManuallyRemovePage = new MergeSourceManuallyRemovePage();
            mergeRevisionsSelectionPage = new MergeRevisionsSelectionPage();
            mergeOptionsPage = new MergeOptionsPage();
            mergeSummaryPage = new MergeSummaryPage();
        }
Exemple #4
0
        /// <see cref="WizardFramework.IWizard.GetNextPage" />
        public override WizardPage GetNextPage(WizardPage page)
        {
            // Handle the main page
            if (page is MergeTypePage)
            {
                // Handle displaying the best practices page
                if (((MergeTypePage)page).ShowBestPracticesPage
                    && ((MergeBestPracticesPage)bestPracticesPage).DisplayBestPracticesPage)
                    return bestPracticesPage;
                else
                    switch (((MergeTypePage)page).SelectedMergeType)
                    {
                        case MergeType.RangeOfRevisions:
                            return mergeSourceRangeOfRevisionsPage;
                        case MergeType.Reintegrate:
                            return mergeSourceReintegratePage;
                        case MergeType.TwoDifferentTrees:
                            return mergeSourceTwoDifferentTreesPage;
                        case MergeType.ManuallyRecord:
                            return mergeSourceManuallyRecordPage;
                        case MergeType.ManuallyRemove:
                            return mergeSourceManuallyRemovePage;
                        default:
                            return null;
                    }
            }

            // Handle the best practices page
            if (page is MergeBestPracticesPage)
                return null; // For now, if you see the best practices page,
            // you have to fix the issue and then reattempt to merge.

            // Handle the range of revisions page
            if (page is MergeSourceRangeOfRevisionsPage)
            {
                if (((MergeSourceRangeOfRevisionsPage)page).NextPageRequired)
                    return mergeRevisionsSelectionPage;
                else
                    return mergeOptionsPage;
            }

            // Handle the reintegrate page
            // Handle the revision selection page
            // Handle the two different trees page
            if (page is MergeSourceReintegratePage ||
                page is MergeRevisionsSelectionPage ||
                page is MergeSourceTwoDifferentTreesPage)
                return mergeOptionsPage;

            // Handle the manually record/remove pages
            if (page is MergeSourceManuallyRecordPage || page is MergeSourceManuallyRemovePage)
                return mergeRevisionsSelectionPage;

            // Handle the merge options page
            if (page is MergeOptionsPage)
                return mergeSummaryPage;

            return null;
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="currentPage">The current page displayed in the wizard.</param>
 /// <param name="targetPage">The target page attempting to be switched to.</param>
 internal WizardPageChangingEventArgs(WizardPage targetPage)
 {
     _targetPage = targetPage;
 }