-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VS2010] [VS2008] New Nemerle binaries path calculation algorithm. Cl…
…oses #118.
- Loading branch information
Showing
23 changed files
with
1,343 additions
and
662 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
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
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
134 changes: 134 additions & 0 deletions
134
VsIntegration/Nemerle.VisualStudio/GUI/PromptProjectRenameForm.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
VsIntegration/Nemerle.VisualStudio/GUI/PromptProjectRenameForm.cs
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,74 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Data; | ||
using System.Drawing; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Windows.Forms; | ||
using System.IO; | ||
|
||
namespace Nemerle.VisualStudio.GUI | ||
{ | ||
public partial class PromptProjectRenameForm : Form | ||
{ | ||
public PromptProjectRenameForm(string projectName) | ||
{ | ||
InitializeComponent(); | ||
ProjectName = projectName; | ||
_newProjectName.Text = projectName + "-VS_2008"; | ||
} | ||
|
||
public string ProjectName { get; private set; } | ||
|
||
private void PromptProjectRenameForm_FormClosing(object _, FormClosingEventArgs e) | ||
{ | ||
} | ||
|
||
bool ValidateData() | ||
{ | ||
var newName = _newProjectName.Text; | ||
var isError = string.Equals(ProjectName, newName, StringComparison.InvariantCultureIgnoreCase); | ||
|
||
if (isError) | ||
{ | ||
_errorProvider.SetError(_newProjectName, "The new project name must differ from the old name."); | ||
_yesButton.Enabled = false; | ||
return false; | ||
} | ||
|
||
var isInvalidName = newName.Any(c => Path.GetInvalidFileNameChars().Contains(c)); | ||
|
||
if (isInvalidName) | ||
{ | ||
_errorProvider.SetError(_newProjectName, "The new project name contains invalid characters."); | ||
_yesButton.Enabled = false; | ||
return false; | ||
} | ||
|
||
_errorProvider.SetError(_newProjectName, ""); | ||
_yesButton.Enabled = true; | ||
return true; | ||
} | ||
|
||
private void _newProjectName_Validating(object _, CancelEventArgs e) | ||
{ | ||
_yesButton.Enabled = ValidateData(); | ||
} | ||
|
||
private void _yesButton_Click(object sender, EventArgs e) | ||
{ | ||
if (ValidateData()) | ||
{ | ||
Close(); | ||
DialogResult = System.Windows.Forms.DialogResult.Yes; | ||
ProjectName = _newProjectName.Text; | ||
} | ||
} | ||
|
||
private void _newProjectName_TextChanged(object sender, EventArgs e) | ||
{ | ||
_yesButton.Enabled = ValidateData(); | ||
} | ||
} | ||
} |
Oops, something went wrong.