Skip to content

Commit 80570e6

Browse files
committed
fix bugs for creating SaveFileMessage object.
1 parent c3b4402 commit 80570e6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Applications/Ice/Main/Sources/Message.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,16 @@ public static SaveFileMessage ForCompressLocation(SaveQuerySource src) =>
8989
/// <returns>SaveFileDialog object.</returns>
9090
///
9191
/* --------------------------------------------------------------------- */
92-
public static SaveFileMessage ForCompressLocation(string src, Format format) =>
93-
new(src) { Filters = Resource.GetDialogFilters(format) };
92+
public static SaveFileMessage ForCompressLocation(string src, Format format) {
93+
var file = src.HasValue() ? Io.GetFileName(src) : string.Empty;
94+
var dir = src.HasValue() ? Io.GetDirectoryName(src) : string.Empty;
95+
96+
return new() {
97+
Value = file,
98+
InitialDirectory = dir,
99+
Filters = Resource.GetDialogFilters(format),
100+
};
101+
}
94102

95103
/* --------------------------------------------------------------------- */
96104
///

0 commit comments

Comments
 (0)