@@ -134,22 +134,22 @@ await RunTaskAsync(token => Task.Run(() =>
134134 PathUtilities . MakeRelative ( assemblyToProjectSwitch . ToProject . Path ,
135135 project . CurrentConfigurationPath ) + "\t " +
136136 PathUtilities . MakeRelative ( fromAssemblyPath , project . CurrentConfigurationPath ) +
137- "\n " ;
138-
139- if ( SaveProjects )
140- {
141- project . Save ( ) ;
142- }
137+ "\n " ;
143138 }
144139 else
145140 {
146141 MessageBox . Show (
147142 "Cannot switch from assembly '" + assemblyToProjectSwitch . FromAssemblyName + "' to project '" + assemblyToProjectSwitch . ToProjectPath +
148- "' because project is not loaded. " , "Project not loaded" ) ;
143+ "' because project is not loaded. " , "Project not loaded" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
149144 }
150145 }
151146 }
152147
148+ if ( SaveProjects )
149+ {
150+ project . Save ( ) ;
151+ }
152+
153153 if ( ! string . IsNullOrEmpty ( nuGetReferenceTransformationsForProject ) )
154154 {
155155 File . AppendAllText ( project . CurrentConfigurationPath , nuGetReferenceTransformationsForProject ) ;
@@ -162,7 +162,7 @@ await RunTaskAsync(token => Task.Run(() =>
162162 /// <param name="exception">The exception. </param>
163163 public override void HandleException ( Exception exception )
164164 {
165- MessageBox . Show ( exception . Message , "An error occurred" ) ;
165+ MessageBox . Show ( exception . Message , "An error occurred" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
166166 }
167167
168168 /// <summary>Switches the project references to the previously referenced NuGet DLLs. </summary>
@@ -187,14 +187,14 @@ await RunTaskAsync(token => Task.Run(() =>
187187 if ( ! successfullyAdded )
188188 {
189189 MessageBox . Show ( "The project '" + transformation . ToAssemblyPath + "' could not be added. " +
190- "\n Skipped." , "Could not add project" ) ;
191- }
192-
193- if ( SaveProjects )
194- project . Save ( ) ;
190+ "\n Skipped." , "Could not add project" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
191+ }
195192 }
196193 }
197194
195+ if ( SaveProjects )
196+ project . Save ( ) ;
197+
198198 project . DeleteConfigurationFile ( ) ;
199199 }
200200
@@ -236,7 +236,7 @@ private void AddProjectToSolutionIfNeeded(FromNuGetToProjectTransformation fromN
236236 fromNuGetToProjectTransformation . ToProject = myProject ;
237237 }
238238 else
239- MessageBox . Show ( "The project '" + fromNuGetToProjectTransformation . ToProjectPath + "' could not be found. (ignored)" , "Project not found" ) ;
239+ MessageBox . Show ( "The project '" + fromNuGetToProjectTransformation . ToProjectPath + "' could not be found. (ignored)" , "Project not found" , MessageBoxButton . OK , MessageBoxImage . Stop ) ;
240240 }
241241 }
242242
0 commit comments