-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1718ecb
commit 8443b59
Showing
10 changed files
with
1,194 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.Windows.Forms; | ||
|
||
namespace Perforce.P4VS | ||
{ | ||
public partial class DlgRenameWorkspace : AutoSizeForm | ||
{ | ||
public DlgRenameWorkspace(string caption, string prompt, string DefaultValue) | ||
{ | ||
PreferenceKey = "DlgRenameWorkspace"; | ||
|
||
InitializeComponent(); | ||
|
||
this.Icon = Images.icon_p4vs_16px; | ||
this.Text = caption; | ||
renameWorkspaceLbl.Text = prompt; | ||
getNewNameLbl.Text = Resources.WorkspacesWindowControl_RenameWorkspaceNewNameLabel; | ||
warningLbl.Text = Resources.WorlspacesWindowControl_RenameWorkspaceWarningInfo; | ||
EnableDisableRenameWorkspaceBtn(); | ||
} | ||
|
||
private DlgRenameWorkspace() {} | ||
|
||
public string Value { get { return ValueTB.Text; } } | ||
|
||
public static string Show(string Caption, string prompt, string DefaultValue) | ||
{ | ||
DlgRenameWorkspace dlg = new DlgRenameWorkspace(Caption, prompt, DefaultValue); | ||
|
||
if (dlg.ShowDialog() != DialogResult.Cancel) | ||
{ | ||
if (dlg.DialogResult == DialogResult.OK) | ||
{ | ||
return dlg.Value; | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
|
||
private void ValueTB_KeyDown(object sender, KeyEventArgs e) | ||
{ | ||
if (e.KeyCode == Keys.Return) | ||
renameWorkspaceBtn.PerformClick(); | ||
} | ||
|
||
private void ValueTB_TextChanged(object sender, EventArgs e) | ||
{ | ||
EnableDisableRenameWorkspaceBtn(); | ||
} | ||
|
||
private void EnableDisableRenameWorkspaceBtn() | ||
{ | ||
renameWorkspaceBtn.Enabled = !(string.IsNullOrWhiteSpace(ValueTB.Text)); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.