Skip to content

Commit

Permalink
minor change in demo program
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirkster99 committed Mar 10, 2018
1 parent 161be39 commit 7391f3a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
44 changes: 22 additions & 22 deletions source/InPlaceEditBoxDemo/ViewModels/AppViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,22 +160,30 @@ private async Task SaveSolutionCommand_ExecutedAsync(ISolution solutionRoot)
if (result == null) // User clicked Cancel ...
return;

LastFileAccess = result.Filepath;
SelectedFileExtFilterIndex = result.SelectedFilterIndex;
IsProcessing = true;
try
{
LastFileAccess = result.Filepath;
SelectedFileExtFilterIndex = result.SelectedFilterIndex;

// Convert to model and save model to file system
var solutionModel = new ViewModelModelConverter().ToModel(solutionRoot);
// Convert to model and save model to file system
var solutionModel = new ViewModelModelConverter().ToModel(solutionRoot);

var filename_ext = System.IO.Path.GetExtension(result.Filepath);
switch (filename_ext)
{
case ".solxml":
SolutionModelsLib.Xml.Storage.WriteXmlToFile(result.Filepath, solutionModel);
break;
var filename_ext = System.IO.Path.GetExtension(result.Filepath);
switch (filename_ext)
{
case ".solxml":
SolutionModelsLib.Xml.Storage.WriteXmlToFile(result.Filepath, solutionModel);
break;

default:
var st_result = await SaveSolutionFileAsync(result.Filepath, solutionModel);
break;
default:
var st_result = await SaveSolutionFileAsync(result.Filepath, solutionModel);
break;
}
}
finally
{
IsProcessing = false;
}
}

Expand All @@ -193,15 +201,7 @@ private async Task<bool> SaveSolutionFileAsync(string sourcePath
{
return await Task.Run<bool>(() =>
{
try
{
IsProcessing = true;
return SaveSolutionFile(sourcePath, solutionRoot);
}
finally
{
IsProcessing = false;
}
return SaveSolutionFile(sourcePath, solutionRoot);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal class SolutionViewModel : ViewModels.Base.BaseViewModel, ISolution
/// Gets the file extensions that can be used to load or save the tree view data
/// in Xml or SQLite.
/// </summary>
public readonly string[] fileExtensions = { "solxml", "solsqllite" };
public readonly string[] fileExtensions = { "solxml", "solsqlite" };

/// <summary>
/// Gets a human-readable description for each file extensions that can
Expand Down

0 comments on commit 7391f3a

Please sign in to comment.