本文整理汇总了C#中GitUICommands.StartBrowseDialog方法的典型用法代码示例。如果您正苦于以下问题:C# GitUICommands.StartBrowseDialog方法的具体用法?C# GitUICommands.StartBrowseDialog怎么用?C# GitUICommands.StartBrowseDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitUICommands
的用法示例。
在下文中一共展示了GitUICommands.StartBrowseDialog方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OkClick
private void OkClick(object sender, EventArgs e)
{
try
{
Cursor = Cursors.Default;
_branchListLoader.Cancel();
var dirTo = _NO_TRANSLATE_To.Text;
if (!dirTo.EndsWith(AppSettings.PathSeparator.ToString()) && !dirTo.EndsWith(AppSettings.PathSeparatorWrong.ToString()))
dirTo += AppSettings.PathSeparator.ToString();
dirTo += _NO_TRANSLATE_NewDirectory.Text;
Repositories.AddMostRecentRepository(_NO_TRANSLATE_From.Text);
Repositories.AddMostRecentRepository(dirTo);
if (!Directory.Exists(dirTo))
Directory.CreateDirectory(dirTo);
var cloneCmd = GitCommandHelpers.CloneCmd(_NO_TRANSLATE_From.Text, dirTo,
CentralRepository.Checked, cbIntializeAllSubmodules.Checked, Branches.Text, null);
using (var fromProcess = new FormRemoteProcess(Module, AppSettings.GitCommand, cloneCmd))
{
fromProcess.SetUrlTryingToConnect(_NO_TRANSLATE_From.Text);
fromProcess.ShowDialog(this);
if (fromProcess.ErrorOccurred() || Module.InTheMiddleOfPatch())
return;
}
if (openedFromProtocolHandler && AskIfNewRepositoryShouldBeOpened(dirTo))
{
Hide();
GitUICommands uiCommands = new GitUICommands(dirTo);
uiCommands.StartBrowseDialog();
}
else if (ShowInTaskbar == false && GitModuleChanged != null &&
AskIfNewRepositoryShouldBeOpened(dirTo))
GitModuleChanged(new GitModule(dirTo));
Close();
}
catch (Exception ex)
{
MessageBox.Show(this, "Exception: " + ex.Message, "Clone failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
示例2: OkClick
private void OkClick(object sender, EventArgs e)
{
try
{
Cursor = Cursors.Default;
_branchListLoader.Cancel();
var dirTo = Path.Combine(_NO_TRANSLATE_To.Text, _NO_TRANSLATE_NewDirectory.Text);
Repositories.AddMostRecentRepository(_NO_TRANSLATE_From.Text);
if (!Directory.Exists(dirTo))
Directory.CreateDirectory(dirTo);
// Shallow clone params
int? depth = null;
bool? isSingleBranch = null;
if(!cbDownloadFullHistory.Checked)
{
depth = 1;
// Single branch considerations:
// If neither depth nor single-branch family params are specified, then it's like no-single-branch by default.
// If depth is specified, then single-branch is assumed.
// But with single-branch it's really nontrivial to switch to another branch in the GUI, and it's very hard in cmdline (obvious choices to fetch another branch lead to local repo corruption).
// So let's reset it to no-single-branch to (a) have the same branches behavior as with full clone, and (b) make it easier for users when switching branches.
isSingleBranch = false;
}
// Branch name param
string branch = _NO_TRANSLATE_Branches.Text;
if(branch == _branchDefaultRemoteHead.Text)
branch = "";
else if(branch == _branchNone.Text)
branch = null;
var cloneCmd = GitCommandHelpers.CloneCmd(_NO_TRANSLATE_From.Text, dirTo,
CentralRepository.Checked, cbIntializeAllSubmodules.Checked, branch, depth, isSingleBranch);
using (var fromProcess = new FormRemoteProcess(Module, AppSettings.GitCommand, cloneCmd))
{
fromProcess.SetUrlTryingToConnect(_NO_TRANSLATE_From.Text);
fromProcess.ShowDialog(this);
if (fromProcess.ErrorOccurred() || Module.InTheMiddleOfPatch())
return;
}
Repositories.AddMostRecentRepository(dirTo);
if (openedFromProtocolHandler && AskIfNewRepositoryShouldBeOpened(dirTo))
{
Hide();
GitUICommands uiCommands = new GitUICommands(dirTo);
uiCommands.StartBrowseDialog();
}
else if (ShowInTaskbar == false && GitModuleChanged != null &&
AskIfNewRepositoryShouldBeOpened(dirTo))
GitModuleChanged(this, new GitModuleEventArgs(new GitModule(dirTo)));
Close();
}
catch (Exception ex)
{
MessageBox.Show(this, "Exception: " + ex.Message, "Clone failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}