Browse files

Fix compiler warning.

  • Loading branch information...
1 parent 82acae3 commit 7fed1f99e4a72783288ec7b77d32d559d5f94d3e @dgrunwald dgrunwald committed Mar 17, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/Main/Base/Project/Src/Project/Behaviors/DotNetStartBehavior.cs
View
9 src/Main/Base/Project/Src/Project/Behaviors/DotNetStartBehavior.cs
@@ -336,11 +336,12 @@ static bool SafeFileExists(string directory, string fileName)
public StartAction StartAction {
get {
- try {
- return (StartAction)Enum.Parse(typeof(StartAction), ((MSBuildBasedProject)Project).GetEvaluatedProperty("StartAction") ?? "Project");
- } catch (ArgumentException ex) {
+ string propertyValue = ((MSBuildBasedProject)Project).GetEvaluatedProperty("StartAction") ?? "Project";
+ StartAction action;
+ if (Enum.TryParse(propertyValue, out action))
+ return action;
+ else
return StartAction.Project;
- }
}
set {
((MSBuildBasedProject)Project).SetProperty("StartAction", value.ToString());

0 comments on commit 7fed1f9

Please sign in to comment.