@@ -55,49 +55,6 @@ Module FloppyDiskIO
5555 End If
5656 End Function
5757
58- Public Function FloppyDiskSaveFile(Buffer() As Byte , DiskFormat As FloppyDiskFormat, LoadedFileNames As Dictionary( Of String , ImageData)) As String
59- Dim FileExt = ".ima"
60- Dim FileFilter = GetSaveDialogFilters(DiskFormat, FloppyImageType.BasicSectorImage, FileExt)
61-
62- Using Dialog As New SaveFileDialog With {
63- .Filter = FileFilter.Filter,
64- .FilterIndex = FileFilter.FilterIndex,
65- .DefaultExt = FileExt
66- }
67-
68- AddHandler Dialog.FileOk,
69- Sub (sender As Object , e As CancelEventArgs)
70- If LoadedFileNames.ContainsKey(Dialog.FileName) Then
71- Dim Msg = String .Format(My.Resources.Dialog_FileCurrentlyOpen, IO.Path.GetFileName(Dialog.FileName), Environment.NewLine, Application.ProductName)
72- MsgBox(Msg, MsgBoxStyle.Exclamation, WithoutHotkey(My.Resources.Menu_SaveAs))
73- e.Cancel = True
74- End If
75- End Sub
76-
77- If Dialog.ShowDialog = DialogResult.OK Then
78- Dim Success As Boolean
79- Try
80- Dim FloppyImage As New BasicSectorImage(Buffer)
81- Dim Disk As New DiskImage.Disk(FloppyImage, 0 )
82- Dim Response = SaveDiskImageToFile(Disk, Dialog.FileName, False )
83- Success = (Response = SaveImageResponse.Success)
84- Catch ex As Exception
85- DebugException(ex)
86- Success = False
87- End Try
88-
89- If Success Then
90- Return Dialog.FileName
91- Else
92- MsgBox(My.Resources.Dialog_SaveFileError2, MsgBoxStyle.Exclamation)
93- Return ""
94- End If
95- Else
96- Return ""
97- End If
98- End Using
99- End Function
100-
10158 Public Sub FloppyDiskWrite(Owner As IWin32Window, Disk As Disk, Drive As FloppyDriveEnum)
10259 If Disk Is Nothing Then
10360 Exit Sub
0 commit comments