-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separated the file save interfaces and classes into separate files an…
…d removed the redundant code
- Loading branch information
Lisa Malenfant
committed
Feb 22, 2024
1 parent
5a1bf04
commit 72638b8
Showing
5 changed files
with
46 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace Vts.Gui.Wpf.FileSystem | ||
{ | ||
public interface ISaveFileDialog | ||
{ | ||
string Filter { get; set; } | ||
bool? ShowDialog(); | ||
string FileName { get; set; } | ||
string DefaultExtension { get; set; } | ||
} | ||
} |
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,10 @@ | ||
using System; | ||
using System.IO; | ||
|
||
namespace Vts.Gui.Wpf.FileSystem | ||
{ | ||
public interface ITextFileService | ||
{ | ||
public Tuple<FileStream, string> OpenTextFile(); | ||
} | ||
} |
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,21 @@ | ||
namespace Vts.Gui.Wpf.FileSystem | ||
{ | ||
public class SaveFileDialog : ISaveFileDialog | ||
{ | ||
public string Filter { get; set; } | ||
public bool? ShowDialog() | ||
{ | ||
var dialog = new Microsoft.Win32.SaveFileDialog | ||
{ | ||
DefaultExt = DefaultExtension ?? ".txt", | ||
Filter = Filter | ||
}; | ||
var result = dialog.ShowDialog(); | ||
FileName = dialog.FileName; | ||
return result; | ||
} | ||
|
||
public string FileName { get; set; } | ||
public string DefaultExtension { get; set; } | ||
} | ||
} |
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