From 0baa93709b1040b58066e2d1c70bc1e503845bcb Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 5 Oct 2023 14:44:52 +0700 Subject: [PATCH] Made the method static --- .../UI/Clone/GetCloneFromInternetDialog.cs | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs b/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs index a555f60c..f0793417 100644 --- a/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs +++ b/src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs @@ -270,18 +270,26 @@ private void OnDownloadClick(object sender, EventArgs e) /// Starts a clone operation with the supplied information. /// Username for Mercurial authentication /// Password for Mercurial authentication + /// The parent directory to put the clone in /// Name of the project to clone /// URI where the project can be found /// - public void StartClone(string username, string password, string projectName, Uri projectUri) + public static GetCloneFromInternetDialog StartClone(string username, string password, string projectFolder, string projectName, Uri projectUri) { - _model.Username = username; - _model.Password = password; - _model.CustomUrl = projectUri.ToString(); - _model.IsCustomUrl = true; - _model.LocalFolderName = projectName; - - StartClone(); + var model = new GetCloneFromInternetModel(projectFolder) + { + Username = username, + Password = password, + CustomUrl = projectUri.ToString(), + IsCustomUrl = true, + LocalFolderName = projectName + }; + + var dialog = new GetCloneFromInternetDialog(model); + dialog.Show(); + dialog.StartClone(); + + return dialog; } private void StartClone()