private void OkClick(object sender, EventArgs e) { if (Remotebranch.Checked) { var checkoutRemote = new FormCheckoutRemoteBranch(Branches.Text, Force.Checked); checkoutRemote.ShowDialog(this); } else { try { var command = "checkout"; if (Force.Checked) command += " --force"; command += " \"" + Branches.Text + "\""; var form = new FormProcess(command); form.ShowDialog(this); if (!form.ErrorOccurred()) Close(); } catch (Exception ex) { Trace.WriteLine(ex.Message); } } }
private void OkClick(object sender, EventArgs e) { if (Remotebranch.Checked) { var checkoutRemote = new FormCheckoutRemoteBranch(Branches.Text, Force.Checked); checkoutRemote.ShowDialog(this); } else { try { var command = "checkout"; if (Force.Checked) { command += " --force"; } command += " \"" + Branches.Text + "\""; var form = new FormProcess(command); form.ShowDialog(this); if (!form.ErrorOccurred()) { Close(); } } catch (Exception ex) { Trace.WriteLine(ex.Message); } } }
public bool StartCheckoutRemoteBranchDialog(IWin32Window owner, string branch) { if (!RequiresValidWorkingDir()) { return(false); } if (!InvokeEvent(PreCheckoutBranch)) { return(false); } bool needRefresh; if (CheckForDirtyDir(owner, out needRefresh)) { return(needRefresh); } var form = new FormCheckoutRemoteBranch(branch); form.ShowDialog(owner); InvokeEvent(PostCheckoutBranch); return(true); }
public bool StartCheckoutRemoteBranchDialog(IWin32Window owner, string branch) { if (!RequiresValidWorkingDir()) { return(false); } if (!InvokeEvent(owner, PreCheckoutBranch)) { return(false); } bool needRefresh; bool force; if (CheckForDirtyDir(owner, out needRefresh, out force)) { return(needRefresh); } var form = new FormCheckoutRemoteBranch(branch, force); if (form.ShowDialog(owner) == DialogResult.Cancel) { return(false); } InvokeEvent(owner, PostCheckoutBranch); return(true); }
public bool StartCheckoutRemoteBranchDialog(IWin32Window owner, string branch) { if (!RequiresValidWorkingDir()) return false; if (!InvokeEvent(owner, PreCheckoutBranch)) return false; bool needRefresh; bool force; if (CheckForDirtyDir(owner, out needRefresh, out force)) return needRefresh; var form = new FormCheckoutRemoteBranch(branch, force); if (form.ShowDialog(owner) == DialogResult.Cancel) return false; InvokeEvent(owner, PostCheckoutBranch); return true; }
public bool StartCheckoutRemoteBranchDialog(IWin32Window owner, string branch) { if (!RequiresValidWorkingDir(owner)) return false; if (!InvokeEvent(owner, PreCheckoutBranch)) return false; using (var form = new FormCheckoutRemoteBranch(branch)) { if (form.ShowDialog(owner) == DialogResult.Cancel) return false; } InvokeEvent(owner, PostCheckoutBranch); return true; }
private void OkClick(object sender, EventArgs e) { LocalChanges changes; if (rbReset.Checked) changes = LocalChanges.Reset; else if (rbMerge.Checked) changes = LocalChanges.Merge; else changes = LocalChanges.DontChange; Settings.CheckoutBranchAction = (int)changes; if (Remotebranch.Checked) { using (var checkoutRemote = new FormCheckoutRemoteBranch(Branches.Text, changes)) checkoutRemote.ShowDialog(this); } else { try { var command = GitCommandHelpers.CheckoutCmd(Branches.Text, changes); var successfullyCheckedOut = FormProcess.ShowDialog(this, command); if (successfullyCheckedOut) Close(); } catch (Exception ex) { Trace.WriteLine(ex.Message); } } }
public bool StartCheckoutRemoteBranchDialog(IWin32Window owner, string branch) { if (!RequiresValidWorkingDir()) return false; if (!InvokeEvent(PreCheckoutBranch)) return false; bool needRefresh; if (CheckForDirtyDir(owner, out needRefresh)) return needRefresh; var form = new FormCheckoutRemoteBranch(branch); form.ShowDialog(owner); InvokeEvent(PostCheckoutBranch); return true; }